sagemath / sage

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

Pari fails to build on AIX #9990

Closed bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 closed 6 years ago

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago

The Pari svn snapshot 12577 is failing to build properly on AIX. If the Pari developers would like access to AIX hardware (I don't think they have it), then I can provide access to my personal RS/6000

Reported upstream: http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1102

Hardware and software

gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer  -O3 -g   -I. -I../src/headers -fPIC -o thue.o ../src/modules/thue.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer  -O3 -g   -I. -I../src/headers -I../src/graph -o gp_init.o ../src/gp/gp_init.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer  -O3 -g   -I. -I../src/headers -DDL_DFLT_NAME=NULL -o highlvl.o ../src/gp/highlvl.c
rm -f libpari-gmp-2.4.so.3.0.0
gcc  -o "/home/users/drkirkby/sage-4.6.alpha1/spkg/build/pari-2.4.3.svn-12577.p5/src/Oaix-ppc"/libpari-gmp-2.4.so.3.0.0 -shared  -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer  -O3 -g   -fP
IC -Wl,-r  mp.o mpinl.o F2x.o FF.o Flx.o FpE.o FpV.o FpX.o Qfb.o RgV.o RgX.o ZV.o ZX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o base3.o base4.o base5.o bb_group.o bibli1.o bibli2.o
bit.o buch1.o buch2.o buch3.o buch4.o concat.o ellanal.o elliptic.o galconj.o gen1.o gen2.o gen3.o hnf_snf.o ifactor1.o lll.o perm.o polarit1.o polarit2.o polarit3.o prime.o random.o rootpol.o s
ubcyclo.o subgroup.o trans1.o trans2.o trans3.o anal.o compat.o compile.o default.o errmsg.o es.o eval.o hash.o init.o intnum.o members.o pariinl.o parse.o sumiter.o DedekZeta.o Hensel.o QX_fact
or.o aprcl.o elldata.o ellsea.o galois.o galpol.o groupid.o krasner.o kummer.o mpqs.o nffactor.o part.o stark.o subfield.o thue.o  -L/home/users/drkirkby/sage-4.6.alpha1/local/lib -lgmp
if test "libpari-gmp-2.4.so.3.0.0" != "libpari.so"; then          rm -f libpari.so;       ln -s libpari-gmp-2.4.so.3.0.0 libpari.so; fi
if test "libpari-gmp-2.4.so.3.0.0" != "libpari-gmp-2.4.so.3"; then        rm -f libpari-gmp-2.4.so.3;     ln -s libpari-gmp-2.4.so.3.0.0 libpari-gmp-2.4.so.3; fi
rm -f gp-dyn
gcc  -o gp-dyn -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer  -O3 -g   -Wl,-brtl  gp.o gp_init.o gp_rl.o highlvl.o whatnow.o plotport.o plotnull.o  -L"/home/users/drkirkby/sage-4.6.alpha1/
spkg/build/pari-2.4.3.svn-12577.p5/src/Oaix-ppc" -L/home/users/drkirkby/sage-4.6.alpha1/local/lib -lreadline -L/home/users/drkirkby/sage-4.6.alpha1/local/lib/ -ltermcap -L"/home/users/drkirkby/s
age-4.6.alpha1/local/lib" -lpari  -lm
ld: 0711-434 SEVERE ERROR: Shared object /home/users/drkirkby/sage-4.6.alpha1/spkg/build/pari-2.4.3.svn-12577.p5/src/Oaix-ppc/libpari.so
        The shared object has no .loader section and is being ignored.
collect2: ld returned 12 exit status
make[3]: *** [gp-dyn] Error 1
make[3]: Target `gp' not remade because of errors.
make[3]: Leaving directory `/home/users/drkirkby/sage-4.6.alpha1/spkg/build/pari-2.4.3.svn-12577.p5/src/Oaix-ppc'
make[2]: *** [gp] Error 2
make[2]: Leaving directory `/home/users/drkirkby/sage-4.6.alpha1/spkg/build/pari-2.4.3.svn-12577.p5/src'
Error building GP

Upstream: Reported upstream. Developers acknowledge bug.

CC: @jdemeyer

Component: porting: AIX or HP-UX

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

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 14 years ago
comment:1

The extension .so doesn't seem to be the problem, since apparently the loader recognizes it as a shared library.

The extension .a for shared libraries is of course a bit odd since PARI also builds a static version which typically has the same name ending with .a...

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago
comment:2

Replying to @nexttime:

The extension .so doesn't seem to be the problem, since apparently the loader recognizes it as a shared library.

The extension .a for shared libraries is of course a bit odd since PARI also builds a static version which typically has the same name ending with .a...

I wonder what the logic is for having both shared and static? I'd rather use the right extension on the right platform. I can discuss this with the Pari developers after getting clarification from some AIX experts on comp.unix.aix - they are a very helpful bunch.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 14 years ago
comment:3

Replying to @sagetrac-drkirkby:

I wonder what the logic is for having both shared and static?

For an executable that doesn't make that much sense, but gp-sta[tic] is tested against gp-dyn[amic], which isn't bad.

And since PARI is (also) a library, it's pretty normal to build both. (Every proper library does this, at least if you --enable-shared and --enable-static, depending on what the defaults are.)

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago
comment:4

I've reported this upstream:

Bug#1102: Acknowledgement (Build failure on AIX 5.3 - shared object has no .loader section)

The bug reported included a log against the latest snapshot, which shows the same problem.

Dave

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago

Upstream: Reported upstream. Little or no feedback.

jdemeyer commented 14 years ago

Description changed:

--- 
+++ 
@@ -1,6 +1,8 @@
 The Pari svn snapshot 12577 is failing to build properly on AIX. **If the Pari developers would like access to AIX hardware (I don't think they have it), then I can provide access to my personal RS/6000**

- == Hardware and software ==
+Reported upstream: [http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1102](http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1102)
+
+## Hardware and software
 * IBM [RS/6000 7025 F50](http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.pseries.doc/hardware_docs/rs6000_7025f50series.htm)
 * 4 x 332 MHz 32-bit PowerPC CPUs
 * 3 GB RAM
bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago
comment:7

I got this from Bill Allombert, a Pari developer:

Could you try to deactivate shared libraries by using
./Configure --static

That solves the problem - Pari then installs ok. I will create a patch.

Dave

jdemeyer commented 14 years ago
comment:8

Replying to @sagetrac-drkirkby:

I got this from Bill Allombert, a Pari developer:

Could you try to deactivate shared libraries by using
./Configure --static

That solves the problem - Pari then installs ok.

Did you only try to compile PARI/GP stand-alone, or also within Sage? Because I don't know whether it is possible to compile Sage statically.

jdemeyer commented 14 years ago
comment:9

Replying to @sagetrac-drkirkby:

I will create a patch.

If you do create a new pari spkg, please base it on the one at #9959: http://sage.math.washington.edu/home/jdemeyer/spkg/pari-2.4.3.svn-12577.p9.spkg

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago
comment:10

Replying to @jdemeyer:

Replying to @sagetrac-drkirkby:

I got this from Bill Allombert, a Pari developer:

Could you try to deactivate shared libraries by using
./Configure --static

That solves the problem - Pari then installs ok.

Did you only try to compile PARI/GP stand-alone, or also within Sage? Because I don't know whether it is possible to compile Sage statically.

Only outside of Sage at this point. Some of the ATLAS libraries are only stati, but Sage links to them ok. Since Sage will not build fully on AIX, it's hard to know for sure what problems might present themselves at a later date, but I doubt a static Pari library would be one of them.

I later found out that it appears that on AIX the .a files are archives which can contain both static and shared objects. But using .so as an extension for shared objects is not a problem in itself.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago

Description changed:

--- 
+++ 
@@ -13,7 +13,7 @@
 * sage-4.6.alpha1 with Pari  svn snapshot 12577, with some fixes applied in Sage. 

  == The Problem ==
-A full build log is attached, but the main problem seems to be that Pari is using the conventional `.so` for the extension of shared libraries, whereas on AIX, IBM use `.a` for shared libraries. 
+A full build log is attached, but here is the end which show the failure.

gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -O3 -g -I. -I../src/headers -fPIC -o thue.o ../src/modules/thue.c @@ -40,6 +40,6 @@ make[2]: *** [gp] Error 2 make[2]: Leaving directory `/home/users/drkirkby/sage-4.6.alpha1/spkg/build/pari-2.4.3.svn-12577.p5/src' Error building GP


+
bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 14 years ago
comment:12

Replying to @jdemeyer:

Replying to @sagetrac-drkirkby:

I will create a patch.

If you do create a new pari spkg, please base it on the one at #9959: http://sage.math.washington.edu/home/jdemeyer/spkg/pari-2.4.3.svn-12577.p9.spkg

No problem. This should be a very low-risk patch, as it will be specific to AIX. But I have some other more important things to do now, so it will have to wait.

Dave

roed314 commented 12 years ago

Changed upstream from Reported upstream. Little or no feedback. to Reported upstream. No feedback yet.

jdemeyer commented 12 years ago
comment:14

"No feedback yet." is totally not correct here. Most applicable would be "Developers sort-of acknowledge the bug but don't really care enough to fix it"

jdemeyer commented 12 years ago

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

kiwifb commented 12 years ago
comment:15

I believe "-Wl,-r" is incorrect, "-Wl,-brtl" may have to be added for the linking to happen, as in the linking of binary.

kiwifb commented 12 years ago
comment:16

And with a little bit of fiddling in Oaix-ppc/Makefile

frb15@p1n14-c /hpc/scratch/frb15/work/pari-2.5.1 :nano -w Oaix-ppc/Makefile 
frb15@p1n14-c /hpc/scratch/frb15/work/pari-2.5.1 :gmake gp
Making gp in Oaix-ppc
gmake[1]: Entering directory `/hpc/scratch/frb15/work/pari-2.5.1/Oaix-ppc'
rm -f libpari-gmp.so.2.5.1
gcc  -o "/hpc/scratch/frb15/work/pari-2.5.1/Oaix-ppc"/libpari-gmp.so.2.5.1 -shared  -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -fPIC -Wl,-brtl mp.o mpinl.o F2x.o FF.o Flx.o FpE.o FpV.o FpX.o Hensel.o QX_factor.o Qfb.o RgV.o RgX.o ZV.o ZX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o base3.o base4.o base5.o bb_group.o bibli1.o bibli2.o bit.o buch1.o buch2.o buch3.o buch4.o concat.o ellanal.o elliptic.o galconj.o gen1.o gen2.o gen3.o hnf_snf.o ifactor1.o lll.o nffactor.o perm.o polarit1.o polarit2.o polarit3.o prime.o random.o rootpol.o subcyclo.o subgroup.o trans1.o trans2.o trans3.o anal.o compat.o compile.o default.o errmsg.o es.o eval.o hash.o init.o intnum.o members.o paricfg.o pariinl.o parse.o sumiter.o DedekZeta.o aprcl.o elldata.o ellsea.o galois.o galpol.o groupid.o krasner.o kummer.o mpqs.o part.o stark.o subfield.o thue.o  -L/usr/local/lib -lgmp -lm 
if test "libpari-gmp.so.2.5.1" != "libpari.so"; then      rm -f libpari.so;       ln -s libpari-gmp.so.2.5.1 libpari.so; fi
if test "libpari-gmp.so.2.5.1" != "libpari-gmp.so.3"; then        rm -f libpari-gmp.so.3;         ln -s libpari-gmp.so.2.5.1 libpari-gmp.so.3; fi
rm -f gp-dyn
gcc  -o gp-dyn -L"/hpc/scratch/frb15/work/pari-2.5.1/Oaix-ppc" -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -Wl,-brtl  gp.o gp_init.o gp_rl.o highlvl.o whatnow.o plotX.o plotport.o -Wl,-blibpath:"/hpc/scratch/frb15/work/pari-2.5.1"/Oaix-ppc:"/usr/local/lib":/usr/lib:/usr/local/lib:/usr/local/pkg/readline/6.2_p1/lib32 -L/usr/local/pkg/readline/6.2_p1/lib32 -lreadline -L/usr/lib/ -lncurses -lpari -L/usr/lib -lX11   -lm 
ld: 0711-224 WARNING: Duplicate symbol: .bcopy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
rm -f ../gp
ln -s Oaix-ppc/gp-dyn ../gp
gmake[1]: Leaving directory `/hpc/scratch/frb15/work/pari-2.5.1/Oaix-ppc'

The warning is about the fact that bcopy is in both libreadline and libc. Probably because I have both libreadline.a and .so at the moment and .a would have chosen over .so. That's minor compared to some other stuff like the fact that it segfault:

/hpc/scratch/frb15/work/pari-2.5.1 :./gp
  ***   bug in PARI/GP (Segmentation Fault), please report
### Errors on startup, exiting...

For info that's on a power7 machine running aix-6.1(TL6) with gcc-4.6.3 [compiled on another LPAR on the same machine running TL7].

jdemeyer commented 6 years ago
comment:21

Closing as obsolete.