Page 1 of 2

Error in compilation

Posted: Fri Mar 13, 2015 1:19 pm
by koudai
Dear all,

I would like to use Yambo with PWscf.
When I run "$ make yambo interfaces", however, an error message appears:
>>>[Making slatec]<<<
make[1]: Entering directory `/home/koudai/yambo-3.4.1-rev61/lib/slatec'
Makefile:52: *** missing separator. Stop.
make[1]: Leaving directory `/home/koudai/yambo-3.4.1-rev61/lib/slatec'
make: *** [libs] Error 2
How should I do to avoid this error?

With seeing Compilation page (http://www.yambo-code.org/download/compiling.php) and a past topic (viewtopic.php?f=1&t=854), I made a shell-script file as

Code: Select all

export MKL_LIB=$MKLROOT/lib/intel64
export CC=icc
export CXX=icpc
export FC=ifort
export F77=ifort
export F90=ifort
export PFC=mpif90
export CFLAGS=-O3
export FCFLAGS=" -O2 -assume buffered_io,byterecl"
export FFLAGS=" -O2 -assume buffered_io,byterecl"
export FFLAGS_NOOPT=" -O0 -assume buffered_io,byterecl"
export UFFLAGS='-assume bscc -O0'
./configure --enable-netcdf-LFS --enable-netcdf-hdf5 --with-netcdf-lib=/usr/local/netcdf-fortran-4.4.2/lib --with-netcdf-include=/usr/local/netcdf-fortran-4.4.2/include --with-iotk=/home/koudai/espresso-5.1/iotk/ --with-p2y=5.0
The configuration looked successfully finished.

My environment is:
OS: Ubuntu 14.04 64-bit
Compiler: Intel Parallel Studio XE 2013
Quantum ESPRESSO 5.1, OpenMPI, NetCDF, and HDF5 are installed.

Thanks in advance.

Re: Error in compilation

Posted: Fri Mar 13, 2015 2:25 pm
by Daniele Varsano
Dear Koudai,
you can have a look to this post and see if you can solve the problem.
If you cannot, please post your config.log Makefile and the makefile in ./lib/slatec directory.

Best,
Daniele

Re: Error in compilation

Posted: Sat Mar 14, 2015 8:30 am
by koudai
Dear Daniele,

Thank you for telling me the related post.
I checked the post and deleted FCFLAGS.
Unfortunately, when I run 'configure', the following error massage appears, and the 'configure' stops:
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... lower case, underscore, no extra underscore
checking for external C routine (test) naming scheme... test_
checking for Fortran flag needed to accept free-form source... none
checking fortran 90 modules inclusion flag... -I
configure: testing preprocessor icc -E -ansi
checking if precompiler works on C source... yes
checking if precompiler works on F90 source... no
configure: error: Found precompiler problems in processing the F90/C source.
And if other flags are deleted, the same result as I had posted first appears.

I attached config.log and makefiles generated after running 'make yambo interfaces' without deleting any flags.

Best,

Re: Error in compilation

Posted: Mon Mar 16, 2015 4:01 pm
by myrta gruning
Dear Koudai

can you try a different preprocessor?
For example
CPP='gcc -E'

remember to do
make_clean

before rerunning the configure

Best wishes
m

Re: Error in compilation

Posted: Mon Mar 23, 2015 3:29 am
by koudai
Dear Myrta,

I tried to run 'configure' without any parameters, like

$ ./configure
$ make yambo interfaces

Then, I got the following error message
>>>[Linking yambo]<<<
make[1]: Entering directory `/home/koudai/yambo-3.4.1-rev61/driver'
yambo_driver.F
driver.o: In function `main':
/home/koudai/yambo-3.4.1-rev61/driver/driver.c:102: multiple definition of `main'
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64/for_main.o:/export/users/nbtester/efi2linux_nightly/branch-14_0/20140121_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x0): first defined here
/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64/for_main.o: In function `main':
/export/users/nbtester/efi2linux_nightly/branch-14_0/20140121_010000/libdev/frtl/src/libfor/for_main.c:(.text+0x42): undefined reference to `MAIN__'
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(ctrtri.o): In function `ctrtri_':
ctrtri.f:(.text+0x155): undefined reference to `_gfortran_concat_string'
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(cgesvd.o): In function `cgesvd_':
cgesvd.f:(.text+0x7b): undefined reference to `_gfortran_concat_string'
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(cunmbr.o): In function `cunmbr_':
cunmbr.f:(.text+0x385): undefined reference to `_gfortran_concat_string'
cunmbr.f:(.text+0x5c2): undefined reference to `_gfortran_concat_string'
cunmbr.f:(.text+0x769): undefined reference to `_gfortran_concat_string'
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(cunmbr.o):cunmbr.f:(.text+0x7c9): more undefined references to `_gfortran_concat_string' follow
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(slamch.o): In function `slamc2_':
slamch.f:(.text+0x61e): undefined reference to `_gfortran_st_write'
slamch.f:(.text+0x637): undefined reference to `_gfortran_transfer_integer_write'
slamch.f:(.text+0x646): undefined reference to `_gfortran_st_write_done'
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(ilaenv.o): In function `ilaenv_':
ilaenv.f:(.text+0x50): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x93): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0xb2): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0xd1): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0xec): undefined reference to `_gfortran_compare_string'
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(ilaenv.o):ilaenv.f:(.text+0x107): more undefined references to `_gfortran_compare_string' follow
/home/koudai/yambo-3.4.1-rev61/lib/liblapack.a(chseqr.o): In function `chseqr_':
chseqr.f:(.text+0x8ad): undefined reference to `_gfortran_concat_string'
chseqr.f:(.text+0x91f): undefined reference to `_gfortran_concat_string'
/home/koudai/yambo-3.4.1-rev61/lib/libblas.a(xerbla.o): In function `xerbla_':
xerbla.f:(.text+0x68): undefined reference to `_gfortran_st_write'
xerbla.f:(.text+0x86): undefined reference to `_gfortran_transfer_character_write'
xerbla.f:(.text+0xa4): undefined reference to `_gfortran_transfer_integer_write'
xerbla.f:(.text+0xb3): undefined reference to `_gfortran_st_write_done'
xerbla.f:(.text+0xc2): undefined reference to `_gfortran_stop_string'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(pvalue.o): In function `pvalue_':
pvalue.f:(.text+0x9d1): undefined reference to `_gfortran_st_write'
pvalue.f:(.text+0x9eb): undefined reference to `_gfortran_transfer_integer_write'
pvalue.f:(.text+0x9f8): undefined reference to `_gfortran_st_write_done'
pvalue.f:(.text+0xa68): undefined reference to `_gfortran_st_write'
pvalue.f:(.text+0xa82): undefined reference to `_gfortran_transfer_integer_write'
pvalue.f:(.text+0xa8f): undefined reference to `_gfortran_st_write_done'
pvalue.f:(.text+0xab4): undefined reference to `_gfortran_concat_string'
pvalue.f:(.text+0xadf): undefined reference to `_gfortran_concat_string'
pvalue.f:(.text+0xb07): undefined reference to `_gfortran_concat_string'
pvalue.f:(.text+0xb32): undefined reference to `_gfortran_concat_string'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(xermsg.o): In function `xermsg_':
xermsg.f:(.text+0x47b): undefined reference to `_gfortran_st_write'
xermsg.f:(.text+0x490): undefined reference to `_gfortran_transfer_integer_write'
xermsg.f:(.text+0x49d): undefined reference to `_gfortran_st_write_done'
xermsg.f:(.text+0x4aa): undefined reference to `_gfortran_string_len_trim'
xermsg.f:(.text+0x4c3): undefined reference to `_gfortran_string_len_trim'
xermsg.f:(.text+0x4dc): undefined reference to `_gfortran_string_len_trim'
xermsg.f:(.text+0x4f5): undefined reference to `_gfortran_string_len_trim'
xermsg.f:(.text+0x50e): undefined reference to `_gfortran_string_len_trim'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(xermsg.o):xermsg.f:(.text+0x527): more undefined references to `_gfortran_string_len_trim' follow
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(xermsg.o): In function `xermsg_':
xermsg.f:(.text+0x583): undefined reference to `_gfortran_concat_string'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(xerhlt.o): In function `xerhlt_':
xerhlt.f:(.text+0x9): undefined reference to `_gfortran_stop_string'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(xerprn.o): In function `xerprn_':
xerprn.f:(.text+0x117): undefined reference to `_gfortran_string_len_trim'
xerprn.f:(.text+0x17c): undefined reference to `_gfortran_string_index'
xerprn.f:(.text+0x1d1): undefined reference to `_gfortran_string_len_trim'
xerprn.f:(.text+0x298): undefined reference to `_gfortran_st_write'
xerprn.f:(.text+0x2a8): undefined reference to `_gfortran_transfer_character_write'
xerprn.f:(.text+0x2b0): undefined reference to `_gfortran_st_write_done'
xerprn.f:(.text+0x329): undefined reference to `_gfortran_string_len_trim'
xerprn.f:(.text+0x4bc): undefined reference to `_gfortran_st_write'
xerprn.f:(.text+0x4ca): undefined reference to `_gfortran_transfer_character_write'
xerprn.f:(.text+0x4d2): undefined reference to `_gfortran_st_write_done'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(xersve.o): In function `xersve_':
xersve.f:(.text+0xf1): undefined reference to `_gfortran_compare_string'
xersve.f:(.text+0x10c): undefined reference to `_gfortran_compare_string'
xersve.f:(.text+0x127): undefined reference to `_gfortran_compare_string'
xersve.f:(.text+0x376): undefined reference to `_gfortran_st_write'
xersve.f:(.text+0x380): undefined reference to `_gfortran_st_write_done'
xersve.f:(.text+0x3f3): undefined reference to `_gfortran_st_write'
xersve.f:(.text+0x409): undefined reference to `_gfortran_transfer_character_write'
xersve.f:(.text+0x41f): undefined reference to `_gfortran_transfer_character_write'
xersve.f:(.text+0x435): undefined reference to `_gfortran_transfer_character_write'
xersve.f:(.text+0x44b): undefined reference to `_gfortran_transfer_integer_write'
xersve.f:(.text+0x461): undefined reference to `_gfortran_transfer_integer_write'
xersve.f:(.text+0x47b): undefined reference to `_gfortran_transfer_integer_write'
xersve.f:(.text+0x485): undefined reference to `_gfortran_st_write_done'
xersve.f:(.text+0x4db): undefined reference to `_gfortran_st_write'
xersve.f:(.text+0x4e5): undefined reference to `_gfortran_st_write_done'
xersve.f:(.text+0x560): undefined reference to `_gfortran_st_write'
xersve.f:(.text+0x574): undefined reference to `_gfortran_transfer_integer_write'
xersve.f:(.text+0x57e): undefined reference to `_gfortran_st_write_done'
/home/koudai/yambo-3.4.1-rev61/lib/libslatec.a(i1mach.o): In function `i1mach_':
i1mach.f:(.text+0x49): undefined reference to `_gfortran_st_write'
i1mach.f:(.text+0x51): undefined reference to `_gfortran_st_write_done'
i1mach.f:(.text+0x5a): undefined reference to `_gfortran_stop_string'
make[1]: *** [yambo] Error 1
make[1]: Leaving directory `/home/koudai/yambo-3.4.1-rev61/driver'
make: *** [yambo] Error 2
And when I added CPP='gcc -E', I got another error message:
>>>[Making modules]<<<
make[1]: Entering directory `/home/koudai/yambo-3.4.1-rev61/src/modules'
mod_pars.F mod_units.F mod_stderr.F mod_parallel.F mod_wrapper.F mod_fields.F mod_collision.F mod_drivers.F mod_FFT.F mod_timing.F mod_logo mod_com.F mod_memory.F mod_R_lattice.F mod_matrix_operate.F mod_D_lattice.F mod_frequency.F mod_vec_operate.F mod_electrons.F mod_wave_func.F mod_interfaces.F mod_interpolate.F mod_X.F mod_functions.F mod_zeros.F mod_pseudo.F mod_BS.F mod_QP.F mod_TDDFT.F mod_ACFDT.F mod_wf_distribute.F mod_IO.F mod_fragments.F mod_xc_functionals.f90(29): error #7013: This module file was not generated by any release of this compiler. [XC_F90_LIB_M]
use xc_f90_lib_m
-----^
mod_xc_functionals.f90(36): error #6683: A kind type parameter must be a compile-time constant. [SP]
real(SP), public, allocatable:: magn(:,:)
------^
mod_xc_functionals.f90(37): error #6683: A kind type parameter must be a compile-time constant. [SP]
real(SP), public, allocatable:: V_xc(:,:)
------^
mod_xc_functionals.f90(38): error #6683: A kind type parameter must be a compile-time constant. [SP]
real(SP), public, allocatable:: E_xc(:)
------^
mod_xc_functionals.f90(39): error #6683: A kind type parameter must be a compile-time constant. [SP]
real(SP), public, allocatable:: F_xc(:)
------^
mod_xc_functionals.f90(47): error #8237: The character length in a component declaration shall either be a colon, be an initialization expression, or be a specification expression. [NAME]
character(lchlen) :: name
------------------------^
mod_xc_functionals.f90(48): error #6457: This derived type name has not been declared. [XC_F90_POINTER_T]
type(xc_f90_pointer_t) :: conf
--------^
mod_xc_functionals.f90(49): error #6457: This derived type name has not been declared. [XC_F90_POINTER_T]
type(xc_f90_pointer_t) :: info
--------^
mod_xc_functionals.f90(82): error #7013: This module file was not generated by any release of this compiler. [XC_F90_TYPES_M]
use xc_f90_types_m
---------^
mod_xc_functionals.f90(89): error #6457: This derived type name has not been declared. [XC_F90_POINTER_T]
type(xc_f90_pointer_t) :: p,info
----------^
mod_xc_functionals.f90(28): error #6580: Name in only-list does not exist. [SP]
use pars, ONLY:SP,lchlen
---------------------^
mod_xc_functionals.f90(47): error #6404: This name does not have a type, and must have an explicit type. [LCHLEN]
character(lchlen) :: name
-------------^
mod_xc_functionals.f90(28): error #6580: Name in only-list does not exist. [LCHLEN]
use pars, ONLY:SP,lchlen
------------------------^
mod_xc_functionals.f90(94): error #6404: This name does not have a type, and must have an explicit type. [P]
call xc_f90_func_init(p,info,f(ixc)%id,nsp)
-----------------------------^
mod_xc_functionals.f90(94): error #6404: This name does not have a type, and must have an explicit type. [INFO]
call xc_f90_func_init(p,info,f(ixc)%id,nsp)
-------------------------------^
mod_xc_functionals.f90(96): error #6404: This name does not have a type, and must have an explicit type. [XC_F90_INFO_FAMILY]
f(ixc)%family=xc_f90_info_family(info)
---------------------^
mod_xc_functionals.f90(97): error #6404: This name does not have a type, and must have an explicit type. [XC_F90_INFO_KIND]
f(ixc)%kind=xc_f90_info_kind(info)
-------------------^
mod_xc_functionals.f90(100): error #6404: This name does not have a type, and must have an explicit type. [XC_F90_INFO_FLAGS]
f(ixc)%flags=xc_f90_info_flags(info)
--------------------^
mod_xc_functionals.f90(101): error #6460: This is not a field name that is defined in the encompassing structure. [CONF]
f(ixc)%conf=p
--------------^
mod_xc_functionals.f90(102): error #6460: This is not a field name that is defined in the encompassing structure. [INFO]
f(ixc)%info=info
--------------^
mod_xc_functionals.f90(83): error #6580: Name in only-list does not exist. [XC_F90_FUNC_INIT]
use xc_f90_lib_m, ONLY:xc_f90_func_init,xc_f90_info_family,&
----------------------------^
mod_xc_functionals.f90(83): error #6580: Name in only-list does not exist. [XC_F90_INFO_FAMILY]
use xc_f90_lib_m, ONLY:xc_f90_func_init,xc_f90_info_family,&
---------------------------------------------^
mod_xc_functionals.f90(84): error #6580: Name in only-list does not exist. [XC_F90_INFO_KIND]
xc_f90_info_kind,xc_f90_info_flags
----------^
mod_xc_functionals.f90(84): error #6580: Name in only-list does not exist. [XC_F90_INFO_FLAGS]
xc_f90_info_kind,xc_f90_info_flags
---------------------------^
mod_xc_functionals.f90(115): error #6404: This name does not have a type, and must have an explicit type. [XC_UNPOLARIZED]
call xc_setup_fnctl(f,functional,XC_UNPOLARIZED)
--------------------------------------^
compilation aborted for mod_xc_functionals.f90 (code 1)
make[1]: *** [mod_xc_functionals.o] Error 1
make[1]: Leaving directory `/home/koudai/yambo-3.4.1-rev61/src/modules'
make: *** [yambo] Error 2
Do you have any idea?

Best,

Re: Error in compilation

Posted: Mon Mar 23, 2015 7:34 am
by Daniele Varsano
Dear Koudai,
It looks you did not do a make clean (better make clean_all) between one compilation and the other.
Next you can also try to add: LDFLAGS=-nofor_main

Best,
Daniele

Re: Error in compilation

Posted: Tue Mar 24, 2015 8:06 am
by koudai
Dear Daniele,

I forgot to 'make clean_all' in my first compilation.
The error messages are the same regardless of the presence of CPP='gcc -E'.

I tried to add LDFLAGS=-nofor_main, like
$ export CPP='gcc -E'
$ export LDFLAGS=-nofor_main
$ ./configure
The result is
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/koudai/yambo-3.4.1-rev61':
configure: error: C compiler cannot create executables
See `config.log' for more details
I attached config.log.

Best,
Koudai

Re: Error in compilation

Posted: Tue Mar 24, 2015 11:35 am
by Daniele Varsano
Dear Koudai,
this is because -nofor_main is an intel compiler flags and now you are using gfortran.
If you want to use gfortran, remove the flags, otherwise for the intel try to specify the precompiler as:

CPP='icc -E'

Remember to do a make clean_all when switching the compiler.

Best,

Daniele

Re: Error in compilation

Posted: Tue Mar 24, 2015 12:48 pm
by koudai
Dear Daniele,

Thank you for continuing to answer my troublesome problems.
I added -E option in icc and gcc.
When I used intel compilers or GNU compilers, I got the error message as in my first post (viewtopic.php?f=1&t=980).

The latest shell-script file for intel compilers is

Code: Select all

export MKL_LIB=$MKLROOT/lib/intel64
export CC=icc
export CXX=icpc
export CPP='icc -E'
export FC=ifort
export F77=ifort
export F90=ifort
export PFC=mpif90
export LDFLAGS=-nofor_main
./configure --enable-netcdf-LFS --enable-netcdf-hdf5 --with-netcdf-lib=/usr/local/netcdf-fortran-4.4.2/lib --with-netcdf-include=/usr/local/netcdf-fortran-4.4.2/include --with-iotk=/home/koudai/espresso-5.1/iotk/ --with-p2y=5.0
Best,
Koudai

Re: Error in compilation

Posted: Wed Mar 25, 2015 12:24 am
by andrea.ferretti
Dear Koudai,

I tried to reproduce your error (using the same version yambo) and indeed I've got a similar error (while on newer yambo versions the error is not there)... all the variable you set in your last report are similar to mine. A deeper look shows that in my case the error is triggered by FCFLAGS left unset (leading to configure setting the default ones).
If instead I set FCFLAGS="-O3" (disabling configure default) it configures properly.

my configuration script reads:

./configure \
FC=ifort \
CC=icc \
F77=ifort \
F90=ifort \
CPP="icc -E" \
CPPFLAGS="-ansi" \
FCFLAGS="-O3" \
LDFLAGS=-nofor_main \
--with-blas="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core" \
--with-lapack="-lmkl_intel_lp64 -lmkl_sequential -lmkl_core" \
--with-p2y \
--with-iotk=/home/ferretti/espresso-5.0.2/S3DE/iotk \
--with-netcdf-lib=/opt/netcdf/3.6.3-intel/lib \
--with-netcdf-include=/opt/netcdf/3.6.3-intel/include \
--with-netcdf-link=-lnetcdf \
--enable-msgs-comps

nevertheless, when I try to compile I get an error from the preprocessing of libxc.

In order to fix this I had to edit the file config/libxc.m4
and change the line:
./configure FC=$F90 CC=$CC --prefix=$PWD/../../ >&/dev/null
with
./configure FC=$F90 CC=$CC FCCPP="cpp -E -P -ansi" --prefix=$PWD/../../ >&/dev/null

after this you need to run:
autoconf config/configure.ac > configure

and then make clean_all and reconfigure using the script above...
after this the configuration/compilation went ok in my case...

this is rather complicated (and perhaps there are simpler solutions), but at least it works..
I think the origin of the complication is that the configure script distributed with yambo 3.4.1 is getting out of sync with the newer versions of the compilers etc...
Soon (couple of weeks) there will be a new release of yambo where all of these issues are already sorted out

hope it helps
Andrea