Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
350 stars 235 forks source link

libtool #1393

Open DanGrayson opened 4 years ago

DanGrayson commented 4 years ago

Under Ubuntu 20.04, with the system-provided libtool, version 2.4.6, we get this link error when running "make check" for the 4ti2 library:

libtool: link: g++ -I../../../src/ -std=gnu++14 -g3 -O2 -w -Wall -std=c++0x -g3 -o .libs/test_input_conversion_gmp_to_64 test_input_conversion_gmp.o  -L/home/dan/src/M2/M2.git/M2/BUILD/dan/builds.tmp/ubuntu2004-release-1.16/usr-host/lib -L/home/dan/src/M2/M2.git/M2/BUILD/dan/builds.tmp/ubuntu2004-release-1.16/submodules/memtailor/.libs -L/home/dan/src/M2/M2.git/M2/BUILD/dan/builds.tmp/ubuntu2004-release-1.16/submodules/mathic/.libs -L/home/dan/src/M2/M2.git/M2/BUILD/dan/builds.tmp/ubuntu2004-release-1.16/submodules/mathicgb/.libs -L/usr/lib -L/usr/local/lib ../../../src/groebner/.libs/lib4ti2int64.so ../../../src/4ti2/.libs/lib4ti2common.so -Wl,-rpath -Wl,/home/dan/src/M2/M2.git/M2/BUILD/dan/builds.tmp/ubuntu2004-release-1.16/usr-host/lib
/usr/bin/ld: test_input_conversion_gmp.o: undefined reference to symbol '_ZrsRSiP12__mpz_struct'
/usr/bin/ld: /lib/x86_64-linux-gnu/libgmpxx.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[8]: *** [Makefile:792: test_input_conversion_gmp_to_64] Error 1
make[8]: Leaving directory '/home/dan/src/M2/M2.git/M2/BUILD/dan/builds.tmp/ubuntu2004-release-1.16/libraries/4ti2/build/4ti2-1.6.9/test/qsolve/api'

But with the libtool we download and build ourselves, which is also version 2.4.6, we don't get that error. ("make get-libtool")

I hate libtool.

tom111 commented 4 years ago

I just got this on the mac with the libtool from get-tools:

libtool: link: g++-10 -dynamiclib -o .libs/lib4ti2int32.0.dylib .libs/lib4ti2int32_la-4ti2API.o .libs/lib4ti2int32_la-Algorithm.o .libs/lib4ti2int32_la-BasicCompletion.o .libs/lib4ti2int32_la-BasicGeneration.o .libs/lib4ti2int32_la-BasicOptions.o .libs/lib4ti2int32_la-BasicReduction.o .libs/lib4ti2int32_la-BinomialArray.o .libs/lib4ti2int32_la-BinomialArrayStream.o .libs/lib4ti2int32_la-BinomialCollection.o .libs/lib4ti2int32_la-Binomial.o .libs/lib4ti2int32_la-BinomialFactory.o .libs/lib4ti2int32_la-BinomialSet.o .libs/lib4ti2int32_la-BinomialSetStream.o .libs/lib4ti2int32_la-BinomialStream.o .libs/lib4ti2int32_la-BitSetStream.o .libs/lib4ti2int32_la-Bounded.o .libs/lib4ti2int32_la-CircuitsAPI.o .libs/lib4ti2int32_la-CircuitOptions.o .libs/lib4ti2int32_la-Completion.o .libs/lib4ti2int32_la-DiagonalAlgorithm.o .libs/lib4ti2int32_la-EliminateAlgorithm.o .libs/lib4ti2int32_la-Euclidean.o .libs/lib4ti2int32_la-Extract.o .libs/lib4ti2int32_la-Feasible.o .libs/lib4ti2int32_la-FeasibleStream.o .libs/lib4ti2int32_la-FilterReduction.o .libs/lib4ti2int32_la-FlipCompletion.o .libs/lib4ti2int32_la-GeneratingSet.o .libs/lib4ti2int32_la-Globals.o .libs/lib4ti2int32_la-GroebnerBasis.o .libs/lib4ti2int32_la-HermiteAlgorithm.o .libs/lib4ti2int32_la-HybridGenSet.o .libs/lib4ti2int32_la-LatticeBasis.o .libs/lib4ti2int32_la-LongDenseIndexSet.o .libs/lib4ti2int32_la-LongDenseIndexSetStream.o .libs/lib4ti2int32_la-Markov.o .libs/lib4ti2int32_la-MaxMinGenSet.o .libs/lib4ti2int32_la-Minimize.o .libs/lib4ti2int32_la-MinimizeOptions.o .libs/lib4ti2int32_la-OnesReduction.o .libs/lib4ti2int32_la-Optimise.o .libs/lib4ti2int32_la-Options.o .libs/lib4ti2int32_la-OrderedCompletion.o .libs/lib4ti2int32_la-ProjectLiftGenSet.o .libs/lib4ti2int32_la-QSolveAlgorithm.o .libs/lib4ti2int32_la-QSolveAPI.o .libs/lib4ti2int32_la-RayAlgorithm.o .libs/lib4ti2int32_la-RaysAPI.o .libs/lib4ti2int32_la-SaturationGenSet.o .libs/lib4ti2int32_la-ShortDenseIndexSet.o .libs/lib4ti2int32_la-ShortDenseIndexSetStream.o .libs/lib4ti2int32_la-Statistics.o .libs/lib4ti2int32_la-SyzygyCompletion.o .libs/lib4ti2int32_la-SyzygyGeneration.o .libs/lib4ti2int32_la-Timer.o .libs/lib4ti2int32_la-Truncated.o .libs/lib4ti2int32_la-VectorArray.o .libs/lib4ti2int32_la-VectorArrayAPI.o .libs/lib4ti2int32_la-VectorArrayStream.o .libs/lib4ti2int32_la-Vector.o .libs/lib4ti2int32_la-VectorStream.o .libs/lib4ti2int32_la-WalkAlgorithm.o .libs/lib4ti2int32_la-WalkOptions.o .libs/lib4ti2int32_la-WeightAlgorithm.o .libs/lib4ti2int32_la-WeightedBinomialSet.o .libs/lib4ti2int32_la-WeightedReduction.o -L../4ti2 /Users/tom/temp/M2/M2/BUILD/tom/libraries/4ti2/build/4ti2-1.6.9/src/4ti2/.libs/lib4ti2common.dylib -L/Users/tom/temp/M2/M2/BUILD/tom/usr-host/lib -L/Users/tom/temp/M2/M2/BUILD/tom/submodules/memtailor/.libs -L/Users/tom/temp/M2/M2/BUILD/tom/submodules/mathic/.libs -L/Users/tom/temp/M2/M2/BUILD/tom/submodules/mathicgb/.libs -L/usr/lib -L/usr/local/lib -lglpk -lgmpxx -lgmp -g3 -O2 -g3 -install_name /Users/tom/temp/M2/M2/BUILD/tom/usr-host/lib/lib4ti2int32.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module ld: warning: directory not found for option '-L/Users/tom/temp/M2/M2/BUILD/tom/submodules/memtailor/.libs' ld: warning: directory not found for option '-L/Users/tom/temp/M2/M2/BUILD/tom/submodules/mathic/.libs' ld: warning: directory not found for option '-L/Users/tom/temp/M2/M2/BUILD/tom/submodules/mathicgb/.libs' Undefined symbols for architecture x86_64: "ZlsRSoPK12mpz_struct", referenced from: __ZN6_4ti2_14VectorArrayAPI19set_entry_mpz_classEiiRK10gmp_exprIA1_12mpz_structS3_E in lib4ti2int32_la-VectorArrayAPI.o ld: symbol(s) not found for architecture x86_64

DanGrayson commented 4 years ago

Could you attach the top level config.log file as well as the 4ti2 config.log file?

mahrud commented 4 years ago

This looks like an issue with gmp (or mpir) being built with a different compiler than 4ti2. Have you tried AppleClang or Clang? In particular, g++-10 (i.e. not the one that is a shim over Xcode) has been having issues on macOS and we removed it from the Github Actions builds.

tom111 commented 4 years ago

I can't reproduce this anymore, sorry. It might have indeed been a mismatch between compilers as I'm experimenting with all the different options now. I will open new issues for my, well, new issues.