Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `Codegen::FortranBase::codegen_type #36

Open
Alessandro-Barbieri opened this issue Aug 19, 2021 · 2 comments
Open

Comments

@Alessandro-Barbieri
Copy link

Alessandro-Barbieri commented Aug 19, 2021

configured with ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --disable-dependency-tracking --disable-silent-rules --disable-static --docdir=/usr/share/doc/mcxx-2021.06 --htmldir=/usr/share/doc/mcxx-2021.06/html --with-sysroot=/ --libdir=/usr/lib64 --disable-cray-compilers --disable-distcheck-processing --disable-ibm-compilers --disable-intel-compilers --disable-pgi-compilers --disable-mic --disable-mic-testing --disable-nanox-cuda-device --disable-nanox-fpga-device --enable-bison-regeneration --enable-file-regeneration --enable-flex-regeneration --enable-gperf-regeneration --enable-shared --without-intel-omp --without-nanox-mic --without-svml --enable-analysis --disable-gfortran-8-or-greater-array-descriptors --disable-bison-reporting --disable-tl-examples --disable-extrae --enable-nanox-mpi-device --disable-ompss --disable-ompss-2 --enable-nanox-opencl-device --enable-openmp --enable-float128 --enable-int128 --disable-fortran-tests --disable-tl-openmp-gomp --disable-tl-openmp-profile --disable-vectorization --with-mpi=/usr --with-nanox=/usr --without-nanos6 --with-tcl=/usr

/bin/sh ./libtool  --tag=CXX   --mode=link x86_64-pc-linux-gnu-g++ -DLIBMCXXTL_DLL_EXPORT -I ./support/gperf -I ./support/gperf -I ./src/frontend -I ./src/frontend/fortran -I ./src/driver -I ./src/tl -I ./src/tl/codegen/common -I ./lib 
-I ./src/frontend -I ./src/frontend/fortran -I ./src/driver -I ./src/tl -I ./lib -Os -pipe -march=native -avoid-version  -Wl,-rpath,/usr/lib64/mcxx -Wl,-rpath,\$ORIGIN -Wl,-rpath,\$ORIGIN/mcxx -Wl,-z,origin --enable-new-dtags  -Wl,-O1 -
Wl,--as-needed -o src/mcxx_tl/libmcxxtl.la -rpath /usr/lib64 src/mcxx_tl/libmcxxtl_la-cxx-compilerphases.lo ./src/frontend/libmcxx-process.la ./src/frontend/libmcxx.la ./src/tl/libtl.la ./src/tl/codegen/common/libcodegen-common.la ./lib
/libmcxx-utils.la -ldl                                                                                                
libtool: link: x86_64-pc-linux-gnu-g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/crtbeginS.o  src/mcxx_tl/.libs/libmcxxtl_la-cxx-compilerphase
s.o   -Wl,-rpath -Wl,/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/.libs -Wl,-rpath -Wl,/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/tl/.libs -Wl,-rpath -Wl,//u
sr/lib/gcc/x86_64-pc-linux-gnu/11.2.0 -Wl,-rpath -Wl,/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/fortran/.libs -Wl,-rpath -Wl,/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release
-2021.06/lib/.libs -Wl,-rpath -Wl,/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/tl/codegen/common/.libs -L/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/.libs -L/
var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/fortran/.libs -L/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/lib/.libs -Wl,--as-needed ./src/frontend/.libs/libmcxx-pro
cess.so ./src/frontend/.libs/libmcxx.so -L/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0 ./src/tl/.libs/libtl.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/.libs/libmcxx.so //usr/lib/gcc/x86_64-pc-l
inux-gnu/11.2.0/libquadmath.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/fortran/.libs/libmf03.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/.lib
s/libmcxx-process.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/lib/.libs/libmcxx-utils.so -lsqlite3 ./src/tl/codegen/common/.libs/libcodegen-common.so ./lib/.libs/libmcxx-utils.so -ldl -L/usr/lib/gcc/x86
_64-pc-linux-gnu/11.2.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../.. -lstdc++ -lm -lc -lgcc_s /usr
/lib/gcc/x86_64-pc-linux-gnu/11.2.0/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib64/crtn.o  -Os -march=native -Wl,-rpath -Wl,/usr/lib64/mcxx -Wl,-rpath -Wl,\$ORIGIN -Wl,-rpath -Wl,\$ORIGIN/mcxx -Wl,-z -Wl,origin -Wl,
-O1   -Wl,-soname -Wl,libmcxxtl.so -o src/mcxx_tl/.libs/libmcxxtl.so                         
libtool: link: ( cd "src/mcxx_tl/.libs" && rm -f "libmcxxtl.la" && ln -s "../libmcxxtl.la" "libmcxxtl.la" )
/bin/sh ./libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.    -std=gnu99 -fexceptions -I./support/gperf -I./support/gperf -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./src/driver -I.
/src/driver/fortran -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./src/driver -I./src/driver/fortran -DPKGDATADIR=\"/usr/share/mcxx\" -Wall -Os -pipe -march=native -Werror=implicit-function-declaration -c -o src/d
river/fortran/libmf03_driver_la-cxx-driver-fortran.lo `test -f 'src/driver/fortran/cxx-driver-fortran.c' || echo './'`src/driver/fortran/cxx-driver-fortran.c
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -std=gnu99 -fexceptions -I./support/gperf -I./support/gperf -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./src/driver -I./src/driver/fortran -I./lib -
I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./src/driver -I./src/driver/fortran -DPKGDATADIR=\"/usr/share/mcxx\" -Wall -Os -pipe -march=native -Werror=implicit-function-declaration -c src/driver/fortran/cxx-driver-fortran
.c  -fPIC -DPIC -o src/driver/fortran/.libs/libmf03_driver_la-cxx-driver-fortran.o
/bin/sh ./libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -std=gnu99 -fexceptions -I./support/gperf -I./support/gperf -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./src/driver -I./src/driver/fortran -I./li
b -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./src/driver -I./src/driver/fortran -DPKGDATADIR=\"/usr/share/mcxx\" -Wall -Os -pipe -march=native -Werror=implicit-function-declaration  -Wl,-O1 -Wl,--as-needed -o src/drive
r/fortran/libmf03-driver.la  src/driver/fortran/libmf03_driver_la-cxx-driver-fortran.lo   
libtool: link: x86_64-pc-linux-gnu-ar cru src/driver/fortran/.libs/libmf03-driver.a src/driver/fortran/.libs/libmf03_driver_la-cxx-driver-fortran.o 
libtool: link: x86_64-pc-linux-gnu-ranlib src/driver/fortran/.libs/libmf03-driver.a
libtool: link: ( cd "src/driver/fortran/.libs" && rm -f "libmf03-driver.la" && ln -s "../libmf03-driver.la" "libmf03-driver.la" )
/bin/sh ./libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -std=gnu99 -D_GNU_SOURCE -fexceptions -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl 
-DPKGDATADIR=\"/usr/share/mcxx\" -Wall -I./support/gperf -I./support/gperf -I./src/frontend/fortran -I./src/frontend/fortran -I./src/driver -I./src/driver/fortran -I./src/driver -I./src/driver/fortran -Os -pipe -march=native -Werror=imp
licit-function-declaration -Wl,--no-as-needed -Wl,-E -Wl,-rpath,\$ORIGIN/../lib -Wl,-rpath,\$ORIGIN/../lib/mcxx -Wl,-z,origin -Wl,--enable-new-dtags  -Wl,-O1 -Wl,--as-needed -o src/driver/plaincxx src/driver/plaincxx-cxx-configfile.o sr
c/driver/plaincxx-cxx-configoptions.o src/driver/plaincxx-cxx-parameters.o src/driver/plaincxx-cxx-fileextensions.o src/driver/plaincxx-cxx-debugflags.o src/driver/plaincxx-cxx-driver.o src/driver/plaincxx-cxx-driver-utils.o src/driver/
plaincxx-cxx-profile.o src/driver/plaincxx-cxx-configfile-parser.o src/driver/plaincxx-cxx-configfile-lexer.o src/driver/plaincxx-cxx-multifile.o src/driver/plaincxx-cxx-embed.o  ./gnulib/libgnulib.la ./lib/libmcxx-utils.la ./src/fronte
nd/libmcxx-process.la ./src/frontend/libmcxx.la ./src/tl/libtl.la ./src/tl/codegen/common/libcodegen-common.la ./src/tl/codegen/base/cxx/libcodegen-cxx.la ./src/tl/codegen/base/fortran/libcodegen-fortran.la ./src/mcxx_tl/libmcxxtl.la  .
/src/frontend/fortran/libmf03.la ./src/driver/fortran/libmf03-driver.la -lsqlite3  -lquadmath -lm 
libtool: link: x86_64-pc-linux-gnu-gcc -std=gnu99 -D_GNU_SOURCE -fexceptions -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -I./lib -I./src/frontend -I./src/frontend/fortran -I./src/mcxx_tl -DPKGDATADIR=\"/usr/share/m
cxx\" -Wall -I./support/gperf -I./support/gperf -I./src/frontend/fortran -I./src/frontend/fortran -I./src/driver -I./src/driver/fortran -I./src/driver -I./src/driver/fortran -Os -pipe -march=native -Werror=implicit-function-declaration 
-Wl,-E -Wl,-rpath -Wl,\$ORIGIN/../lib -Wl,-rpath -Wl,\$ORIGIN/../lib/mcxx -Wl,-z -Wl,origin -Wl,--enable-new-dtags -Wl,-O1 -o src/driver/.libs/plaincxx src/driver/plaincxx-cxx-configfile.o src/driver/plaincxx-cxx-configoptions.o src/dri
ver/plaincxx-cxx-parameters.o src/driver/plaincxx-cxx-fileextensions.o src/driver/plaincxx-cxx-debugflags.o src/driver/plaincxx-cxx-driver.o src/driver/plaincxx-cxx-driver-utils.o src/driver/plaincxx-cxx-profile.o src/driver/plaincxx-cx
x-configfile-parser.o src/driver/plaincxx-cxx-configfile-lexer.o src/driver/plaincxx-cxx-multifile.o src/driver/plaincxx-cxx-embed.o  -Wl,--no-as-needed -Wl,--as-needed ./gnulib/.libs/libgnulib.a ./lib/.libs/libmcxx-utils.so ./src/front
end/.libs/libmcxx-process.so ./src/frontend/.libs/libmcxx.so ./src/tl/.libs/libtl.so ./src/tl/codegen/common/.libs/libcodegen-common.so ./src/tl/codegen/base/cxx/.libs/libcodegen-cxx.so ./src/tl/codegen/base/fortran/.libs/libcodegen-for
tran.so ./src/mcxx_tl/.libs/libmcxxtl.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/tl/.libs/libtl.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/.libs/libm
cxx.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/fortran/.libs/libmf03.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/tl/codegen/common/.libs/libcodegen-co
mmon.so -ldl ./src/frontend/fortran/.libs/libmf03.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06/src/frontend/.libs/libmcxx-process.so /var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-202
1.06/lib/.libs/libmcxx-utils.so ./src/driver/fortran/.libs/libmf03-driver.a -lsqlite3 //usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/libquadmath.so -lm -Wl,-rpath -Wl,/usr/lib64/mcxx
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ./src/tl/.libs/libtl.so: undefined reference to `Codegen::FortranBase::codegen_type(TL::Type, std::__cxx11::basic_string<char, std::char_traits<char>, std::
allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:7714: src/driver/plaincxx] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06'
make[1]: *** [Makefile:11219: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-cluster/mcxx-2021.06/work/mcxx-github-release-2021.06'
make: *** [Makefile:5825: all] Error 2
@rofirrim
Copy link
Contributor

Hi Alessandro,

thanks for raising this. I cannot reproduce your issue.

Can you give me some more details here?

  • Are you using an archive or directly from git?
  • What versions of autotools you're using? (autoconf, automake, libtool)

Is there a docker container (or similar) that might help me have an environment closer to yours so I can try to replicate your issue?

Kind regards,

@Alessandro-Barbieri
Copy link
Author

I'm trying to make a package for gentoo but the gentoo buildsystem enforces -Wl,--as-needed
You should be able to reproduce by setting LDFLAGS="-Wl,--as-needed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants