landreman/regcoil

compilation fail while reading netcdf file

Closed this issue · 2 comments

Hi,

I was trying to build this software with make. But I run into the following error:

$ make
make -C mini_libstell
make[1]: Entering directory '/home/user/wsp/regcoil/mini_libstell'
mpif90 -fopenmp -I/usr/local/include -ffree-line-length-none -O0 -g -fallow-argument-mismatch -DNETCDF -c ezcdf_opncls.f90
ezcdf_opncls.f90:37: Error: Can't open included file 'netcdf.inc'
make[1]: *** [makefile:15: ezcdf_opncls.o] Error 1
make[1]: Leaving directory '/home/user/wsp/regcoil/mini_libstell'

I have installed libnetcdff-dev and netcdf-bin. Is there some other required library?

Thanks for the help

Hi, first I'd check that netcdf.inc does exist on your system. Looking at apt-browse, it's likely in /usr/include/. Then, it is probably necessary to modify EXTRA_COMPILE_FLAGS in the makefile to include -I /usr/include or whatever the appropriate directory is. In the makefile where it has cases for different HOSTNAMEs, you could either add a case for your system, or edit an existing case. You may find it useful to run make test_make to print out some of the variables in the makefile.

Thanks for your answer. The -I /usr/include was indeed necessary. I also needed to do some extra correction as follows:

  EXTRA_COMPILE_FLAGS = -fopenmp -I/usr/local/include -ffree-line-length-none -O0 -g -fallow-argument-mismatch -I /usr/include
  EXTRA_LINK_FLAGS =  -fopenmp -L/usr/local/lib -lnetcdff  -lnetcdf -llapack  -lblas