[GiNaC-devel] Linking errors when building GiNaC
Atri Bhattacharya
badshah400 at opensuse.org
Fri Aug 21 14:23:10 CEST 2020
When building GiNaC on openSUSE Tumbleweed (GCC 10.1, cln-devel 1.3.6)
builds fail at the linking stage due to undefined references:
----------------------------------------------
[ 24s] [ 85%] Linking CXX shared library libginac.so
[ 24s] cd /home/abuild/rpmbuild/BUILD/ginac-1.7.11/build/ginac && /usr/bin/cmake -E cmake_link_script CMakeFiles/ginac.dir/link.txt --verbose=1
[ 24s] /usr/bin/c++ -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -O2 -g -DNDEBUG -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,libginac.so.6 -o libginac.so.6.4.5 CMakeFiles/ginac.dir/add.cpp.o CMakeFiles/ginac.dir/archive.cpp.o CMakeFiles/ginac.dir/basic.cpp.o CMakeFiles/ginac.dir/clifford.cpp.o CMakeFiles/ginac.dir/color.cpp.o CMakeFiles/ginac.dir/constant.cpp.o CMakeFiles/ginac.dir/excompiler.cpp.o CMakeFiles/ginac.dir/ex.cpp.o CMakeFiles/ginac.dir/expair.cpp.o CMakeFiles/ginac.dir/expairseq.cpp.o CMakeFiles/ginac.dir/exprseq.cpp.o CMakeFiles/ginac.dir/factor.cpp.o CMakeFiles/ginac.dir/fail.cpp.o CMakeFiles/ginac.dir/fderivative.cpp.o CMakeFiles/ginac.dir/function.cpp.o CMakeFiles/ginac.dir/idx.cpp.o CMakeFiles/ginac.dir/indexed.cpp.o CMakeFiles/ginac.dir/inifcns.cpp.o CMakeFiles/ginac.dir/inifcns_gamma.cpp.o CMakeFiles/ginac.dir/inifcns_nstdsums.cpp.o CMakeFiles/ginac.dir/inifcns_trans.cpp.o CMakeFiles/ginac.dir/integral.cpp.o CMakeFiles/ginac.dir/lst.cpp.o CMakeFiles/ginac.dir/matrix.cpp.o CMakeFiles/ginac.dir/mul.cpp.o CMakeFiles/ginac.dir/ncmul.cpp.o CMakeFiles/ginac.dir/normal.cpp.o CMakeFiles/ginac.dir/numeric.cpp.o CMakeFiles/ginac.dir/operators.cpp.o CMakeFiles/ginac.dir/parser/default_reader.cpp.o CMakeFiles/ginac.dir/parser/lexer.cpp.o CMakeFiles/ginac.dir/parser/parse_binop_rhs.cpp.o CMakeFiles/ginac.dir/parser/parse_context.cpp.o CMakeFiles/ginac.dir/parser/parser_compat.cpp.o CMakeFiles/ginac.dir/parser/parser.cpp.o CMakeFiles/ginac.dir/polynomial/chinrem_gcd.cpp.o CMakeFiles/ginac.dir/polynomial/collect_vargs.cpp.o CMakeFiles/ginac.dir/polynomial/cra_garner.cpp.o CMakeFiles/ginac.dir/polynomial/divide_in_z_p.cpp.o CMakeFiles/ginac.dir/polynomial/gcd_uvar.cpp.o CMakeFiles/ginac.dir/polynomial/mgcd.cpp.o CMakeFiles/ginac.dir/polynomial/mod_gcd.cpp.o CMakeFiles/ginac.dir/polynomial/normalize.cpp.o CMakeFiles/ginac.dir/polynomial/optimal_vars_finder.cpp.o CMakeFiles/ginac.dir/polynomial/pgcd.cpp.o CMakeFiles/ginac.dir/polynomial/primpart_content.cpp.o CMakeFiles/ginac.dir/polynomial/remainder.cpp.o CMakeFiles/ginac.dir/polynomial/upoly_io.cpp.o CMakeFiles/ginac.dir/power.cpp.o CMakeFiles/ginac.dir/print.cpp.o CMakeFiles/ginac.dir/pseries.cpp.o CMakeFiles/ginac.dir/registrar.cpp.o CMakeFiles/ginac.dir/relational.cpp.o CMakeFiles/ginac.dir/remember.cpp.o CMakeFiles/ginac.dir/symbol.cpp.o CMakeFiles/ginac.dir/symmetry.cpp.o CMakeFiles/ginac.dir/tensor.cpp.o CMakeFiles/ginac.dir/utils.cpp.o CMakeFiles/ginac.dir/wildcard.cpp.o -lcln
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::excompiler::~excompiler()':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:107: undefined reference to `dlclose'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::link_ex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double (*&)(double))':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:167: undefined reference to `dlopen'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:174: undefined reference to `dlsym'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::link_ex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double (*&)(double, double))':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:167: undefined reference to `dlopen'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:174: undefined reference to `dlsym'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::link_ex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void (*&)(int const*, double const*, int const*, double*))':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:167: undefined reference to `dlopen'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:174: undefined reference to `dlsym'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::unlink_ex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:107: undefined reference to `dlclose'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::compile_ex(GiNaC::ex const&, GiNaC::symbol const&, double (*&)(double), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:167: undefined reference to `dlopen'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:174: undefined reference to `dlsym'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::compile_ex(GiNaC::ex const&, GiNaC::symbol const&, GiNaC::symbol const&, double (*&)(double, double), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:167: undefined reference to `dlopen'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:174: undefined reference to `dlsym'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o: in function `GiNaC::compile_ex(GiNaC::container<std::__cxx11::list> const&, GiNaC::container<std::__cxx11::list> const&, void (*&)(int const*, double const*, int const*, double*), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:167: undefined reference to `dlopen'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans4.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/excompiler.cpp:174: undefined reference to `dlsym'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans27.ltrans.o: in function `GiNaC::print_real_number(GiNaC::print_context const&, cln::cl_R const&)':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/numeric.cpp:415: undefined reference to `cln::denominator(cln::cl_RA const&)'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans27.ltrans.o: in function `GiNaC::print_real_csrc(GiNaC::print_context const&, cln::cl_R const&)':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/numeric.cpp:455: undefined reference to `cln::denominator(cln::cl_RA const&)'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans27.ltrans.o: in function `GiNaC::numeric::numer() const':
[ 24s] /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/numeric.cpp:1374: undefined reference to `cln::denominator(cln::cl_RA const&)'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/numeric.cpp:1378: undefined reference to `cln::denominator(cln::cl_RA const&)'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/numeric.cpp:1378: undefined reference to `cln::denominator(cln::cl_RA const&)'
[ 24s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /tmp/libginac.so.6.4.5.93oJvY.ltrans27.ltrans.o:/home/abuild/rpmbuild/BUILD/ginac-1.7.11/ginac/numeric.cpp:1380: more undefined references to `cln::denominator(cln::cl_RA const&)' follow
[ 24s] collect2: error: ld returned 1 exit status
[ 24s] make[2]: *** [ginac/CMakeFiles/ginac.dir/build.make:988: ginac/libginac.so.6.4.5] Error 1
[ 24s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/ginac-1.7.11/build'
[ 24s] make[1]: *** [CMakeFiles/Makefile2:497: ginac/CMakeFiles/ginac.dir/all] Error 2
[ 24s] make: *** [Makefile:163: all] Error 2
----------------------------------------------
The full cmake command we invoke in the spec file is as follows:
----------------------------------------------------------------
[ 15s] + /usr/bin/cmake /home/abuild/rpmbuild/BUILD/ginac-1.7.11/. '-GUnix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_CXX_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/lib64/cmake/ginac -DCMAKE_SKIP_RPATH:BOOL=ON
----------------------------------------------------------------
The same command gets it building for older openSUSE versions (e.g. on
openSUSE 15.2, using GCC 9.1), so I wonder what's going wrong.
Any help fixing this will be appreciated. Here are the full spec file
and sources:
<https://build.opensuse.org/package/show/home:badshah400:branches:science/ginac>
--
Atri Bhattacharya
More information about the GiNaC-devel
mailing list