Unidata / gempak

Analysis and product generation for meteorological data.
BSD 3-Clause "New" or "Revised" License
70 stars 30 forks source link

HDF5 and netCDF4 Ubuntu build failing to find hdf5.h #42

Open mjames-upc opened 5 years ago

mjames-upc commented 5 years ago

HDF5 and netCDF4 Ubuntu build failing to find hdf5.h which is in $OS_INC. -ldl is supplied for $NETCDF in config/Makefile*

gfortran -fno-stack-protector -fno-second-underscore -fno-range-check -fd-lines-as-comments -I/home/gempak/GEMPAK7/gempak/include -I/home/gempak/GEMPAK7/os/linux64/include -I/usr/include/python2.7 -g -O -L/usr/lib -L/home/gempak/GEMPAK7/os/linux64/lib -s device.f /home/gempak/GEMPAK7/os/linux64/lib/device.a /home/gempak/GEMPAK7/os/linux64/lib/gif.a /home/gempak/GEMPAK7/os/linux64/lib/gn.a /home/gempak/GEMPAK7/os/linux64/lib/syslib.a /home/gempak/GEMPAK7/os/linux64/lib/gemlib.a /home/gempak/GEMPAK7/os/linux64/lib/cgemlib.a /home/gempak/GEMPAK7/os/linux64/lib/gemlib.a /home/gempak/GEMPAK7/os/linux64/lib/libnetcdf.a -ldl -lz /home/gempak/GEMPAK7/os/linux64/lib/libhdf5_hl.a /home/gempak/GEMPAK7/os/linux64/lib/libhdf5.a /home/gempak/GEMPAK7/os/linux64/lib/libpng.a /home/gempak/GEMPAK7/os/linux64/lib/libz.a /home/gempak/GEMPAK7/os/linux64/lib/rsl.a /home/gempak/GEMPAK7/os/linux64/lib/libbz2.a -lm -o gif
/home/gempak/GEMPAK7/os/linux64/lib/libhdf5.a(H5PL.o): In function `H5PL_term_interface':
H5PL.c:(.text+0x280): undefined reference to `dlclose'
/home/gempak/GEMPAK7/os/linux64/lib/libhdf5.a(H5PL.o): In function `H5PL_load':
H5PL.c:(.text+0x6a8): undefined reference to `dlsym'
H5PL.c:(.text+0x96c): undefined reference to `dlopen'
H5PL.c:(.text+0x979): undefined reference to `dlerror'
H5PL.c:(.text+0x98b): undefined reference to `dlsym'
H5PL.c:(.text+0x998): undefined reference to `dlclose'
H5PL.c:(.text+0x9ac): undefined reference to `dlclose'
H5PL.c:(.text+0xac3): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Makefile:75: recipe for target 'gif' failed
make[5]: *** [gif] Error 1
make[5]: Leaving directory '/home/gempak/GEMPAK7/gempak/source/driver/active/gif'

mentioned: https://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11875.html

mzuranski commented 2 years ago

This issue continues for version 7.14.0.

I found a work-around a while back and posted it to the Gembud list, see that post for the details.

Here are the steps to get past this:

  1. Install as one normally would, pausing after the make all >& make.out step.
  2. Edit ~/NAWIPS/config/Makeinc.linux64_gfortran_ubuntu and add LIBBZ2 = $(OS_LIB)/libbz2.a -ldl at the bottom.
  3. Re-run make all >& make.out
  4. Continue the install as one normally would.

I've confirmed this works on Ubuntu 18.04 LTS and 20.04 LTS.