El jueves, 5 de septiembre de 2019, 6:07:13 (UTC+2), Victor Shoup escribió:
 

> So, based on that comment, it seems that there is no problem if you link 
> with g++
> rather than libtool.  But who or what uses libtool to link?
> I would never have thought of doing that, as I thought libtool was a tool
> for creating libraries, not linking programs
>

But you do! This is from your mfile:

ntl.a: $(OBJ)
[...]
@{LSHAR} $(LIBTOOL) --tag=CXX --mode=link $(LINK) $(LIBTOOL_LINK_FLAGS) -o 
libntl.la $(OBJ:.o=.lo) $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) 
$(GF2X_OPT_LIB) $(LDLIBS) -rpath $(LIBDIR) -version-info `cat VERSION_INFO` 
#LSHAR

If you check the compilation output, this is the line where this is called:

libtool --tag=CXX --mode=link g++ -I../include -I.  -march=x86-64 
-mtune=generic -O2 -pipe -fno-plt -pthread 
-Wl,-O1,--sort-common,--as-needed,-z,relro,-z
,now  -o libntl.la FFT.lo FacVec.lo GF2.lo GF2E.lo GF2EX.lo 
GF2EXFactoring.lo GF2X.lo GF2X1.lo GF2XFactoring.lo GF2XVec.lo GetTime.lo 
GetPID.lo HNF.lo cto
ols.lo LLL.lo LLL_FP.lo LLL_QP.lo LLL_RR.lo LLL_XD.lo RR.lo WordVector.lo 
ZZ.lo ZZVec.lo ZZX.lo ZZX1.lo ZZXCharPoly.lo ZZXFactoring.lo ZZ_p.lo 
ZZ_pE.lo ZZ
_pEX.lo ZZ_pEXFactoring.lo ZZ_pX.lo ZZ_pX1.lo ZZ_pXCharPoly.lo 
ZZ_pXFactoring.lo fileio.lo lip.lo lzz_p.lo lzz_pE.lo lzz_pEX.lo 
lzz_pEXFactoring.lo lzz_pX
.lo lzz_pX1.lo lzz_pXCharPoly.lo lzz_pXFactoring.lo mat_GF2.lo mat_GF2E.lo 
mat_RR.lo mat_ZZ.lo mat_ZZ_p.lo mat_ZZ_pE.lo mat_lzz_p.lo mat_lzz_pE.lo 
mat_pol
y_ZZ.lo mat_poly_ZZ_p.lo mat_poly_lzz_p.lo quad_float.lo quad_float1.lo 
tools.lo vec_GF2.lo vec_GF2E.lo vec_RR.lo vec_ZZ.lo vec_ZZ_p.lo 
vec_ZZ_pE.lo vec_l
zz_p.lo vec_lzz_pE.lo xdouble.lo G_LLL_FP.lo G_LLL_QP.lo G_LLL_XD.lo 
G_LLL_RR.lo thread.lo BasicThreadPool.lo MatPrime.lo pd_FFT.lo -L/usr/lib 
 -lgmp  -L/
usr/lib  -lgf2x  -lpthread -rpath /usr/lib -version-info `cat VERSION_INFO` 
#LSHAR

And, right below it, you have the g++ command that libtool actually runs:

libtool: link: g++  -fPIC -DPIC -shared -nostdlib 
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../lib/crti.o 
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/crt
beginS.o  .libs/FFT.o .libs/FacVec.o .libs/GF2.o .libs/GF2E.o .libs/GF2EX.o 
.libs/GF2EXFactoring.o .libs/GF2X.o .libs/GF2X1.o .libs/GF2XFactoring.o 
.libs/
GF2XVec.o .libs/GetTime.o .libs/GetPID.o .libs/HNF.o .libs/ctools.o 
.libs/LLL.o .libs/LLL_FP.o .libs/LLL_QP.o .libs/LLL_RR.o .libs/LLL_XD.o 
.libs/RR.o .li
bs/WordVector.o .libs/ZZ.o .libs/ZZVec.o .libs/ZZX.o .libs/ZZX1.o 
.libs/ZZXCharPoly.o .libs/ZZXFactoring.o .libs/ZZ_p.o .libs/ZZ_pE.o 
.libs/ZZ_pEX.o .libs
/ZZ_pEXFactoring.o .libs/ZZ_pX.o .libs/ZZ_pX1.o .libs/ZZ_pXCharPoly.o 
.libs/ZZ_pXFactoring.o .libs/fileio.o .libs/lip.o .libs/lzz_p.o 
.libs/lzz_pE.o .libs
/lzz_pEX.o .libs/lzz_pEXFactoring.o .libs/lzz_pX.o .libs/lzz_pX1.o 
.libs/lzz_pXCharPoly.o .libs/lzz_pXFactoring.o .libs/mat_GF2.o 
.libs/mat_GF2E.o .libs/m
at_RR.o .libs/mat_ZZ.o .libs/mat_ZZ_p.o .libs/mat_ZZ_pE.o .libs/mat_lzz_p.o 
.libs/mat_lzz_pE.o .libs/mat_poly_ZZ.o .libs/mat_poly_ZZ_p.o 
.libs/mat_poly_lz
z_p.o .libs/quad_float.o .libs/quad_float1.o .libs/tools.o .libs/vec_GF2.o 
.libs/vec_GF2E.o .libs/vec_RR.o .libs/vec_ZZ.o .libs/vec_ZZ_p.o 
.libs/vec_ZZ_pE
.o .libs/vec_lzz_p.o .libs/vec_lzz_pE.o .libs/xdouble.o .libs/G_LLL_FP.o 
.libs/G_LLL_QP.o .libs/G_LLL_XD.o .libs/G_LLL_RR.o .libs/thread.o 
.libs/BasicThre
adPool.o .libs/MatPrime.o .libs/pd_FFT.o   -L/usr/lib -lgmp -lgf2x 
-lpthread -L/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0 
-L/usr/lib/gcc/x86_64-pc-linux-gnu/9
.1.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib 
-L/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../.. -lstdc++ -lm -lc -lgcc_s 
/usr/lib/gcc/x86_64-pc-lin
ux-gnu/9.1.0/crtendS.o 
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../lib/crtn.o 
 -march=x86-64 -mtune=generic -O2 -pthread -Wl,-O1 -Wl,--sort-common 
-Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now   -pthread -Wl,-soname 
-Wl,libntl.so.40 -o .libs/libntl.so.40.0.0

As you can see, libtool has added the -nostdlib flag to g++, which in turn 
invalidates all subsequent -pthread flags. Change that line in mfile to 
call $(LINK) directly and everything will work fine.
 

>  Again, when I build and install a shared NTL on a linux system, 
> everything works fine.

So I'm not even sure what the problem is:
>

What do you mean by "everything works fine"? Is libntl.so linked to 
libpthread? Because if not, it's not fine, it's underlinked, which is what 
is causing these issues that are being reported. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ab8ae8e0-cbc5-4365-a292-925d7d62e856%40googlegroups.com.

Reply via email to