I’m trying to install the HDF5 1.10.6 library in my Ubuntu 18 x64 machine.
I’m following the official HDF5 documentation to da that.
So, here is my configure error:
vm@vm:~/Desktop/hdf5-1.10.6$ sudo ./configure --prefix=/usr/local/hdf5
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 3: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 5: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 8: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 13: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 18: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 21: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 26: $'\r': command not found
/home/vm/Desktop/hdf5-1.10.6/bin/missing: line 32: syntax error near unexpected token `$'in\r''
'home/vm/Desktop/hdf5-1.10.6/bin/missing: line 32: `case $1 in
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: error: cannot run /bin/bash bin/config.sub
How can I fix it?
My setup is: OS: Ubuntu 18 x64 HDF5 library: 1.10.6 CMake version: 3.10.2 gcc version: 7.4.0
Follow the instruction in H5CPP/INSTALL Some of these libraries are H5CPP and you won’t make use of them if you are not into machine learning and fast IO. Anyhoo here is a copy paste:
Sorry @steven about these questions, but I have another one:
In the H5CPP CMakeLlist.txt the default HDF5 directory path is:
set(HDF5_ROOT /usr/local/ /usr)
What I did:
Download the HDF5 1.10.6 (CMake version) from official HDF Group site
Use CMake to build the HDF5. cmake ..make and sudo make install
The result of this process is a generated folder called HDF5-1.10.6-Linux inside the build folder (not in the system /usr/ or /usr/local/)
This HDF5-1.10.6-Linux folder have this folder structure inside of it:
HDF5-1.10.6
–> HDF_GROUP
---->HDF5
------> 1.10.6
--------> bin
--------> include
--------> lib
--------> share
So, what I did.
1- I remove all old versions of HDF5 library of my machine: sudo apt remove libhdf5*
2- I manually create folders and copy each folder content to the correspondent folder inside the /usr/
Example: /usr/include/HDF5/ -> Here I paste the content of the generated HDF5 include folder
3- I installed all dependencies listed below:
Obs.: The only dependency that gives me a error is that:
Package libblitz0-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
4- Now I tried again to configure the H5CPP using:
Here is the minimal setup for Ubuntu 18.04. I am still checking out the examples, which you find at the bottom. I’ve checked these steps on a fresh official ubuntu 18.04 AWS EC2 image: ami-046842448f9e74e7d
wget http://h5cpp.org/download/hdf5-1.10.6.tar.gz
tar -xvzf hdf5-1.10.6.tar.gz && cd hdf5-1.10.6/
./configure --prefix=/usr/local --enable-build-mode=production
make -j4 && sudo make install
Thank you again @steven
I did this process above and I got no errors in the entire process.
Finally, I’m trying to compile some examples. Here is the basic example try:
vm@vm:~/Desktop/h5cpp/examples/basics$ ls
basics.cpp Makefile
vm@vm:~/Desktop/h5cpp/examples/basics$ make
g++ -std=c++17 -Wno-deprecated -c -o basics.o basics.cpp
In file included from basics.cpp:1:0:
/usr/local/include/h5cpp/all:8:11: fatal error: core: No such file or directory
#include "core"
^~~~~~
compilation terminated.
2 questions: 1- What should I do to compile this basic example? 2- After remove all old HDF5 installed libraries (described above) and do your Ubuntu 18 minimal setup above, I type: apt list --installed |grep hdf5 in the terminal and I got this output below:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
hdf5-helpers/bionic,now 1.10.0-patch1+docs-4 amd64 [installed,automatic]
libhdf5-100/bionic,now 1.10.0-patch1+docs-4 amd64 [installed,automatic]
libhdf5-cpp-100/bionic,now 1.10.0-patch1+docs-4 amd64 [installed,automatic]
libhdf5-dev/bionic,now 1.10.0-patch1+docs-4 amd64 [installed,automatic]
cp -R /usr/share/h5cpp/ ./ && cd h5cpp/examples/basic && make
g++ -std=c++17 -Wno-deprecated -c -o basics.o basics.cpp
g++ basics.o -lhdf5 -lz -ldl -lm -o basics
int
data type: int value valid
THIS ERROR is on PURPOSE: /usr/include/h5cpp/H5Pall.hpp line# 68 : failed to parse arguments...
#h5dump -pH 004.h5
you should install the header libraries: please find out if the content /usr/include/h5cpp matches with github h5cpp header files. If for some reasons it doesn’t match, please manually copy them. Also be certain the /usr/local/include/h5cpp is removed when using the ubuntu packaged version.
I didn’t tell you how to remove all libhdf5 from ubuntu, but outlined how to cleanup the $HOMEDIR after installing libhdf5. I don’t see how apt list could detect a manually installed libhdf5 you should see the correctly installed in /usr/local/lib/, you must include and link lhdf5 >= 1.10.4 as H5CPP does rely on direct chunk IO introduced in this revision. If you followed my instructions you have this version installed in /usr/local/include and /usr/local/lib.
Keep in mind that Ubuntu 18.04 ships various versions of libhdf5 what you see there is the libraries installed with your system. The newest debian will ship the correct hdf5 libraries as well as H5CPP.
to check libhdf5 version: cat /usr/local/lib/libhdf5.settings |grep Version
should print out: HDF5 Version: 1.10.6
errata: I just discovered that cmake breaks with multi-tu example; just use unix make on the examples for now until I upload the fixed packages.
best: steve