Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Ab)using LIBRARY_PATH instead of using -L${SAGE_LOCAL}/lib doesn't necessarily work #14709

Closed
nexttime mannequin opened this issue Jun 9, 2013 · 2 comments
Closed

Comments

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jun 9, 2013

In sage-env, we meanwhile add (more precisely, append) ${SAGE_LOCAL}/include to CPATH, and ${SAGE_LOCAL}/lib to LIBRARY_PATH.

Besides that this is non-portable, or rather a GCC feature, it is not equivalent to adding / prepending -I${SAGE_LOCAL}/include to CPPFLAGS/CFLAGS/CXXFLAGS and -L${SAGE_LOCAL}/lib to LDFLAGS.

First of all, search paths / folders specified on the command line precede all others, and second, those specified through CPATH, LIBRARY_PATH etc. are not necessarily searched before system folders.

This currently leads to problems with e.g. readline and R (which doesn't support configuring with --with-readline=<prefix>, but just =yes or =no), where adding Sage's directories was dropped from spkg-install.

To test this, try for example

$ mkdir -pv /tmp/LOOK_HERE

$ env LIBRARY_PATH=/tmp/LOOK_HERE $CC -print-search-dirs | egrep '^libraries|LOOK_HERE'

# (and/or)

$ env LIBRARY_PATH=/tmp/LOOK_HERE $CC -v -x c /dev/null -o /dev/null 2>&1 | egrep '^LIBRARY_PATH|LOOK_HERE'

where $CC is the compiler / GCC of your choice (e.g. just gcc).

Component: build

Keywords: CPATH LIBRARY_PATH SAGE_LOCAL -I -L sage-env search directories paths

Issue created by migration from https://trac.sagemath.org/ticket/14709

@nexttime nexttime mannequin added this to the sage-5.11 milestone Jun 9, 2013
@nexttime nexttime mannequin added c: build labels Jun 9, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@jpflori
Copy link

jpflori commented Oct 24, 2013

comment:2

Isn't LIBRARY_PATH for runtime whereas LD_LIBRARY_PATH is for linking?

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@vbraun
Copy link
Member

vbraun commented Jul 8, 2017

comment:6

Not using LIBRARY_PATH any more

@vbraun vbraun closed this as completed Jul 8, 2017
@vbraun vbraun removed this from the sage-6.4 milestone Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants