Precompiler error with GNU compiler

Having trouble compiling the Yambo source? Using an unusual architecture? Problems with the "configure" script? Problems in GPU architectures? This is the place to look.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani

Forum rules
If you have trouble compiling Yambo, please make sure to list:
(1) the compiler (vendor and release: e.g. intel 10.1)
(2) the architecture (e.g. 64-bit IBM SP5)
(3) if the problems occur compiling in serial/in parallel
(4) the version of Yambo (revision number/major release version)
(5) the relevant compiler error message
lfmenchero
Posts: 9
Joined: Mon Jun 13, 2022 6:12 pm

Re: Precompiler error with GNU compiler

Post by lfmenchero » 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
Dr Luis Fernandez Menchero
Northern Ireland High Performance Computing Center
Queen's University Belfast
United Kingdom
https://www.ni-hpc.ac.uk

lfmenchero
Posts: 9
Joined: Mon Jun 13, 2022 6:12 pm

Re: Precompiler error with GNU compiler

Post by lfmenchero » Thu Jun 23, 2022 3:30 pm

Hello again.
If I remove the specification for the petsc library, and I specify a precompiled version of iotk (it does not compile iotk), I get the following error.
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-iotk-libs=/opt/apps/iotk/1.2.0/gcc-4.8.5/lib/libiotk.a
... Success ...

$ make -j1 core
... Outputs ...
[src/wf_and_fft] libwf_and_fft.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
... Outputs ...
/usr/bin/ld: cannot find -lbse
/usr/bin/ld: cannot find -lacfdt
/usr/bin/ld: cannot find -lqp
/usr/bin/ld: cannot find -lpol_function
/usr/bin/ld: cannot find -ldipoles
/usr/bin/ld: cannot find -ltddft
/usr/bin/ld: cannot find -lsetup
/usr/bin/ld: cannot find -lqp_control
/usr/bin/ld: cannot find -linterpolate
/usr/bin/ld: cannot find -lcoulomb
/usr/bin/ld: cannot find -lstop_and_restart
/usr/bin/ld: cannot find -linterface
/usr/bin/ld: cannot find -lxc_functionals
/usr/bin/ld: cannot find -lio
/usr/bin/ld: cannot find -lYio
/usr/bin/ld: cannot find -ltiming
/usr/bin/ld: cannot find -lcommon
/usr/bin/ld: cannot find -lcommunicate
/usr/bin/ld: cannot find -lparser
/usr/bin/ld: cannot find -lparallel
/usr/bin/ld: cannot find -lbz_ops
/usr/bin/ld: cannot find -llinear_algebra
/usr/bin/ld: cannot find -lmatrices
/usr/bin/ld: cannot find -lmodules
/usr/bin/ld: cannot find -lcommunicate
/usr/bin/ld: cannot find -lmemory
/usr/bin/ld: cannot find -ltools
/usr/bin/ld: cannot find -lyambo_Ydriver_main
/usr/bin/ld: cannot find -lyambo_Ydriver_interface
/usr/bin/ld: cannot find -lyambo_Ydriver_options
/usr/bin/ld: cannot find -ldriver
collect2: error: ld returned 1 exit status
Dr Luis Fernandez Menchero
Northern Ireland High Performance Computing Center
Queen's University Belfast
United Kingdom
https://www.ni-hpc.ac.uk

User avatar
Daniele Varsano
Posts: 3773
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Precompiler error with GNU compiler

Post by Daniele Varsano » Fri Jun 24, 2022 8:14 am

Dear Luis,

can you post the logs/compile_yambo.log file?
nest, please sign your post with the full name and affiliation, it is a rule of the forum. You can do once for all by filling the signature in your user profile.

Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

lfmenchero
Posts: 9
Joined: Mon Jun 13, 2022 6:12 pm

Re: Precompiler error with GNU compiler

Post by lfmenchero » Fri Jun 24, 2022 10:37 am

Hi Daniele.
I attach here the log files.
Thanks.
Luis.
You do not have the required permissions to view the files attached to this post.
Dr Luis Fernandez Menchero
Northern Ireland High Performance Computing Center
Queen's University Belfast
United Kingdom
https://www.ni-hpc.ac.uk

User avatar
Nicola Spallanzani
Posts: 62
Joined: Thu Nov 21, 2019 10:15 am

Re: Precompiler error with GNU compiler

Post by Nicola Spallanzani » Mon Jul 04, 2022 12:04 pm

Hi Luis,
I suggest to you to let Yambo compile by himself the iotk library.

Best,
Nicola
Nicola Spallanzani, PhD
S3 Centre, Istituto Nanoscienze CNR and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu

lfmenchero
Posts: 9
Joined: Mon Jun 13, 2022 6:12 pm

Re: Precompiler error with GNU compiler

Post by lfmenchero » Thu Jul 07, 2022 5:03 pm

Hi Nicola.
Finally I could compile it and make it work in the cluster.
I made yambo to compile its own implementation of iotk, and it worked. The compilation was not completely clean, some warnings, but it works. I will try updates when they are released, they should be cleaner.
Thank you for your help!
Best.
Luis.
Dr Luis Fernandez Menchero
Northern Ireland High Performance Computing Center
Queen's University Belfast
United Kingdom
https://www.ni-hpc.ac.uk

Post Reply