Re: Precompiler error with GNU compiler
Posted: Thu Jun 23, 2022 3:21 pm
Hi Nicola.
Finally I got what was wrong, I needed to add the flags "-E -P" to the Fortran and C preprocessors:
export CPP="/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gcc -E -P"
export FPP="/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gfortran -E -P -cpp"
Now the precompiler works, and I get the correct object make files.
Nevertheless, I got in a new error, the libraries do not compile.
Is it possible that some of these libraries do not compile with GCC 9.3.0?
Help will be appreciated.
Thanks.
Luis.
-------------------------------------------------------------------------------------
$ ./configure --prefix=/opt/apps/yambo/5.1.0/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0+fftw3-3.3.10+hdf5-1.12.2+petsc-3.17.2 \
> --enable-mpi=yes --with-mpi-path=/opt/gridware/depots/54e7fb3c/el7/pkg/mpi/openmpi/4.0.4/gcc-9.3.0+ucx-1.8.0 \
> --with-blas-libs=/opt/gridware/depots/54e7fb3c/el7/pkg/libs/blas/3.8.0/gcc-9.3.0/libblas.a \
> --with-lapack-libs=/opt/gridware/depots/54e7fb3c/el7/pkg/libs/lapack/3.9.0/gcc-9.3.0/lib64/liblapack.a \
> --with-fft-path=/opt/gridware/depots/54e7fb3c/el7/pkg/libs/fftw3_float/3.3.10/gcc-9.3.0+openmpi-4.0.4 \
> --with-hdf5-path=/opt/gridware/depots/54e7fb3c/el7/pkg/apps/hdf5_mpi/1.12.2/gcc-9.3.0+openmpi-4.0.4 \
> --with-petsc-path=/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0
... Success ...
$ make -j1 core
... Outputs ...
[src/bse] libbse.a (lib)
[driver] yambo (checking work to be done)
[driver] yambo
[driver] yambo (link)
yambo linking failed. Check logs/compile_yambo.log
make[1]: *** [yambo] Error 1
yambo build failed
$ cat log/compile_yambo.log
... lots of data ...
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char*, char*)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::clear()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data(char*)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned long)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_local_data()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status
Finally I got what was wrong, I needed to add the flags "-E -P" to the Fortran and C preprocessors:
export CPP="/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gcc -E -P"
export FPP="/opt/gridware/depots/54e7fb3c/el7/pkg/compilers/gcc/9.3.0/bin/gfortran -E -P -cpp"
Now the precompiler works, and I get the correct object make files.
Nevertheless, I got in a new error, the libraries do not compile.
Is it possible that some of these libraries do not compile with GCC 9.3.0?
Help will be appreciated.
Thanks.
Luis.
-------------------------------------------------------------------------------------
$ ./configure --prefix=/opt/apps/yambo/5.1.0/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0+fftw3-3.3.10+hdf5-1.12.2+petsc-3.17.2 \
> --enable-mpi=yes --with-mpi-path=/opt/gridware/depots/54e7fb3c/el7/pkg/mpi/openmpi/4.0.4/gcc-9.3.0+ucx-1.8.0 \
> --with-blas-libs=/opt/gridware/depots/54e7fb3c/el7/pkg/libs/blas/3.8.0/gcc-9.3.0/libblas.a \
> --with-lapack-libs=/opt/gridware/depots/54e7fb3c/el7/pkg/libs/lapack/3.9.0/gcc-9.3.0/lib64/liblapack.a \
> --with-fft-path=/opt/gridware/depots/54e7fb3c/el7/pkg/libs/fftw3_float/3.3.10/gcc-9.3.0+openmpi-4.0.4 \
> --with-hdf5-path=/opt/gridware/depots/54e7fb3c/el7/pkg/apps/hdf5_mpi/1.12.2/gcc-9.3.0+openmpi-4.0.4 \
> --with-petsc-path=/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0
... Success ...
$ make -j1 core
... Outputs ...
[src/bse] libbse.a (lib)
[driver] yambo (checking work to be done)
[driver] yambo
[driver] yambo (link)
yambo linking failed. Check logs/compile_yambo.log
make[1]: *** [yambo] Error 1
yambo build failed
$ cat log/compile_yambo.log
... lots of data ...
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char> const&)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars(char*, char*, char*)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::clear()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data(char*)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned long)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_local_data()@GLIBCXX_3.4.21'
/opt/apps/petsc/3.17.2/gcc-9.3.0+openmpi-4.0.4+blas-3.8.0+lapack-3.9.0/lib/libpetsc.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)@GLIBCXX_3.4.21'
collect2: error: ld returned 1 exit status