I'm stepping on this pit every day, maybe it's a pit in itself! ! !
官网:
https://support.hdfgroup.org/HDF5/
The version I have downloaded: hdf5-1.8.21.tar.bz2
tar -jxvf hdf5-1.8.21.tar.bz2
sudo ./configure --prefix=/usr/local/hdf5 #安装路径
sudo make
sudo check
sudo install
sudo check-install
After the installation is complete, go to this directory /usr/local/share/hdf5_examples/ and there is a run-c-ex.sh file under it, execute this file, this file will execute all the .c files in the c directory.
sudo ./run-c-ex.sh
Enter the c directory, my directory at this time is like this
carried out
sudo h5cc -o h5_extend h5_extend.c
If you report an error
h5cc:command not found
Just execute h5cc first, and it will report h5cc not installed, you can typing: sudo apt install hdf5-helpers
execute
sudo apt install hdf5-helpers
Execute next
sudo h5cc -o h5_extend h5_extend.c
If an error is reported hdf5.h: No such file or directory
execute
sudo apt-get install libhdf5-serial-dev
In execution
sudo h5cc -o h5_extend h5_extend.c
If there is no information, it means it is correct. Now execute
sudo ./h5_extend
If you report an error
cc: error: unrecognized command line option ‘-Wdate-time’
cc: error: unrecognized command line option ‘-fstack-protector-strong’
Reporting this error means that your gcc version is low, install the higher version, or switch to the higher version!
At this point, the installation should be successful, I want to cry! ! !