Opened 11 years ago

Closed 11 years ago

Last modified 4 years ago

#9431 closed defect (fixed)

opencdk spkg should add $SAGE_LOCAL/lib to LDFLAGS

Reported by: rlm Owned by: GeorgSWeber
Priority: blocker Milestone: sage-4.5
Component: build Keywords:
Cc: wjp, saliola Merged in: sage-4.5.alpha4
Authors: Willem Jan Palenstijn Reviewers: Robert Miller
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Willem explained this one to me. Apparently opencdk is now linking libgcrypt from the wrong place, due to libtools, caused by the addition of -lgcrypt in #8658. The short term fix is to make sure that $SAGE_LOCAL/lib is included in LDFLAGS in the spkg-install script, but the longer term fix will be to figure out why libtools is linking against /usr/lib in the first place.

Change History (7)

comment:1 Changed 11 years ago by wjp

Some relevant lines in the build log:

/bin/sh ../libtool --tag=CC   --mode=link gcc  -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -no-install  -o t-stream t-stream.o ../src/ -lgcrypt -lz

gcc -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -o t-stream t-stream.o  ../src/.libs/ /usr/lib64/ -lz -Wl,--rpath -Wl,/data2/wpalenst/sage-4.4.4/spkg/build/opencdk-0.6.6.p4/src/src/.libs -Wl,--rpath -Wl,/data2/wpalenst/sage-4.4.4/local/lib
../src/.libs/ undefined reference to `gcry_cipher_setkey@GCRYPT_1.2'
../src/.libs/ undefined reference to `gcry_cipher_setiv@GCRYPT_1.2'

On another machine on which I've tried, opencdk also ended linking its tests against /usr/lib64/, but it didn't cause an error there.

comment:2 Changed 11 years ago by wjp

Some more preliminary results:

It seems that adding $SAGE_LOCAL/lib to $LIBRARY_PATH as sage-env does, might have unexpected effects:

On 64 bit gentoo:

$ export LIBRARY_PATH=/blah
$ gcc -print-search-dirs
libraries: =/blah/x86_64-pc-linux-gnu/4.1.2/:/blah/../lib64/

So $SAGE_LOCAL/lib does _not_ end up being searched by gcc in this case. (But the non-existent $SAGE_LOCAL/lib64 does.)

On 64 bit debian (Lenny), this is

libraries: =/blah/x86_64-linux-gnu/4.3.2/:/blah/../lib/

It looks like we're completely mis-using LIBRARY_PATH... Maybe it's worth considering putting -L$SAGE_LOCAL/lib in $LDFLAGS in sage-env.

comment:3 Changed 11 years ago by saliola

  • Cc saliola added

comment:4 Changed 11 years ago by wjp

  • Status changed from new to needs_review

comment:5 Changed 11 years ago by rlm

  • Authors set to Willem jan Palenstijn
  • Reviewers set to Robert Miller
  • Status changed from needs_review to positive_review

comment:6 Changed 11 years ago by rlm

  • Merged in set to sage-4.5.alpha4
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:7 Changed 4 years ago by chapoton

  • Authors changed from Willem jan Palenstijn to Willem Jan Palenstijn
Note: See TracTickets for help on using tickets.