Page 1 of 1

error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 5:05 am
by kjzhang
Dear all,
When I try to compile yambo 4.0.0-rev.78, I comed across the error like this follow:
/home/kjzhang/code/yambo-4.0.0-rev.78/lib/libnetcdf.a(libnetcdf4_la-nc4attr.o): in function ‘NC4_rename_att’:
/home/kjzhang/code/Yambo/netcdf-4.3.3.1/libsrc4/nc4attr.c:703:undefined reference to ‘H5Adelete’
/home/kjzhang/code/Yambo/netcdf-4.3.3.1/libsrc4/nc4attr.c:696:undefined reference to ‘H5Adelete’
/home/kjzhang/code/yambo-4.0.0-rev.78/lib/libnetcdf.a(libnetcdf4_la-nc4attr.o):in function ‘NC4_del_att’:
/home/kjzhang/code/Yambo/netcdf-4.3.3.1/libsrc4/nc4attr.c:808:undefined reference to ‘H5Adelete’
/home/kjzhang/code/yambo-4.0.0-rev.78/lib/libnetcdf.a(libnetcdf4_la-nc4dim.o):in function ‘NC4_rename_dim’:
/home/kjzhang/code/Yambo/netcdf-4.3.3.1/libsrc4/nc4dim.c:322:undefined reference to ‘H5Dclose’
/home/kjzhang/code/Yambo/netcdf-4.3.3.1/libsrc4/nc4dim.c:327:undefined reference to ‘H5Gunlink’
make[1]: *** [yambo] error 1
make[1]:Leaving directory `/home/kjzhang/code/yambo-4.0.0-rev.78/driver'
make: *** [yambo] error 2


If I used extarnal netCDF-4.3.3.1 & netCDF-fortran-4.4.2, the above error will occure. Configure command as

Code: Select all

export FC=ifort
export CC=icc
export F77=ifort
export F90=ifort
export CXX=icpc
export CPP="icc -E"
export PFC=mpif90
export LDFLAGS=-nofor_main
./configure \
--with-blas-libs="-L/opt/intel/composer_xe_2013.2.146/mkl/lib/intel64 -lmkl_intel_lp64  -lmkl_sequential -lmkl_core" \
--with-lapack-libs="-L/opt/intel/composer_xe_2013.2.146/mkl/lib/intel64 -lmkl_intel_lp64  -lmkl_sequential -lmkl_core" \
--with-iotk-path=/home/kjzhang/work/espresso-5.0.2/iotk \
--with-libxc-path=/home/kjzhang/code/Yambo/libxc-2.2.2 \
--with-fft-path=/home/kjzhang/code/FFTW-code/fftw-3.3.4 \
--with-p2y-version=4.0 \
--with-netcdf-libs="-L/home/kjzhang/code/local/lib -lnetcdf" \
--with-netcdf-path=/home/kjzhang/code/local \
--with-netcdf-libdir=/home/kjzhang/code/local/lib \
--with-netcdf-includedir=/home/kjzhang/code/local/include \
--with-hdf5-libs="-L/home/kjzhang/code/local/lib -lhdf5_hl -lhdf5 -lz -lsz" \
--with-hdf5-path=/home/kjzhang/code/local \
--with-hdf5-libdir=/home/kjzhang/code/local/lib \
--with-hdf5-includedir=/home/kjzhangcode/local/include
But if I use internal netCDF, I can successfully make yambo.
I can't figure out what's going wrong!

Here is my enviroment:
OS: ubuntu 14.04, 64-bit
Compiler: intel composer_xe_2013.2.146 (both yambo and netCDF are compiled using this compiler)

p.s. anthor question: I have installed HDF5, and add lib_path when I configure, but after configuring, turns out yambo don't find HDF5, I don't know why this happens.

Thanks in adance!

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 9:20 am
by andrea.ferretti
Dear kjzhang,

regarding the compilation with external netcdf+hdf5 libs, your configure flags look like:

Code: Select all

--with-netcdf-libs="-L/home/kjzhang/code/local/lib -lnetcdf" \
--with-netcdf-path=/home/kjzhang/code/local \
--with-netcdf-libdir=/home/kjzhang/code/local/lib \
--with-netcdf-includedir=/home/kjzhang/code/local/include \
--with-hdf5-libs="-L/home/kjzhang/code/local/lib -lhdf5_hl -lhdf5 -lz -lsz" \
--with-hdf5-path=/home/kjzhang/code/local \
--with-hdf5-libdir=/home/kjzhang/code/local/lib \
--with-hdf5-includedir=/home/kjzhangcode/local/include
both for netcdf and hdf5, you need to specify either
--with-*-path alone (configure will try to understand what to do)
or
complement it with
--with-*-libdir
--with-*-includedir (if lib and include dirs are in a non standard position wrt
the path dir)

or, when everything else does not work, you can specify the direct linking flags using
--with-*-libs="-Lxxx -lyyy etc"
for f90 libraries, you may need to add
--with-*-includedir
if the include path is not set in the environment.

coming to your case:

I would start by setting

Code: Select all

--with-netcdf-path=<path to your installed netcdf libs> \
--with-hdf5-path=<path to your installed hdf5 lib> \
which works most of the time...

hope it helps
Andrea

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 2:57 pm
by kjzhang
Dear Andrea,
Thank you for reply. Following your suggestion, I re-configure by these flags:

Code: Select all

export FC=ifort
export CC=icc
export F77=ifort
export F90=ifort
export CXX=icpc
export CPP="icc -E"
export PFC=mpif90
./configure \
--with-blas-libs="-L/opt/intel/composer_xe_2013.2.146/mkl/lib/intel64 -lmkl_intel_lp64  -lmkl_sequential -lmkl_core" \
--with-lapack-libs="-L/opt/intel/composer_xe_2013.2.146/mkl/lib/intel64 -lmkl_intel_lp64  -lmkl_sequential -lmkl_core" \
--with-iotk-path=/home/kjzhang/work/espresso-5.0.2/iotk \
--with-libxc-path=/home/kjzhang/code/Yambo/libxc-2.2.2 \
--with-fft-path=/home/kjzhang/code/FFTW-code/fftw-3.3.4 \
--with-p2y-version=4.0 \
--enable-netcdf-hdf5 \
--with-netcdf-path=/home/kjzhang/code/local \
--with-hdf5-path=/home/kjzhang/code/local
It turns out the same problem as previous, it can find external netcdf but not for hdf5.
Then I type "make all", the same error occur as above I reported. :o Is there any problem with my installed netcdf&hdf5?
But I installed nectdf and hdf5 in the directory:/home/kjzhang/code/local and they are all installed successfully.
Do u have any ideas about these problems?
Thanks a lot!

Best,
Zhang

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 3:07 pm
by andrea.ferretti
Dear Zhang,

what do you mean wham you say you have installed netcdf and hdf5 in
/home/kjzhang/code/local?

In a standard installation, you should have a netcdf and a hdf5 specific folders in there. Each of these should then contain
a lib/ and a include/ subfolder.
For instance, in my case it reads:

Code: Select all

/opt/netcdf-4.3.2/lib
/opt/netcdf-4.3.2/include
/opt/hdf5-1.8.13/lib
/opt/hdf5-1.8.13/include
Then I configure using

Code: Select all

--with-netcdf-path=/opt/netcdf-4.3.2/ \
--with-hdf5-path=/opt/hdf5-1.8.13/
If this also does not work, please send your config.log file

Andrea

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 3:34 pm
by kjzhang
Dear Andrea,
I installed both of netcdf and hdf5 using command:

Code: Select all

./configure --prefix=/home/kjzhang/code/local 
the config.log file as follow, thanks

Zhang

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 4:03 pm
by andrea.ferretti
Dear Zhang,

then I think the flags you are using are correct.
From the config.log it seems the hdf5 module files are not found

conftest.f90(3): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [HDF5]

In particular, can you check you have hdf5.mod in the include dir
/home/kjzhang/code/local/include

Andrea

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 4:31 pm
by kjzhang
Dear Andrea,
I checked what u said, there is no hdf5.mod in the include dir:/home/kjzhang/code/local/include
So is this the point that cause the error? How can I fix it?
Thanks!

Zhang

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sat May 09, 2015 6:35 pm
by andrea.ferretti
ehi,

just checked now my installation of hdf5, and the configure command reads:

Code: Select all

./configure \
   --prefix="/opt/hdf5/1.8.13-intel/" \
   --enable-fortran
so I suspect you need to add --enable-fortran, which seems not to be true by default

Andrea

Re: error when compiling yambo-4.0.0-rev.78

Posted: Sun May 10, 2015 3:50 am
by kjzhang
Dear Andrea,
Thank you for very kind help. :) Refer to your suggestion, I finally installed yambo-4.0.0 successfully.

Thank you again!
Best,
Zhang