libhdf5 installation problem
6,788
In order to help ld
to find your hdf5
library you can add the following flag:
-L /usr/lib/x86_64-linux-gnu/hdf5/serial
i.e.
~$ gcc -lhdf5 -L/usr/lib/x86_64-linux-gnu/hdf5/serial
-Ldir Add directory dir to the list of directories to be searched for -l.
Configure the HDF5 version
Note: this is a quick fix for a minor bug / issue with the version of libhdf5. If you know a better / proper way to solve it, let me know. If this section doesn't apply to you, omit it.
-
Go to the libraries directory:
cd /usr/lib/x86_64-linux-gnu
-
Set LD_LIBRARY_PATH for libraries in Anacoda, such as libhdf5.so.10, libhdf5_hl.so.10:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/ubuntu/anaconda/lib" >> ~/.bashrc
-
Update the "Dynamic Linker":
sudo ldconfig
Related videos on Youtube
Author by
Victor Poughon
Updated on September 18, 2022Comments
-
Victor Poughon over 1 year
I've installed
libhdf5-dev
with apt-get butgcc
cannot find it:~$ locate libhdf5.so /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so ~$ gcc -lhdf5 /usr/bin/ld: cannot find -lhdf5 collect2: error: ld returned 1 exit status
I'm on Ubuntu 17.10.
-
Victor Poughon about 6 yearsduplicate of: askubuntu.com/questions/870237/…
-
-
Victor Poughon about 6 yearsObviously I'm not using ld or gcc directly but a more complex build system
-
Victor Poughon about 6 yearsAdding this path to the build library dir worked. But why doesn't ubuntu install this package in the correct location?
-
Yaron about 6 yearsseems like a known issue. I've added to my answer the official install instructions
-
Victor Poughon about 6 yearsThanks, I've fixed it by adding the search path to my build system config, which is a bit cleaner solution.