Page 1 of 1
Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Fri Jan 03, 2014 7:39 pm
by chem
Dear all
I am new in this forum and I want to install Yambo on Ubuntu server. I found a problem to link it with NetCDF and Etsf-io

.
Is there anyone who successfully compiled the code with the above libraries.
I want to compile the last version (3.3.0rev41) in its parallel version within GNU compilers

.
This post will help people in the future to compile the code without asking questions again arround this problem

.
-HBH-
Re: Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Fri Jan 03, 2014 10:07 pm
by Daniele Varsano
Dear Chem,
please fill your signature with your namer and affiliation, this is a rule of the forum.
Please note that the last gpl version of the code is the 3.4.0, you can find in the devel directory when you do che checkout from the svn repository. Next configure -h will give you the option needed to link with the nectdf:
Code: Select all
--with-netcdf-include=<path>
Path of the NetCDF include directory
--with-netcdf-lib=<path>
Path of the NetCDF lib directory
--with-netcdf-link=<path>
Specify libs needed by NetCDF or NetCDF/HDF5
Be sure to compile yambo and the netcdf with the same compiler.
If you do not succeed please post the problem, together with the confog.log file. Try also to look in the forum if you find something useful for your compilation. Unfortunately, different problem arose with the netcdf depending on compiler and netcdf release, so it is not easy to provide a recipe that works for everybody.
Best,
Daniele
Re: Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Tue Jan 07, 2014 3:59 pm
by chem
Dear Daniele
When Compiling YAMBO 3.4.0 downloaded from SVN repository with the configure options :
Code: Select all
./configure --enable-netcdf-hdf5 --enable-netcdf-LFS --enable-open-mp --with-netcdf-lib=/usr/lib --with-netcdf-include=/usr/include
I get the following error :
Code: Select all
>>>[Making modules]<<<
make[1]: Entering directory `/root/YaMbo/devel/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_electrons.F mod_wave_func.F mod_matrix_operate.F mod_D_lattice.F mod_frequency.F mod_vec_operate.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_ELPH.F mod_xc_functionals.F mod_global_XC.F mod_KERR.F mod_X_output.F std_presets.F ar: creating libmodules.a
ar: mod_pars.o: No such file or directory
make[1]: *** [arcreate] Error 1
make[1]: Leaving directory `/root/YaMbo/devel/src/modules'
make: *** [yambo] Error 2
whereas in the making step of libxc it always appears :
libtool: ignoring unknown tag F77
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT libxc_la-special_functions.lo -MD -MP -MF .deps/libxc_la-special_functions.Tpo -c special_functions.c -o libxc_la-special_functions.o
knowing that :the /usr/lib contains :
Code: Select all
libnetcdf.a libnetcdf_c++.so.5 libnetcdff.so libnetcdf.so
libnetcdf_c++.a libnetcdf_c++.so.5.0.0 libnetcdff.so.5 libnetcdf.so.6
libnetcdf_c++.so libnetcdff.a libnetcdff.so.5.0.0 libnetcdf.so.6.0.0
and the directory /usr/include contains :
Code: Select all
netcdfcpp.h netcdf.h netcdf.hh netcdf.inc netcdf.mod
I attached here my config.log file.
Hichem Ben Hamed
Faculty of Sciences of Tunis
hichembhd@gmail.com
Re: Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Tue Jan 07, 2014 4:59 pm
by Davide Sangalli
Dear Hichem,
the erorr you find is related to the --enable-open-mp option.
I do not think the open-mp implementation is working in the last gpl version, thus I would suggest to compile without such option.
Anyway, in case you really need to test the open-mp compilation you should modufy the "configure" file in the main dir. (This should fix the compilation, no idea if the code will run properly...)
Try to replace at line 5540
Code: Select all
if test x"$enable_open_mp" = "xyes"; then
OPENMPLIBS="-openmp -lpthread";
openmp_cpp="-D_OPENMP"
fi
with
Code: Select all
if test x"$enable_open_mp" = "xyes"; then
#
if test x"$ac_compiler_gnu" = x"yes"; then
OPENMPLIBS="-fopenmp -lpthread";
else
OPENMPLIBS="-openmp -lpthread";
fi
openmp_cpp="-D_OPENMP"
#
fi
Davide
Re: Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Wed Jan 08, 2014 11:23 am
by chem
Dear Davide
I am very grateful to your help but I think the problem is related to the link with NETCDF. I tried to compile without the openmp:
Code: Select all
./configure --enable-netcdf-hdf5 --enable-netcdf-LFS --with-netcdf-lib=/usr/lib --with-netcdf-include=/usr/include
I got the error :
Code: Select all
io_bulk.f90:(.text+0x3e98): undefined reference to `__netcdf_MOD_nf90_get_var_2d_fourbytereal'
io_bulk.f90:(.text+0x3fb1): undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbytereal'
io_bulk.f90:(.text+0x41c9): undefined reference to `__netcdf_MOD_nf90_inq_varid'
/root/YaMbo/devel/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_netcdf_call.part.0':
mod_IO.f90:(.text+0x88): undefined reference to `__netcdf_MOD_nf90_strerror'
/root/YaMbo/devel/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_variable_is_found':
mod_IO.f90:(.text+0x1f4): undefined reference to `__netcdf_MOD_nf90_inq_varid'
mod_IO.f90:(.text+0x21a): undefined reference to `__netcdf_MOD_nf90_inq_varid'
/root/YaMbo/devel/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_netcdf_dim':
mod_IO.f90:(.text+0x30a): undefined reference to `__netcdf_MOD_nf90_inq_dimid'
mod_IO.f90:(.text+0x349): undefined reference to `__netcdf_MOD_nf90_def_dim'
/root/YaMbo/devel/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_file_is_open':
mod_IO.f90:(.text+0x45d): undefined reference to `__netcdf_MOD_nf90_inquire'
/root/YaMbo/devel/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_io_disconnect':
mod_IO.f90:(.text+0x1f33): undefined reference to `__netcdf_MOD_nf90_close'
/root/YaMbo/devel/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_io_connect':
mod_IO.f90:(.text+0x3635): undefined reference to `__netcdf_MOD_nf90_open'
mod_IO.f90:(.text+0x3940): undefined reference to `__netcdf_MOD_nf90_open'
mod_IO.f90:(.text+0x4149): undefined reference to `__netcdf_MOD_nf90_create'
mod_IO.f90:(.text+0x41a1): undefined reference to `__netcdf_MOD_nf90_enddef'
mod_IO.f90:(.text+0x46f0): undefined reference to `__netcdf_MOD_nf90_create'
mod_IO.f90:(.text+0x4748): undefined reference to `__netcdf_MOD_nf90_enddef'
collect2: ld returned 1 exit status
make[1]: *** [yambo] Error 1
make[1]: Leaving directory `/root/YaMbo/devel/driver'
make: *** [yambo] Error 2
I attached again the new config.log without using openmp
Hichem Ben Hamed
Faculty of Sciences of Tunis
hichembhd@gmail.com
Re: Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Wed Jan 08, 2014 11:56 am
by Davide Sangalli
Dear Hichem,
the error message you were getting before was due to the --enable-open-mp option, which was preventing yambo from compiling.
Now yambo starts the compilation procedure and you are getting a different message, which is related to the netcdf libs.
In particulare the netcdf-4 libs are based on the hdf5 libs. Thus if you need to have both the netcdf and the hdf5 installed and you need to link them both.
First, on ubuntu, try installing the following packages:
libcurl4-openssl-dev
libhdf5-openmpi-dev
libnetcdf-dev
zlib1g-dev
Moreover you need to link then. When you run the configure try to use the option:
--with-netcdf-link="-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz"
Regards,
Davide
Re: Recipe to compile YAMBO linked with NETCDF on UBUNTU.
Posted: Wed Jan 08, 2014 3:03 pm
by chem
Many Thanks Davide
That solved the problem.So I summarize : To install Yambo with NETCDF on ubuntu one have to do :
Code: Select all
apt-get -y install gcc g++ gfortran libtool fftw3 libfftw3-dev liblapack3gf liblapack-dev libblas3gf libblas-dev openmpi-bin openmpi-common libopenmpi-dev libcurl4-openssl-dev libhdf5-openmpi-dev zlib1g-dev
launch the configure step with :
Code: Select all
./configure --enable-netcdf-hdf5 --enable-netcdf-LFS --with-netcdf-lib=/usr/lib --with-netcdf-include=/usr/include --with-netcdf-link=-lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
good luck.
Hichem Ben Hamed
Faculty of Sciences of Tunis
hichembhd@gmail.com