Error in compiling the wrfhydro V5.0.03

338 views
Skip to first unread message

Somaye Imani

unread,
Jul 19, 2020, 4:26:06 AM7/19/20
to wrf-hydro_users

Hi.

I am trying to compile wrf_hydro_nwm_public-5.0.3, yet i get "make NOT successful" each time I try. I have already read posted questions regarding this issue but still I have not been able to fix it.

Here are specifications of machine which I'm using to compile it:

  • OS: Ubuntu 16.04
  • Install Directory: ~/Desktop/WrfHydro/wrf_hydro_nwm_public-5.0.3/trunk/NDHMS$
  • NetCDF Version 4.6.2 with following properties:
    • --cc -> x86_64-conda_cos6-linux-gnu-cc
    • --cflags -> -I/home/s1/miniconda3/envs/gsshapy/include
    • --libs -> -L/home/s1/miniconda3/envs/gsshapy/lib -lnetcdf -lmfhdf -ldf -lhdf5_hl -lhdf5 -lrt -lpthread -lz -ldl -lm -lcurl
    • --has-c++ -> no
    • --cxx ->
    • --has-c++4 -> no
    • --cxx4 ->
    • --has-fortran -> yes
    • --fc -> gfortran


    • --fflags -> -I/usr/local/include

    • --flibs -> -L/usr/local/lib -lnetcdff -L/usr/local/lib -lnetcdf -lnetcdf

    • --has-f90 -> no

    • --has-f03 -> yes


    • --has-dap -> yes

    • --has-dap2 -> yes

    • --has-dap4 -> yes

    • --has-nc2 -> yes

    • --has-nc4 -> yes

    • --has-hdf5 -> yes

    • --has-hdf4 -> yes

    • --has-logging -> no

    • --has-pnetcdf -> no

    • --has-szlib -> no

    • --has-cdf5 -> yes

    • --has-parallel4 -> no

    • --has-parallel -> no


    • --prefix -> /home/s1/miniconda3/envs/gsshapy

    • --includedir -> /home/s1/miniconda3/envs/gsshapy/include

    • --libdir -> /home/s1/miniconda3/envs/gsshapy/lib

    • --version -> netCDF 4.6.2

  • GNU Fortran (Ubuntu 9.2.1-17ubuntu1~16.04) 9.2.1 20191102
  • GNU Make 4.1 Built for x86_64-pc-linux-gnu
  • mpirun
    • Hydra build version 3.2
    • CC -> gcc
    • CXX -> g++
    • F77 -> gfortran
    • F90 -> gfortran
    • configure option: '--disable-option-checking' '--prefix=/usr' '--build=x86_64-linux-gnu' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--disable-dependency-tracking' '--enable-shared' '--enable-fortran=all' '--disable-rpath' '--disable-wrapper-rpath' '--sysconfdir=/etc/mpich' '--libdir=/usr/lib/x86_64-linux-gnu' '--includedir=/usr/include/mpich' '--docdir=/usr/share/doc/mpich' '--with-hwloc-prefix=system' '--enable-checkpointing' '--with-hydra-ckpointlib=blcr' 'CPPFLAGS= -Wdate-time -D_FORTIFY_SOURCE=2 -I/build/mpich-jQtQ8p/mpich-3.2/src/mpl/include -I/build/mpich-jQtQ8p/mpich-3.2/src/mpl/include -I/build/mpich-jQtQ8p/mpich-3.2/src/openpa/src -I/build/mpich-jQtQ8p/mpich-3.2/src/openpa/src -D_REENTRANT -I/build/mpich-jQtQ8p/mpich-3.2/src/mpi/romio/include' 'CFLAGS= -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -O2' 'CXXFLAGS= -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -O2' 'FFLAGS= -g -O2 -fstack-protector-strong -O2' 'FCFLAGS= -g -O2 -fstack-protector-strong -O2' 'build_alias=x86_64-linux-gnu' 'MPICHLIB_CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security' 'MPICHLIB_CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'MPICHLIB_CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security' 'MPICHLIB_FFLAGS=-g -O2 -fstack-protector-strong' 'MPICHLIB_FCFLAGS=-g -O2 -fstack-protector-strong' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'FC=gfortran' 'F77=gfortran' 'MPILIBNAME=mpich' '--cache-file=/dev/null' '--srcdir=.' 'CC=gcc' 'LIBS=-lpthread '

I am trying to install using configure option 2(gfortran), I attached log file including errors, here are some examples:

Fatal Error: Cannot open module file ‘netcdf.mod’ for reading at (1): No such file or directory
compilation terminated.

Fatal Error: Cannot open module file ‘module_hydro_io.mod’ for reading at (1): No such file or directory
compilation terminated.

Fatal Error: Cannot open module file ‘module_hydro_io.mod’ for reading at (1): No such file or directory
compilation terminated.

what should i do in order to fix these problems?

logFile.txt

Joachim

unread,
Jul 22, 2020, 10:23:27 AM7/22/20
to wrf-hydro_users
Hi, Somaye

Did you by any chance figure out how to fix the problem? I tried to compile WRF-Hydro in Standalone mode and got the exact same error messages like you.

Best Regards,

Joachim

Katelyn FitzGerald

unread,
Jul 22, 2020, 12:07:36 PM7/22/20
to wrf-hydro_users, Joachim
Hi Somaye and Joachim,

It looks like the model is having trouble finding the netCDF Fortran libraries during the build process.  For builds on version 16.04 of Ubuntu I've had better luck building my own netCDF libraries.

Here are some old build notes from a system w/ Ubuntu 16.04 that might help.  

Install libs:
apt-get update
apt-get install wget bzip2 ca-certificates vim libhdf5-dev gfortran g++ m4 make libswitch-perl git tcsh libopenmpi-dev

export NCDIR=/usr/local 
export NFDIR=/usr/local 
export H5DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial 
export NETCDF_C_VERSION=4.6.3

tar -xf v${NETCDF_C_VERSION}.tar.gz
cd netcdf-c*
CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure --prefix=${NCDIR} --disable-dap
make
make install
cd ..

export LD_LIBRARY_PATH=${NCDIR}/lib
export NETCDF_F_VERSION=4.4.5

tar -xf v${NETCDF_F_VERSION}.tar.gz
cd netcdf-f*
CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib ./configure --prefix=${NFDIR}
make
make install
cd ..

export NETCDF=/usr/local
export HYDRO_VERSION=5.1.2

tar -xzvf v${HYDRO_VERSION}.tar.gz
cd wrf_hydro*/trunk/NDHMS
source template/setEnvar.sh
./configure 
./compile_offline_NoahMP.sh

In newer versions of Ubuntu (e.g. 18.04) the netCDF libraries from the APT seem to work as is so the install process is a bit smoother.  

Hope this helps.

Best,
Katelyn

Pravin Bhasme

unread,
Nov 20, 2020, 6:22:42 AM11/20/20
to wrf-hydro_users, Katelyn FitzGerald, Joachim
Hi Katelyn, Somaye and Joachim,
                 I am getting similar error even after trying installation procedure given in above email. Please find the attachment of error log. It would be great if you can share the installation procedure.

Regards,
Pravin

error_log.txt

qiu shengyuan

unread,
Aug 23, 2025, 1:03:20 PMAug 23
to wrf-hydro_users, Somaye Imani
Hi, Somaye
       I also met the same problems like u ,du u have any ideas to solve this proble?
Best wishes,
qiusy

Soren Rasmussen

unread,
Aug 25, 2025, 1:21:15 PMAug 25
to wrf-hydro_users, qiu shengyuan, Somaye Imani

Hi qiusy,

The installation of dependencies and building the model have changed since Somaye's post. 

How have you installed NetCDF? Here are instructions from the documentation for Linux operating systems.  

What do you see when you enter the following into the terminal?
```
 $ nf-config --includedir
```

Thanks,
Soren 
Reply all
Reply to author
Forward
0 new messages