#11970: r-2.10.1.p4 may fail to configure with readline (BLOCKS Sage from 
building
on Ubuntu 11.10)
------------------------------+---------------------------------------------
   Reporter:  Snark           |          Owner:  tbd                            
                                         
       Type:  defect          |         Status:  needs_work                     
                                         
   Priority:  blocker         |      Milestone:  sage-4.8                       
                                         
  Component:  packages        |       Keywords:  Oneiric Ocelot Ubuntu 11.10 
ARM libtermcap libncurses libtinfo r-project
Work_issues:                  |       Upstream:  N/A                            
                                         
   Reviewer:  Jeroen Demeyer  |         Author:  Leif Leonhardy                 
                                         
     Merged:                  |   Dependencies:                                 
                                         
------------------------------+---------------------------------------------

Comment(by leif):

 Replying to [comment:29 jdemeyer]:
 > Here is a first interesting data point:
 >
 > Let `tgetent_test.c` be following file:
 {{{
 #include <termcap.h>
 #include <stdlib.h>

 int main(int argc, char** argv)
 {
     char* buf = malloc(100000);
     tgetent(buf, "dumb");
 }
 }}}

 FWIW, I did `#include <term.h>` and used `-lcurses`, since termcap is part
 of ncurses on Ubuntu/Debian.

 [[BR]]

 > Compiling this with
 {{{
 $ gcc -ltermcap tgetent_test.c -o tgetent_test
 }}}
 > and running it works flawlessly.

 Libraries should in general be specified '''after''' the modules that use
 (parts of) them.  This is (again) mandatory with newer Linux distros as
 you will know (cf. the Symmetrica and Singular changes for Ubuntu 11.10).

 Some linkers seem to make a difference w.r.t. whether they find a
 ''static'' library [only] (or depending on whether `LIBRARY_PATH` is set?
 -- which `sage-env` does).

 [[BR]]

 > However, the same gcc command with the Sage environment variables gives
 {{{
 $ ( source local/bin/sage-env; gcc -ltermcap tgetent_test.c -o
 tgetent_test )
 /tmp/ccwDi3Oi.o: In function `main':
 tgetent_test.c:(.text+0x27): undefined reference to `tgetent'
 collect2: ld returned 1 exit status
 }}}

 This problem vanishes if you
  * put `-ltermcap` last (as one would expect), or
  * `unset LIBRARY_PATH` after sourcing `sage-env` (in which case Sage's
 `libtermcap.a` of course isn't used), or
  * both.

 Anyway, I don't think this is related to our problem; Sage's readline
 ''shouldn't''^TM^ use ''Sage's'' termcap library at all; on Ubuntu,
 libtermcap* is a symlink to libncurses*.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11970#comment:33>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to