sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 462 forks source link

Remove (DY)LD_LIBRARY_PATH #19641

Closed vbraun closed 8 years ago

vbraun commented 8 years ago

In principle, we just have to compile Sage with

LDFLAGS=-Wl,-rpath,$SAGE_LOCAL/lib

to use rpath instead of LD_LIBRARY_PATH

Using #19467 this will work with binary distribution

Benefits to Sage:

Depends on #19640 Depends on #19699

CC: @jdemeyer @kiwifb @nbruin

Component: build

Author: Volker Braun

Branch/Commit: 0a890f7

Reviewer: François Bissey

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

vbraun commented 8 years ago

Branch: u/vbraun/remove_ld_library_path

vbraun commented 8 years ago

Commit: ba7c0a8

vbraun commented 8 years ago
comment:2

With the attached branch I can build Sage and all tests pass except three using the quadratic sieve (build/pkgs/flintqs). Which is no surprise if you look at its build "system".


New commits:

b68082bDo not drop LDFLAGS in fflas_ffpack
27f1f4bDo not drop LDFLAGS in freetype
fb647deDo not drop LDFLAGS in gfan
49ae3fcDo not drop LDFLAGS in m4rie
93973ffDo not drop LDFLAGS in matplotlib
77032e7Do not drop LDFLAGS in ginac
8e40ca6Do not drop LDFLAGS in ratpoints
4c53d29Do not drop LDFLAGS in arb
0214c00Do not drop LDFLAGS in Singular
ba7c0a8Replace LD_LIBRARY_PATH with rpath
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from ba7c0a8 to 22def30

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

618651eOnly change CXX for Singular
22def30Replace LD_LIBRARY_PATH with rpath
kiwifb commented 8 years ago
comment:4

Fixing flintqs should be trivial, there is one makefile for SAGE64 and one used otherwise - and for the record that's the diff between the two

--- makefile.osx64  2009-01-21 03:11:18.000000000 +1300
+++ makefile.sage   2007-05-06 11:00:10.000000000 +1200
@@ -27,8 +27,8 @@
 BIN  = QuadraticSieve QuadraticSieve.exe
 #CXXFLAGS = $(CXXINCS) -Wall -Wno-sign-compare -march=athlon-xp -fomit-frame-pointer -O2
 #CXXFLAGS2 = $(CXXINCS) -Wall -Wno-sign-compare -march=athlon-xp -fomit-frame-pointer -O3
-CXXFLAGS = $(CXXINCS) -Wall -Wno-sign-compare -fomit-frame-pointer -O2 -m64
-CXXFLAGS2 = $(CXXINCS) -Wall -Wno-sign-compare -fomit-frame-pointer -O3 -m64
+CXXFLAGS = $(CXXINCS) -Wall -Wno-sign-compare -fomit-frame-pointer -O2
+CXXFLAGS2 = $(CXXINCS) -Wall -Wno-sign-compare -fomit-frame-pointer -O3
 RM = rm -f

 .PHONY: all clean clean-custom
@@ -39,7 +39,7 @@
    ${RM} $(OBJ) $(BIN)

 $(BIN): $(OBJ)
-   $(CPP) -ansi -m64 $(LINKOBJ) -o "QuadraticSieve" $(LIBS)
+   $(CPP) -ansi $(LINKOBJ) -o "QuadraticSieve" $(LIBS)

 ModuloArith.o: ModuloArith.cpp
    $(CPP) -ansi -c ModuloArith.cpp -o ModuloArith.o $(CXXFLAGS)

Anyway $(LDFLAGS) can be easily added to the line building QuadraticSieve in both (if really necessary).

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

422fee4Replace LD_LIBRARY_PATH with rpath
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 22def30 to 422fee4

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 422fee4 to de6046f

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a97838dReplace LD_LIBRARY_PATH with rpath
768ab70Update to flintqs-1.0
e72cefaUpdate SPKG.txt
48993f2Remove the patches that are now in upstream
de6046fMerge in #19699
vbraun commented 8 years ago

Changed dependencies from #19640 to #19640, #19699

vbraun commented 8 years ago
comment:7

With #19699 Sage builds and all doctests pass

kiwifb commented 8 years ago

Reviewer: François Bissey

kiwifb commented 8 years ago
comment:8

Fine with me.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from de6046f to ab27029

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

ab27029OSX ld only understands the older rpath syntax
83660e46-0051-498b-a8c1-f7a7bd232b5a commented 8 years ago
comment:10

Replying to @sagetrac-git:

Branch pushed to git repo; I updated commit sha1. New commits:

ab27029OSX ld only understands the older rpath syntax

Minor, but is there a reason not to use

LDFLAGS="-Wl,-rpath,$SAGE_LOCAL/lib $LDFLAGS"

?

(That's the only difference to -Xlinker where every argument has to be passed separately.)

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

fb6a4f0Use the single-argument version for rpath
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from ab27029 to fb6a4f0

vbraun commented 8 years ago
comment:12

I noticed already that maxima can't handle the two-argument version of sending the linker args, so we'll have to use this syntax.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 8 years ago
comment:13

Replying to @vbraun:

I noticed already that maxima can't handle the two-argument version of sending the linker args, so we'll have to use this syntax.

Hmmm, a regression? (cf. #12759)

vbraun commented 8 years ago
comment:14

Looks more like it has always been that way. Unsetting LDFLAGS doesn't really fix the issue (cf. #12759)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 8 years ago
comment:15

Replying to @vbraun:

Looks more like it has always been that way. Unsetting LDFLAGS doesn't really fix the issue (cf. #12759)

? I don't recall myself, but two people claimed it got fixed upstream (in 5.29.1 and later).

(And unsetting LDFLAGS in Maxima's spkg-install used to work because ECL's were used by Maxima anyway, assuming the settings are the same of course.)

vbraun commented 8 years ago
comment:16

Works on OSX now

vbraun commented 8 years ago

Author: Volker Braun

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

51eb6f0Also use rpath in stage 1 of gcc bootstrap
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from fb6a4f0 to 51eb6f0

vbraun commented 8 years ago
comment:18

Bootstrapping gcc fails with

/home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/gcc-4.9.2.p1/gcc-build/./gcc/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory

should be fixed now

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 51eb6f0 to a0899bd

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

a0899bdUse BOOT_LDFLAGS instead of --with-stage1-ldflags
vbraun commented 8 years ago
comment:20

Of course using with-stage1-ldflags then fails in stage2; Correct solution from https://gcc.gnu.org/ml/gcc/2008-09/msg00214.html

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from a0899bd to 8cc102b

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

8cc102bTachyon also dropped LDFLAGS
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

bd1ae89Add rpath to lib64, too
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from 8cc102b to bd1ae89

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from bd1ae89 to 0a890f7

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

69ae87fRubiks: Do not drop LDFLAGS
0a890f7Rubiks: Regenerate Makefile patches
vbraun commented 8 years ago
comment:24

Now works on all buildbot machines

vbraun commented 8 years ago

Changed branch from u/vbraun/remove_ld_library_path to 0a890f7