I was trying to compile the DIRAC quantum chemistry program ([https://gitlab.com/dirac/dirac/-/blob/release-22/doc/installation/general.rst]) in WSL (Debian distro) I ran ./setup --fc=gfortran --cc=gcc --cxx=g++ --exatensor=OFF
to create the build directory and I then ran the Makefile that was created. However I got the following error:
/usr/bin/ld: cannot find -lHDF5::HDF5
collect2: error: ld returned 1 exit status
CMakeFiles/test_allocator.x.dir/build.make:101: recipe for target 'test_allocator.x' failed
make[2]: *** [test_allocator.x] Error 1
CMakeFiles/Makefile2:585: recipe for target 'CMakeFiles/test_allocator.x.dir/all' failed
make[1]: *** [CMakeFiles/test_allocator.x.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
I ran ld -lHDF5::HDF5 --verbose
to get more information and got
attempt to open //usr/local/lib/x86_64-linux-gnu/libHDF5::HDF5.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libHDF5::HDF5.a failed
attempt to open //lib/x86_64-linux-gnu/libHDF5::HDF5.so failed
attempt to open //lib/x86_64-linux-gnu/libHDF5::HDF5.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libHDF5::HDF5.so failed
attempt to open //usr/lib/x86_64-linux-gnu/libHDF5::HDF5.a failed
attempt to open //usr/local/lib64/libHDF5::HDF5.so failed
attempt to open //usr/local/lib64/libHDF5::HDF5.a failed
attempt to open //lib64/libHDF5::HDF5.so failed
attempt to open //lib64/libHDF5::HDF5.a failed
attempt to open //usr/lib64/libHDF5::HDF5.so failed
attempt to open //usr/lib64/libHDF5::HDF5.a failed
attempt to open //usr/local/lib/libHDF5::HDF5.so failed
attempt to open //usr/local/lib/libHDF5::HDF5.a failed
attempt to open //lib/libHDF5::HDF5.so failed
attempt to open //lib/libHDF5::HDF5.a failed
attempt to open //usr/lib/libHDF5::HDF5.so failed
attempt to open //usr/lib/libHDF5::HDF5.a failed
attempt to open //usr/x86_64-linux-gnu/lib64/libHDF5::HDF5.so failed
attempt to open //usr/x86_64-linux-gnu/lib64/libHDF5::HDF5.a failed
attempt to open //usr/x86_64-linux-gnu/lib/libHDF5::HDF5.so failed
attempt to open //usr/x86_64-linux-gnu/lib/libHDF5::HDF5.a failed
ld: cannot find -lHDF5::HDF5
But this sadly didn't help much as I don't know what HDF5::HDF5 is and how to install it, I couldn't find any libraries files with a name like this either
I also tried the following sudo ln -s /usr/local/lib/HDF5-1.12.2-Linux/HDF_Group/HDF5/1.12.2/lib/libhdf5.so /usr/local/lib/libHDF5:HDF5.so
based on this post: [https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary#comment75000411_42339395] but since I didn't know exactly what .so file libHDF5::HDF5 corresponded to it didn't get me anywhere