Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WRF compilation failed for netcdf module.

Manuarii

Member
Hi,

I have an issues when compiling WRF that return me 2 different errors but related to netcdf-fortran and netcdf-c.

1. The first error return the following, for netcdf-fortran :

Code:
if [ $x = "gfortran" ] ; then \
           echo removing external declaration of iargc for gfortran ; \
   /lib/cpp -P -nostdinc -P -traditional-cpp -I/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel//include -I../ioapi_share diffwrf.F90 | sed '/integer *, *external.*iargc/d' > diffwrf.f ;\
        else \
   /lib/cpp -P -nostdinc -P -traditional-cpp -I/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel//include -I../ioapi_share diffwrf.F90 > diffwrf.f ; \
        fi
time mpifort -ip -fp-model precise -w -ftz -align all -fno-alias -FR -convert big_endian   -real-size 32 -i4   -c  -I/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel//include -I../ioapi_share diffwrf.f
0.43user 0.08system 0:00.73elapsed 70%CPU (0avgtext+0avgdata 59788maxresident)k
24inputs+712outputs (0major+22295minor)pagefaults 0swaps
diffwrf io_netcdf is being built now.
ld: cannot find -lnetcdf

real    0m0.817s
user    0m0.286s
sys     0m0.130s
make[2]: [makefile:45: diffwrf] Error 1 (ignored)

2. The second error, related to netcdf-c, return me :

Code:
ld: warning: libhdf5_hl.so.200, needed by /ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib/libnetcdf.so, not found (try using -rpath or -rpath-link)
ld: warning: libhdf5.so.200, needed by /ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib/libnetcdf.so, not found (try using -rpath or -rpath-link)

When compiling the code, I load some modules and export some path, in the following way:

Code:
module purge
module load mpi
# Load the required compilers and libraries
module load intel/20.0.0  # contains ICC 19
# Load HDF5 and NetCDF in parallel
module load flavor/hdf5/parallel hdf5/1.10.9
module load flavor/hdf5/parallel netcdf-c/4.7.4
module load flavor/hdf5/parallel netcdf-fortran/4.5.3
# Load Jasper for GRIB2 support
module load jasper/2.0.14

export TOOLDIR=/usr/
export NCTEMP=/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/
export NETCDF_classic=1
export NETCDF=$NCTEMP
export NETCDF_DIR=$NCTEMP
export PATH=$TOOLDIR/include:$PATH
export PATH=$TOOLDIR/bin:$PATH
export PATH=$TOOLDIR/lib:$PATH
export WRFIO_NCD_LARGE_FILE_SUPPORT=1
export COMPRESSION_INC=$TOOLDIR/include
export COMPRESSION_LIBS=$TOOLDIR/lib
export JASPERLIB=$JASPER_LIBDIR
export JASPERINC=$JASPER_INCDIR
export YACC="$TOOLDIR/bin/yacc -d"
export WRF_EM_CORE=1 WRF_NMM_CORE=0 WRF_CHEM=0 WRF_KPP=0
export FFLAGS="-I$TOOLDIR/include -L$TOOLDIR/lib"
export CFLAGS="-I$TOOLDIR/include -L$TOOLDIR/lib"
export CPPFLAGS="-I$TOOLDIR/include -L$TOOLDIR/lib"

Can someone help me to identify the issues,

Thanks in advance,

Regards,

Vazquez Ballesta Manuarii
 
Last edited:
Hi @Manuarii , could you upload the full compilation log and configure.wrf? I'd like to see earlier in the build process its selection of netcdf and why for diffwrf it fails to find it but then later finds the library but not the respective hdf5.
 
Hi @islas,

Before providing the log file, I wanted to mention that updating the module hdf5 from version 1.10.9 to 1.12.2 appears to have resolved the second error, specifically: "ld: warning: libhdf5_hl.so.200." However, the initial error ("ld: cannot find -lnetcdf") persists.

Despite resolving the second error, a new issue has emerged involving multiple undefined variables or functions during the process. Attached below are the log and configuration files, but also the compile.wrf I'm using to launch the compile code and make the export and module load . The method I use to export the libraries remains unchanged, except for the updated hdf5 version.
 

Attachments

  • compile.log
    1.1 MB · Views: 4
  • compile.wrf.txt
    3.4 KB · Views: 0
  • configure.wrf.txt
    23.5 KB · Views: 2
Top