#14709: (Ab)using LIBRARY_PATH instead of using -L${SAGE_LOCAL}/lib doesn't
necessarily work
------------------------+---------------------------------------------------
   Reporter:  leif      |             Owner:  GeorgSWeber                       
                                   
       Type:  defect    |            Status:  new                               
                                   
   Priority:  critical  |         Milestone:  sage-5.10                         
                                   
  Component:  build     |          Keywords:  CPATH LIBRARY_PATH SAGE_LOCAL -I 
-L sage-env search directories paths
Work issues:            |   Report Upstream:  N/A                               
                                   
  Reviewers:            |           Authors:                                    
                                   
  Merged in:            |      Dependencies:                                    
                                   
   Stopgaps:            |  
------------------------+---------------------------------------------------
 In `sage-env`, we meanwhile add (more precisely, '''ap'''pend)
 `${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
 {{{
 #!sh
 $ 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`).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14709>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to