Linking with NETCDF

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
mpayami
Posts: 7
Joined: Sun Oct 24, 2010 2:57 am

Re: Linking with NETCDF

Post by mpayami » Thu Apr 28, 2011 11:23 am

Dear Claudio,

Thank you so much.
mahmoud

Mahmoud Payami
Physics Group, AEOI, Tehran, Iran

User avatar
claudio
Posts: 456
Joined: Tue Mar 31, 2009 11:33 pm
Location: Marseille
Contact:

Re: Linking with NETCDF

Post by claudio » Mon May 23, 2011 4:54 pm

Dear all

we fixed some configuration problem with NetCDF 4.1.2 in the new Yambo version 3.2.4, please download it

http://www.yambo-code.org/download.php

and check if it solves your compilation problems.

regards
Claudio
Claudio Attaccalite
[CNRS/ Aix-Marseille Université/ CINaM laborarory / TSN department
Campus de Luminy – Case 913
13288 MARSEILLE Cedex 09
web site: http://www.attaccalite.com

a.marani
Posts: 2
Joined: Wed Apr 18, 2012 11:25 am

Re: Linking with NETCDF

Post by a.marani » Wed Apr 18, 2012 1:01 pm

Dear Yambo support,

I'm trying to compile Yambo with netcdf built from hdf5. I think it may be useful for me to visit the page linked on your guide, about how to use the flag --with-netcdf-link=... . However, it looks like that page (http://mailman.unidata.ucar.edu/softwar ... Flags.html) isn't online anymore.

Can somebody explain me what was its content and what should i use that flag for?

Many thanks,
Marani Alessandro (CINECA, Italy)

User avatar
myrta gruning
Posts: 240
Joined: Tue Mar 17, 2009 11:38 am
Contact:

Re: Linking with NETCDF

Post by myrta gruning » Wed Apr 18, 2012 1:13 pm

Dear Alessandro

in my case I used
--with-netcdf-link='$NETCDFLINK'
with
NETCDFLINK='-lnetcdff -lnetcdf -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lz '

but I am not sure this is general, it probably depends on netcdf/hdf5 are compiled and on the architecture.

m
Dr Myrta Grüning
School of Mathematics and Physics
Queen's University Belfast - Northern Ireland

http://www.researcherid.com/rid/B-1515-2009

User avatar
claudio
Posts: 456
Joined: Tue Mar 31, 2009 11:33 pm
Location: Marseille
Contact:

Re: Linking with NETCDF

Post by claudio » Thu Apr 19, 2012 11:01 am

Dear Alessandro

if you have properly installed NetCDF you can get the NETCDFLINK variable doing

nc-config --libs

notice that you are compiling yambo in a cluster you should load the NetCDF module before doing nc-config.

Claudio
Claudio Attaccalite
[CNRS/ Aix-Marseille Université/ CINaM laborarory / TSN department
Campus de Luminy – Case 913
13288 MARSEILLE Cedex 09
web site: http://www.attaccalite.com

a.marani
Posts: 2
Joined: Wed Apr 18, 2012 11:25 am

Re: Linking with NETCDF

Post by a.marani » Tue Apr 24, 2012 11:32 am

Thank you everybody,
my correct netcdf-link options were: -lnetcdf -lnetcdff -lsz -lz -lm
Now the problem is solved!

Alessandro

kopinjol
Posts: 44
Joined: Thu Sep 23, 2010 6:59 pm

Re: Linking with NETCDF

Post by kopinjol » Sun Sep 02, 2012 1:11 am

Hi,

I am running into a similar problem with compiling netcdf-4.1.3. Thr library compiles very well. But when i type make check I get an error.

Here is my configure line:

./configure --prefix=/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3 FC=gfortran44 CC=gcc44 --with-zlib=/home/kbaish2/DFT-GW-Codes/zlib-1.2.7 --disable-dap --disable-netcdf-4

And Here is the error message I get:

make[1]: Entering directory `/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test'
make nf_test tst_f77_v2 ftest tst_f90
make[2]: Entering directory `/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test'
/bin/sh ../libtool --tag=F77 --mode=link gfortran44 -I../fortran -I../include -I../f90 -g -O2 -L/home/kbaish2/DFT-GW-Codes/hdf5-1.8.9/lib -o nf_test test_get.o test_put.o nf_error.o nf_test.o test_read.o test_write.o util.o fortlib.o ../fortran/libnetcdff.la -lm -lcurl
libtool: link: gfortran44 -I../fortran -I../include -I../f90 -g -O2 -o .libs/nf_test test_get.o test_put.o nf_error.o nf_test.o test_read.o test_write.o util.o fortlib.o -L/home/kbaish2/DFT-GW-Codes/hdf5-1.8.9/lib ../fortran/.libs/libnetcdff.so /home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/liblib/.libs/libnetcdf.so -lm -lcurl -Wl,-rpath -Wl,/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/lib
test_get.o: In function `test_nf_get_att_double_':
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5511: undefined reference to `nf_open_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5521: undefined reference to `nf_get_att_double_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5526: undefined reference to `nf_get_att_double_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5529: undefined reference to `nf_get_att_double_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5547: undefined reference to `nf_get_att_double_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5594: undefined reference to `nf_close_'
test_get.o: In function `test_nf_get_att_real_':
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5403: undefined reference to `nf_open_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5413: undefined reference to `nf_get_att_real_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5418: undefined reference to `nf_get_att_real_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5421: undefined reference to `nf_get_att_real_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5439: undefined reference to `nf_get_att_real_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5486: undefined reference to `nf_close_'
test_get.o: In function `test_nf_get_att_int_':
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5295: undefined reference to `nf_open_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5305: undefined reference to `nf_get_att_int_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5310: undefined reference to `nf_get_att_int_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5313: undefined reference to `nf_get_att_int_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5331: undefined reference to `nf_get_att_int_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5378: undefined reference to `nf_close_'
test_get.o: In function `test_nf_get_att_int2_':
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5186: undefined reference to `nf_open_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5196: undefined reference to `nf_get_att_int2_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5201: undefined reference to `nf_get_att_int2_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5204: undefined reference to `nf_get_att_int2_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5222: undefined reference to `nf_get_att_int2_'
/home/kbaish2/DFT-GW-Codes/netcdf-4.1.3/nf_test/test_get.F:5269: undefined reference to `nf_close_'
test_get.o: In function `test_nf_get_att_int1_':


I have also checked that I have used same compilers for hdf5 and netcdf.4.1.3 and the compilers are the same gcc44 and gfortran44.

I would really appreciate any help.

Thanks in advance.
kopinjol
Kopinjol Baishya
Graduate Student,
Materials Modeling Group
Deptt of Physics,
University of Illinois,
Chicago,
IL 60607

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

Re: Linking with NETCDF

Post by Daniele Varsano » Sun Sep 02, 2012 8:21 pm

Dear Kopinjol,
the error you are experiencing is in the compilation of the netcdf library and not in linking netcdf to yambo.
There are in the web several forum about netcdf compilation, for instances just typing in google: "undefined reference to `nf_open_'"
you can find several information that can useful to solve your problem.
Anyway, did you type make install, before the make check?
I suspect it is a just a path problem when linking the netcdf library.

Cheers,

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/

kopinjol
Posts: 44
Joined: Thu Sep 23, 2010 6:59 pm

Re: Linking with NETCDF

Post by kopinjol » Sun Sep 02, 2012 10:04 pm

Hello Daniele,

Thanks for the reply. I tried as you suggested, by typing make install before make check. But I still get the same error. I did look at the google results, but I think i'll just post in the netcdf forum. In any case, I was just wondering if anyone had any idea as to what might be going wrong! I am using CC=gcc44, FC=gcc44. Interestingly, if i do along with thesze, CXX=gcc44 , I get an error while compiling, i.e make gives me an error.

Anyway thanks for the reply again. I will check with the netcdf guys and see what they say.

Cheers,
kopinjo,l
Kopinjol Baishya
Graduate Student,
Materials Modeling Group
Deptt of Physics,
University of Illinois,
Chicago,
IL 60607

kopinjol
Posts: 44
Joined: Thu Sep 23, 2010 6:59 pm

Re: Linking with NETCDF

Post by kopinjol » Wed Sep 05, 2012 6:31 pm

Hi everyone,

I was able to compile netcdf-4.1.3 after talking to the unidata guys. I just had to add the flag -DgFortran to CFLAGS. But now I get an error in compiling yambo. The error occurs at the 'linking Yambo' step. These are the error messages,


home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libio.a(io_elemental.o): In function `io_elemental_':
io_elemental.f90:(.text+0xb9a): undefined reference to `__netcdf_MOD_nf90_put_var_fourbyteint'
io_elemental.f90:(.text+0xdc9): undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
io_elemental.f90:(.text+0x10d9): undefined reference to `__netcdf_MOD_nf90_put_var_eightbytereal'
io_elemental.f90:(.text+0x1385): undefined reference to `__netcdf_MOD_nf90_put_var_1d_eightbytereal'
io_elemental.f90:(.text+0x175c): undefined reference to `__netcdf_MOD_nf90_put_var_fourbyteint'
io_elemental.f90:(.text+0x1a6b): undefined reference to `__netcdf_MOD_nf90_put_var_1d_text'
io_elemental.f90:(.text+0x1f19): undefined reference to `__netcdf_MOD_nf90_redef'
io_elemental.f90:(.text+0x1ff1): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
io_elemental.f90:(.text+0x201f): undefined reference to `__netcdf_MOD_nf90_enddef'
io_elemental.f90:(.text+0x23a5): undefined reference to `__netcdf_MOD_nf90_get_var_fourbyteint'
io_elemental.f90:(.text+0x286f): undefined reference to `__netcdf_MOD_nf90_get_var_1d_text'
io_elemental.f90:(.text+0x2b99): undefined reference to `__netcdf_MOD_nf90_inq_varid'
io_elemental.f90:(.text+0x2c98): undefined reference to `__netcdf_MOD_nf90_get_var_fourbyteint'
io_elemental.f90:(.text+0x3065): undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
io_elemental.f90:(.text+0x33c5): undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbyteint'
io_elemental.f90:(.text+0x3645): undefined reference to `__netcdf_MOD_nf90_get_var_eightbytereal'
io_elemental.f90:(.text+0x3dce): undefined reference to `__netcdf_MOD_nf90_def_var_onedim'
io_elemental.f90:(.text+0x49a5): undefined reference to `__netcdf_MOD_nf90_def_var_onedim'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libio.a(io_bulk.o): In function `io_bulk_':
io_bulk.f90:(.text+0x695): undefined reference to `__netcdf_MOD_nf90_put_var_fourbyteint'
io_bulk.f90:(.text+0x7bb): undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
io_bulk.f90:(.text+0x919): undefined reference to `__netcdf_MOD_nf90_put_var_2d_fourbyteint'
io_bulk.f90:(.text+0xb2f): undefined reference to `__netcdf_MOD_nf90_put_var_3d_fourbyteint'
io_bulk.f90:(.text+0xd17): undefined reference to `__netcdf_MOD_nf90_put_var_1d_onebyteint'
io_bulk.f90:(.text+0xea3): undefined reference to `__netcdf_MOD_nf90_put_var_3d_eightbytereal'
io_bulk.f90:(.text+0x102b): undefined reference to `__netcdf_MOD_nf90_put_var_eightbytereal'
io_bulk.f90:(.text+0x1152): undefined reference to `__netcdf_MOD_nf90_put_var_1d_eightbytereal'
io_bulk.f90:(.text+0x12b5): undefined reference to `__netcdf_MOD_nf90_put_var_2d_eightbytereal'
io_bulk.f90:(.text+0x14c2): undefined reference to `__netcdf_MOD_nf90_put_var_3d_eightbytereal'
io_bulk.f90:(.text+0x2a32): undefined reference to `__netcdf_MOD_nf90_redef'
io_bulk.f90:(.text+0x2be9): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
io_bulk.f90:(.text+0x2c20): undefined reference to `__netcdf_MOD_nf90_enddef'
io_bulk.f90:(.text+0x2e5b): undefined reference to `__netcdf_MOD_nf90_get_var_3d_eightbytereal'
io_bulk.f90:(.text+0x2fa2): undefined reference to `__netcdf_MOD_nf90_get_var_2d_eightbytereal'
io_bulk.f90:(.text+0x30b6): undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
io_bulk.f90:(.text+0x3175): undefined reference to `__netcdf_MOD_nf90_get_var_fourbyteint'
io_bulk.f90:(.text+0x328e): undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbyteint'
io_bulk.f90:(.text+0x33d5): undefined reference to `__netcdf_MOD_nf90_get_var_2d_fourbyteint'
io_bulk.f90:(.text+0x3546): undefined reference to `__netcdf_MOD_nf90_get_var_3d_fourbyteint'
io_bulk.f90:(.text+0x365e): undefined reference to `__netcdf_MOD_nf90_get_var_1d_onebyteint'
io_bulk.f90:(.text+0x37df): undefined reference to `__netcdf_MOD_nf90_get_var_3d_onebyteint'
io_bulk.f90:(.text+0x3893): undefined reference to `__netcdf_MOD_nf90_get_var_eightbytereal'
io_bulk.f90:(.text+0x3974): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
io_bulk.f90:(.text+0x3aa2): undefined reference to `__netcdf_MOD_nf90_get_var_2d_eightbytereal'
io_bulk.f90:(.text+0x3c00): undefined reference to `__netcdf_MOD_nf90_get_var_3d_onebyteint'
io_bulk.f90:(.text+0x3d55): undefined reference to `__netcdf_MOD_nf90_put_var_3d_eightbytereal'
io_bulk.f90:(.text+0x3e84): undefined reference to `__netcdf_MOD_nf90_put_var_2d_eightbytereal'
io_bulk.f90:(.text+0x3fe9): undefined reference to `__netcdf_MOD_nf90_put_var_3d_onebyteint'
io_bulk.f90:(.text+0x4031): undefined reference to `__netcdf_MOD_nf90_inq_varid'
io_bulk.f90:(.text+0x418d): undefined reference to `__netcdf_MOD_nf90_get_var_3d_eightbytereal'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_file_is_open':
mod_IO.f90:(.text+0x1165): undefined reference to `__netcdf_MOD_nf90_inquire'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_netcdf_call':
mod_IO.f90:(.text+0x1285): undefined reference to `__netcdf_MOD_nf90_strerror'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_netcdf_dim':
mod_IO.f90:(.text+0x141f): undefined reference to `__netcdf_MOD_nf90_inq_dimid'
mod_IO.f90:(.text+0x1443): undefined reference to `__netcdf_MOD_nf90_def_dim'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_variable_is_found':
mod_IO.f90:(.text+0x14ab): undefined reference to `__netcdf_MOD_nf90_inq_varid'
mod_IO.f90:(.text+0x14ce): undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_file_is_open.clone.0':
mod_IO.f90:(.text+0x1605): undefined reference to `__netcdf_MOD_nf90_inquire'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_io_disconnect':
mod_IO.f90:(.text+0x171c): undefined reference to `__netcdf_MOD_nf90_close'
/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/lib/libmodules.a(mod_IO.o): In function `__io_m_MOD_io_connect':
mod_IO.f90:(.text+0x3367): undefined reference to `__netcdf_MOD_nf90_open'
mod_IO.f90:(.text+0x38bc): undefined reference to `__netcdf_MOD_nf90_open'
mod_IO.f90:(.text+0x3d95): undefined reference to `__netcdf_MOD_nf90_create'
mod_IO.f90:(.text+0x3ddf): undefined reference to `__netcdf_MOD_nf90_enddef'
mod_IO.f90:(.text+0x3fd8): undefined reference to `__netcdf_MOD_nf90_create'
mod_IO.f90:(.text+0x4024): undefined reference to `__netcdf_MOD_nf90_enddef'
collect2: ld returned 1 exit status
make[1]: *** [yambo] Error 1
make[1]: Leaving directory `/home/kbaish2/DFT-GW-Codes/Yambo/yambo-3.2.5/driver'
make: *** [yambo] Error 2


I ran configure with the --enable-msgs-comps flag and saved the output in CONFIG.LOG and ran make all the output of which is in MAKE.LOG. The two files are attached as a tar archive named FILES.tar. I would really appreciate any help regarding this.

Thanks in advance,
kopinjol
You do not have the required permissions to view the files attached to this post.
Kopinjol Baishya
Graduate Student,
Materials Modeling Group
Deptt of Physics,
University of Illinois,
Chicago,
IL 60607

Post Reply