Page 1 of 2

Can't open module file ‘netcdf.mod’

Posted: Wed Oct 13, 2021 2:11 pm
by burkzdemir
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

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

Posted: Wed Oct 13, 2021 2:33 pm
by Daniele Varsano
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

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

Posted: Wed Oct 13, 2021 3:14 pm
by burkzdemir
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

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

Posted: Wed Oct 13, 2021 3:51 pm
by Daniele Varsano
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

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

Posted: Thu Oct 14, 2021 12:12 pm
by burkzdemir
Yes, I can compile c programs. I attached the config file.

Best,
Burak

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

Posted: Fri Oct 15, 2021 8:18 am
by Daniele Varsano
Dear Burak,

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

Daniele

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

Posted: Fri Oct 15, 2021 10:38 am
by burkzdemir
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,

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

Posted: Fri Oct 15, 2021 11:59 am
by Daniele Varsano
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

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

Posted: Sat Oct 16, 2021 11:15 am
by andrea.ferretti
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

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

Posted: Sun Apr 23, 2023 9:40 am
by hosein
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