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

errors for NETCDF H5* when compiling wrf

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

lslrsgis

Member
Dear WRF Community,

I am writing for a problem when compiling wrf and wrfchem. When executing ./compile em_real &> compile.log, there is always errors for H5* as follows:

/usr/local/lib/netcdf/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): In function `nc4_open_file':
nc4file.c:(.text+0x4518): undefined reference to `H5check_version'
nc4file.c:(.text+0x451d): undefined reference to `H5open'
nc4file.c:(.text+0x4538): undefined reference to `H5check_version'
nc4file.c:(.text+0x453d): undefined reference to `H5open'
nc4file.c:(.text+0x45fc): undefined reference to `H5open'
nc4file.c:(.text+0x4603): undefined reference to `H5P_CLS_FILE_ACCESS_ID_g'
nc4file.c:(.text+0x460b): undefined reference to `H5Pcreate'
nc4file.c:(.text+0x4633): undefined reference to `H5Pset_fclose_degree'
nc4file.c:(.text+0x466e): undefined reference to `H5Pset_cache'
nc4file.c:(.text+0x46a3): undefined reference to `H5LTopen_file_image'
nc4file.c:(.text+0x46e9): undefined reference to `H5Fopen'
nc4file.c:(.text+0x475d): undefined reference to `H5Pclose'
nc4file.c:(.text+0x479c): undefined reference to `H5Pclose'

It seems something relative to Netcdf HDF5 support. Any indications? Thanks.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S. I am using the following scripts for installing netcdf:

cd /home/lsl/Downloads/SOFT/INSTALL_WRF/Libraries/netcdf-4.6.1
sudo CPPFLAGS="-I/usr/local/lib/hdf5-1.10.4/include/ -I/usr/local/lib/curl-7.62.0/include/ -I/usr/local/lib/zlib-1.2.11/include" LDFLAGS="-L/usr/local/lib/hdf5-1.10.4/lib/ -lhdf5_hl -lhdf5 -L/usr/local/lib/curl-7.62.0/lib/ -L/usr/local/lib/zlib-1.2.11/lib/" ./configure --with-hdf5=/usr/local/lib/hdf5-1.10.4/ --with-zlib=/usr/local/lib/zlib-1.2.11 --prefix=/usr/local/lib/netcdf --disable-shared --disable-dap --enable-netcdf-4
sudo make install


cd ~/Downloads/WRF-INSTALL/netcdf-fortran-4.4.4
=>cd /home/lsl/Downloads/SOFT/INSTALL_WRF/Libraries/netcdf-fortran-4.4.4
sudo CPPFLAGS="-I/usr/local/lib/hdf5-1.10.4/include/ -I/usr/local/lib/netcdf/include/" LDFLAGS="-L/usr/local/lib/hdf5-1.10.4/lib/ -L/usr/local/lib/netcdf/lib/" ./configure --prefix=/usr/local/lib/netcdf --enable-fortran --enable-large-file-test
sudo make install
 

Attachments

  • compile.log.wrfchem.20190804.txt
    1.4 MB · Views: 53
Thanks for the reply.

(1) If I choose to use disable-netcdf4 option when installing NETCDF C library, ./configure --prefix=/usr/local/lib/netcdf --disable-dap --disable-netcdf-4 –disable-shared, WRFV4.0 can be compiled. However, I have met a problem with ncdump & ncl_filedump. When reading wrfout files, it prompted errors as follows:

***@lsl-Vostro-3668:~/Downloads/TEMP$ ncdump -h wrfout_d01_2015-01-01_12\:00\:00 > zz.h
*** ncdump: ncopen failed on wrfout_d01_2015-01-01_12:00:00

***@lsl-Vostro-3668:~/Downloads/TEMP$ ncl_filedump wrfout_d01_2015-01-01_12\:00\:00.nc > zz.h
Segmentation fault (core dumped)

The wrfout file can not be read by ncdump&ncl_filedump, but they can be opened by ncview.

(2) If I choose to use enable-netcdf4 option, ./configure --prefix=/usr/local/lib/netcdf --disable-dap –enable-netcdf-4, NETCDF C library with enable-netcdf option can be successfully installed in my UBUNTU desktop. While when serial GNU option is used to compile WRFV4.0, the errors prompted:

/usr/bin/ld: /home/user/Library/netcdf/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `hdf5free':
nc4file.c:(.text+0x1b): undefined reference to `H5free_memory'
/usr/bin/ld: /home/user/Library/netcdf/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `get_netcdf_type':
nc4file.c:(.text+0x72): undefined reference to `H5Tget_class'
/usr/bin/ld: nc4file.c:(.text+0x97): undefined reference to `H5Tis_variable_str'
/usr/bin/ld: nc4file.c:(.text+0xe5): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0xec): undefined reference to `H5T_NATIVE_SCHAR_g'
/usr/bin/ld: nc4file.c:(.text+0xfb): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x12d): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x134): undefined reference to `H5T_NATIVE_SHORT_g'
/usr/bin/ld: nc4file.c:(.text+0x143): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x175): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x17c): undefined reference to `H5T_NATIVE_INT_g'
/usr/bin/ld: nc4file.c:(.text+0x18b): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x1bd): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x1c4): undefined reference to `H5T_NATIVE_FLOAT_g'
/usr/bin/ld: nc4file.c:(.text+0x1d3): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x205): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x20c): undefined reference to `H5T_NATIVE_DOUBLE_g'
/usr/bin/ld: nc4file.c:(.text+0x21b): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x24d): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x254): undefined reference to `H5T_NATIVE_UCHAR_g'
/usr/bin/ld: nc4file.c:(.text+0x263): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x295): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x29c): undefined reference to `H5T_NATIVE_USHORT_g'
/usr/bin/ld: nc4file.c:(.text+0x2ab): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x2dd): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x2e4): undefined reference to `H5T_NATIVE_UINT_g'
/usr/bin/ld: nc4file.c:(.text+0x2f3): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x325): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x32c): undefined reference to `H5T_NATIVE_LLONG_g'
/usr/bin/ld: nc4file.c:(.text+0x33b): undefined reference to `H5Tequal'
/usr/bin/ld: nc4file.c:(.text+0x36d): undefined reference to `H5open'
/usr/bin/ld: nc4file.c:(.text+0x374): undefined reference to `H5T_NATIVE_ULLONG_g'
/usr/bin/ld: nc4file.c:(.text+0x383): undefined reference to `H5Tequal'
/usr/bin/ld: /home/user/Library/netcdf/lib/libnetcdf.a(libnetcdf4_la-nc4file.o): in function `read_hdf5_att':
nc4file.c:(.text+0x48a): undefined reference to `H5Aget_type'
/usr/bin/ld: nc4file.c:(.text+0x4b0): undefined reference to `H5Tget_native_type'

Since I wish to use ncdump and ncl_filedump, I believe one should use –enable-netcdf4 when install NETCDF C library? But how to solve H5* errors in (2).

P.S.
(a) The compile.log file of WRFV4.0 is attached.

(b) Additional explanation can be found in another post:
https://forum.mmm.ucar.edu/phpBB3/viewtopic.php?f=48&t=8368&p=14229#p14229
 

Attachments

  • log.compile.avc.netcdf4.serial.20190909.evening.txt
    801 KB · Views: 47
Hi,
You only need to enable NetCDF-4 if you need to use its tools (such as compression for very large files). If you do, then you will also need to successfully install HDF5. Unfortunately we are not the developers or supporters of either NetCDF or HDF5. As for installing NetCDF (without enabling NetCDF-4), are you using a different version of NetCDF than is provided as a tar file here http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compilation_tutorial.php

It shouldn't be necessary to install NetCDF separately, as NetCDF-C and NetCDF-fortran. If you use the tar file given on the page, you should be able to just install it as is. If you are continuing to have problems with either NetCDF or HDF5 installation, unfortunately you will need to discuss the problem with the developers of those programs, or with a systems administrator within your institution.
 
Top