bug message reminder

When adressing a model crash or bug, please remember to include an entire model setup in your post that reproduces the crash or exposes the bug. Also add the XBlog.txt file. This is necessary information for people that are trying to help you. Including your model setup can be achieved by adding the zipped run directory (excluding output) as an attachment to the post.

Forum

RE: Unable to locate 'netcdf.mod' while compiling in Ubuntu 12.04 (64)

CB
Cüneyt Baykal, modified 4 Years ago.

Unable to locate 'netcdf.mod' while compiling in Ubuntu 12.04 (64)

Wind Posts: 37 Join Date: 4/8/15 Recent Posts
Hi all,
I am trying to set a compiling environment for the xbeach in my pc, and windows did not work for me for now. So trying ubuntu now.
I get the following error when I type 'make' in terminal in Ubuntu 12.04 64 bit for xbeach ver.4693.


....
PPFC libxbeach_la-varoutput.lo
PPFC libxbeach_la-ncoutput.lo
ncoutput.F90:49.13:
use netcdf
1
Fatal Error: Can't open module file 'netcdf.mod' for reading at (1): No such file or directory
make[4]: *** [libxbeach_la-ncoutput.lo] Error 1
make[4]: Leaving directory `/home/cbaykal/xbeach/trunk/src/xbeachlibrary'
.. and couple of more error messages


I found the netcdf.mod in /trunk/lib/x64/...,
after I copied that file into the trunk and src folders I get the following.


Fatal Error: File 'netcdf.mod' opened at (1) is not a GFORTRAN module file


Development kit for NetCDF (libnetcdf-dev) which is supposed to include all fortran related tools for netcdf is already installed.
Thanks again, best regards
JD
Joost den Bieman, modified 4 Years ago.

RE: Unable to locate 'netcdf.mod' while compiling in Ubuntu 12.04 (64) (Answer)

Wind Posts: 96 Join Date: 9/21/12 Recent Posts
Hi Cüneyt,

To be able to compile XBeach on a linux environment, all of its dependencies need to be installed first.
On our Linux machines, we currently use:

- gcc 4.9.2
- hdf5 1.8.14
- netcdf 4.4.0
- openmpi 1.8.3

Make sure you have these installed before compiling (maybe your netcdf is a different version? anyway there is no need to copy netcdf.mod).

Then before compiling you just need to run autogen.sh and configure (with your desired options), and then start compiling.

Hope this helps,
Cheers,

Joost
CB
Cüneyt Baykal, modified 4 Years ago.

RE: Unable to locate 'netcdf.mod' while compiling in Ubuntu 12.04 (64)

Wind Posts: 37 Join Date: 4/8/15 Recent Posts
Great.. thanks a lot, right ingredients were needed.. I'll try and inform about progress.
Best
CB
Cüneyt Baykal, modified 4 Years ago.

RE: Unable to locate 'netcdf.mod' while compiling in Ubuntu 12.04 (64)

Wind Posts: 37 Join Date: 4/8/15 Recent Posts
For now.. I could not install hdf 1.8.14 and netcdf 4.4.0 for ubuntu 14.04. I guess that have to try CentOS.
SF
Scott Feister, modified 28 Days ago.

RE: Unable to locate 'netcdf.mod' while compiling in Ubuntu 12.04 (64)

Capillary Posts: 1 Join Date: 10/11/19 Recent Posts
For anyone still struggling with this issue in 2019, I will write a good solution. As of Ubuntu 18.04.3 LTS, at least, downloading NetCDF using typical package manager results in the netcdf.mod file being located within /usr/include. Here's how I downloaded NetCDF:

sudo apt install libnetcdf-dev libnetcdff-dev

While many dependencies within Ubuntu are stored in /usr/include, I don't think that's the conventional place for many Unix systems (I've run into the issue elsewhere -- and I think /usr/local/include is the more commonly expected place). So, when I went to compile XBeach, I ran into the same issue as the person posting.

I solved the issue by adding the "-I/user/include" to my FCFLAGS environment variable prior to calling ./configure. For example:

FCFLAGS="-funroll-loops --param max-unroll-times=4 -ffree-line-length-none -O3 -ffast-math -I/usr/include" ./configure  --with-netcdf --with-mpi

This modification tells the Fortran compiler to also look for dependencies in /usr/include. After this fix, the compilation went forward without a hitch.

-Scott Feister, California State University Channel Islands