Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#13348 closed enhancement (fixed)

Set CPATH in sage-env

Reported by: jdemeyer Owned by: GeorgSWeber
Priority: major Milestone: sage-5.4
Component: build Keywords:
Cc: leif Merged in: sage-5.4.beta2
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

Since we're setting LIBRARY_PATH in sage-env (which is the compile-time equivalent of LD_LIBRARY_PATH, corresponding to the compiler flag -L), we should analogously set CPATH to SAGE_LOCAL/include (corresponding to the compiler flag -I). This is already done in the spkg-install file for sagenb-0.10.2.

Within Sage, SAGE_LOCAL effectively acts as installation prefix, so this is the logical thing to do. A GCC compiled within Sage will already look at SAGE_LOCAL/include by default.

This doesn't immediately change anything, but it will allow simplifying many spkg-install files by not having to care about -I$SAGE_LOCAL/include anymore.

Apply 13348_CPATH.patch to SAGE_ROOT.

Attachments (1)

13348_CPATH.patch (1.5 KB) - added by jdemeyer 7 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by jdemeyer

  • Priority changed from blocker to major

comment:2 Changed 8 years ago by leif

  • Cc leif added

comment:3 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.3 to sage-5.4
  • Status changed from new to needs_review

comment:4 Changed 7 years ago by jdemeyer

  • Description modified (diff)

comment:5 Changed 7 years ago by jdemeyer

  • Description modified (diff)

Changed 7 years ago by jdemeyer

comment:6 Changed 7 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Looks good to me.

comment:7 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.4.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:8 Changed 7 years ago by jdemeyer

  • Description modified (diff)

comment:9 follow-up: Changed 7 years ago by leif

Setting CPATH, LIBRARY_PATH etc. is certainly not equivalent to passing -I... and -L... on the command line, since directories specified explicitly are always searched first.

Furthermore, Sage's paths should get prepended, not appended, at least if using this feature is supposed to "replace" explicitly specifying paths in commands / CFLAGS, CPPFLAGS and LDFLAGS, e.g. in spkg-install scripts.

And if ld is used directly (as opposed to linking with gcc / g++ etc.), LIBRARY_PATH won't get used at all (unless it is part of the make rule, say).

comment:10 in reply to: ↑ 9 Changed 7 years ago by leif

Replying to leif:

Setting CPATH, LIBRARY_PATH etc. is certainly not equivalent to passing -I... and -L... on the command line, since directories specified explicitly are always searched first.

Furthermore, Sage's paths should get prepended, not appended, at least if using this feature is supposed to "replace" explicitly specifying paths in commands / CFLAGS, CPPFLAGS and LDFLAGS, e.g. in spkg-install scripts.

And if ld is used directly (as opposed to linking with gcc / g++ etc.), LIBRARY_PATH won't get used at all (unless it is part of the make rule, say).

Even if $SAGE_LOCAL/lib got prepended to LIBRARY_PATH, system folders might still get searched before those specified in LIBRARY_PATH.

Follow-up: #14709

Note: See TracTickets for help on using tickets.