Page 1 of 1

linking problem yambo4.4.0

Posted: Thu Sep 19, 2019 1:16 pm
by g.zollo
Hallo,
I'm compiling the last release of Yambo on Intel(R) Xeon(R) CPU E5-2670 (CentOS 6.9) in parallel (Openmpi version 1.8.) with a rather old fortran compiler gfortran gcc 4.4.7 but with the c-interoperability and fortran 2003 support and hdf5 support.
This is my configure
./configure FC=gfortran MPIFC=mpif90 --enable-3d-fft --enable-dp --enable-mpi --enable-internal-fftsg --enable-par-linalg --enable-int-linalg --enable-iotk --enable-netcdf --enable-etsf-io --enable-netcdf-hdf5

I get the following error

>>>[Linking p2y]<<<
make[2]: Entering directory `/home/pino/yambo-4.4.0/interfaces/p2y'
qeh5_module.f90:693.15:

buf = c_loc(text)
1
Error: CHARACTER argument 'text' to 'c_loc' at (1) must have a length of 1
qeh5_module.f90:484.16:

ptr = C_LOC(integer_data)
1
Error: Assumed-shape array 'integer_data' at (1) cannot be an argument to the procedure 'c_loc' because it is not C interoperable
make[2]: *** [qeh5_module.o] Error 1
make[2]: Leaving directory `/home/pino/yambo-4.4.0/interfaces/p2y'
make[1]: *** [p2y] Error 2
make[1]: Leaving directory `/home/pino/yambo-4.4.0'
p2y build failed

I've taken a look into the code and it seems to me that the routines where the error generates are not called anywhere (I'm not sure).
Do you have suggestions?
Thank you very much
Giuseppe

Re: linking problem yambo4.4.0

Posted: Thu Sep 19, 2019 3:08 pm
by andrea.ferretti
Dear Giuseppe,

I have met the same problem recently, and I think it is related to the gcc version.
As far as I understand, the use of C_LOC that yambo does is in a fortran standard that is supported only by
recent versions of gcc.

In my case, upgrading to
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)

solved the problem.

hope it helps
Andrea

Re: linking problem yambo4.4.0

Posted: Fri Sep 20, 2019 10:14 am
by g.zollo
Dear Andrea,
this was exactly my feeling. By defining the variable "text" as character(len=1) it is possible to solve the first problem. I've not been able to solve the second one even trying to replace ptr = C_LOC(integer_data) with ptr = C_LOC(integer_data(1,1)) (I understand that c_loc in my gcc version requires a scalar argument).
I think I will upgrade the gcc version.
Thank you very much.
Giuseppe