Can't open module file ‘netcdf.mod’

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
burkzdemir
Posts: 91
Joined: Tue Sep 09, 2014 7:57 pm

Can't open module file ‘netcdf.mod’

Post by burkzdemir » Wed Oct 13, 2021 2:11 pm

Dear developers,

I am getting an error during compilation. Error is below and I attached my config file.

mod_pars.f90:28:5:

use netcdf
1
Fatal Error: Can't open module file ‘netcdf.mod’ for reading at (1): No such file or directory
compilation terminated.
Makefile:176: recipe for target 'mod_pars.o' failed

Best,
Burak
You do not have the required permissions to view the files attached to this post.
Burak Ozdemir
Post-doc,
University of Nantes, France

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

Re: Can't open module file ‘netcdf.mod’

Post by Daniele Varsano » Wed Oct 13, 2021 2:33 pm

Dear Burak,

the error is due to a fail in the internal compilation of the netcdf library.
You can have a look to these threads:

viewtopic.php?f=1&t=2021&p=10466&hilit= ... f90#p10466
viewtopic.php?f=1&t=1966&p=10021&hilit= ... f90#p10021

Best,
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/

burkzdemir
Posts: 91
Joined: Tue Sep 09, 2014 7:57 pm

Re: Can't open module file ‘netcdf.mod’

Post by burkzdemir » Wed Oct 13, 2021 3:14 pm

I tried to make netcdf as suggested in the forum and I obtained this error:

checking for gcc... mpicc
checking whether the C compiler works... no
configure: error: in `/home/bozdemir@ltn.polytech.univ-nantes.prive/Downloads/yambo-master/lib/netcdf/netcdf-c-4.7.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:43: recipe for target 'configure-stamp' failed
make[1]: *** [configure-stamp] Error 77
make[1]: Leaving directory '/home/bozdemir@ltn.polytech.univ-nantes.prive/Downloads/yambo-master/lib/netcdf'
config/mk/actions/compile_external_libraries.mk:36: recipe for target 'netcdf' failed
make: *** [netcdf] Error 2

Burak
Burak Ozdemir
Post-doc,
University of Nantes, France

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

Re: Can't open module file ‘netcdf.mod’

Post by Daniele Varsano » Wed Oct 13, 2021 3:51 pm

Dear Burak,
it seems your C compiler is not working properly, can you compile other codes in C?
please check that your compiler is installed properly.
You can send the config.log file found in the netcdf directory:
/yambo-master/lib/netcdf/netcdf-c-4.7.4'

in order to see if it is possible to understand what is going wrong.

Best,
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/

burkzdemir
Posts: 91
Joined: Tue Sep 09, 2014 7:57 pm

Re: Can't open module file ‘netcdf.mod’

Post by burkzdemir » Thu Oct 14, 2021 12:12 pm

Yes, I can compile c programs. I attached the config file.

Best,
Burak
You do not have the required permissions to view the files attached to this post.
Burak Ozdemir
Post-doc,
University of Nantes, France

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

Re: Can't open module file ‘netcdf.mod’

Post by Daniele Varsano » Fri Oct 15, 2021 8:18 am

Dear Burak,

this happens because the hdf5 library should be compiled before compiling netcdf.
Best,

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/

burkzdemir
Posts: 91
Joined: Tue Sep 09, 2014 7:57 pm

Re: Can't open module file ‘netcdf.mod’

Post by burkzdemir » Fri Oct 15, 2021 10:38 am

Dear Daniele,

I compiled hdf5 and then I tried to compile netcdf but this time I got this error:

configure: error: Can't find or link to the z library. Turn off netCDF-4 and DAP clients with --disable-netcdf-4 --disable-dap, or see config.log for errors.

Best,
Burak Ozdemir
Post-doc,
University of Nantes, France

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

Re: Can't open module file ‘netcdf.mod’

Post by Daniele Varsano » Fri Oct 15, 2021 11:59 am

Dear Burak,

probably it is a matter of CPPFLAGS and LDFLAGS which are not pointing to the hdf5 libs.
See e.g here:
https://www.unidata.ucar.edu/support/he ... 12453.html

You can try to reconfigure yambo (now hdf5 should be detected) and recompile.

Best,

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/

andrea.ferretti
Posts: 206
Joined: Fri Jan 31, 2014 11:13 am

Re: Can't open module file ‘netcdf.mod’

Post by andrea.ferretti » Sat Oct 16, 2021 11:15 am

Dear Burak,

indeed, in some cases I had to compile zlib by myself (not too difficult, actually).
Once that is in the path, I used the following flags to compile hdf5:

Code: Select all

./configure \
   --prefix="/opt/hdf5/1.8.19-gnu/" \
   --enable-parallel \
   --enable-fortran \
   --enable-fortran2003 \
   FC=mpif90 \
   CC=mpicc \
   CXX=mpic++ \
   CPP="gcc -E"

HTH
Andrea
Andrea Ferretti, PhD
CNR-NANO-S3 and MaX Centre
via Campi 213/A, 41125, Modena, Italy
Tel: +39 059 2055322; Skype: andrea_ferretti
URL: http://www.nano.cnr.it

hosein
Posts: 6
Joined: Sat Apr 15, 2023 3:22 am

Re: Can't open module file ‘netcdf.mod’

Post by hosein » Sun Apr 23, 2023 9:40 am

yambo-code.org doesn't exist
and you In the forum refer errors to an address that does not exist
Thank you for your time
hosein hojjati
PhD student in condensed matter physics
Malayer State University
https://www.malayeru.ac.ir/portal/home/

Post Reply