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

Error: cannot find -lhdf5_hl_fortran and -lhdf5_fortran

jshn9515

New member
Hi, I tried to install WRF-4.5.2 on CentOS 7.9, all the dependencies had been checked and all tests had passed. But during installation, I received following errors:
```shell
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: cannot find -lhdf5_hl_fortran
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: cannot find -lhdf5_fortran
collect2: error: ld returned 1 exit status
```
It looked like my HDF5 library was not correctly installed, but I used `make check`, and none of the tests failed.
Here is my log.compile file, at about 3977 line, this error occurred.
Thanks for looking!
 

Attachments

  • log.compile.txt
    797.6 KB · Views: 6
@jshn9515
typically i've seen this error when either the ld library path wasn't exported for hdf5 and/or the export for hdf5 wasn't called.

for example:


Code:
export HDF5=/path/to/your/hdf5/files/
export LD_LIBRARY_PATH=/path/to/your/hdf5/file/lib:$LD_LIBRARY_PATH

so for my case it would be

export HDF5=/home/workhorse/WRF/Libs/grib2
export HDF5=/home/worhorse/WRF/Libs/grib2/lib:$LD_LIBARARY_PATH

Then the linker commands I use are these:

Code:
-lhdf5 -lhdf5_hl

Hope this helps
 
Thanks for your reply!

Well... Actually I installed HDF5 at /usr/local, but it seemed that both libhdf5_hl_fortran and libhdf5_fortran were not generate at the default location, which is \usr\local\lib. I used `find / -name libhdf5_hl_fortran.so 2>/dev/null` command to search, and because I also use python on my machine, I unexpectedly found one in my anaconda environment... After I added the environment's lib path to LD_LIBRARY_PATH, compiled again, it worked. But I still don't know why these two .so files were not generated by HDF5 at default location, both libhdf5_hl.so and libhdf5_cpp.so were there.
 
Last edited:
I have got error from PREP-CHEM-SRC-1.5 (attached). Could you help ?
libhdf5_fortran.so.200 => not found
 

Attachments

  • Screenshot from 2024-05-29 10-49-35.png
    Screenshot from 2024-05-29 10-49-35.png
    177.1 KB · Views: 4
Top