HDF5 は,階層データを扱うライブラリソフトウェア.
Windows で,HDF5 をソースコードからビルドして,インストールする手順を説明する. Build Tools for Visual Studio 2022(ビルドツール for Visual Studio 2022)を使用する. configure 版よりも CMake 版の方が Windows でのインストールが簡単だと判断している.
【目次】
HDF の利用条件などは、利用者が確認すること。次のWeb ページを活用してください
https://support.hdfgroup.org/products/licenses.html
謝辞:このWebページで紹介するHDF5ソフトウェアの作者に感謝します
Build Tools for Visual Studio 2017 (ビルドツール for Visual Studio 2017)もしくはVisual Studio 2017 を,前もってインストールしておく.NVIDIA CUDA の nvcc を機能させるため.
Build Tools for Visual Studio 2017 (ビルドツール for Visual Studio 2017) のインストール: 別ページ »で説明
Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
Windows での cmake のインストール: 別ページ »で説明
【関連する外部ページ】
cmake の公式ダウンロードページ: https://cmake.org/download/
Windows での 7-Zip のインストール: 別ページ »で説明
【関連する外部ページ】
7-Zip の公式ページ: https://sevenzip.osdn.jp/
Windows のスタートメニューで「Visual Studio 2017」の下の「VS2017 用 x64 Native Tools コマンドプロンプト」で起動する.(あるいは類似のものを探す)
cd %HOMEPATH% rmdir /s /q CMake-hdf5-1.10.5
cd %HOMEPATH% del CMake-hdf5-1.10.5.zip curl -O https://support.hdfgroup.org/ftp/HDF5/current/src/CMake-hdf5-1.10.5.zip rmdir /s /q CMake-hdf5-1.10.5 "c:\Program Files\7-Zip\7z.exe" x CMake-hdf5-1.10.5.zip
https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMakeの記載に従う
cmake の実行手順例は次の通り
cd %HOMEPATH% cd CMake-hdf5-1.10.5 ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764,INSTALL_DIR="C:/hdf5" -C Release -V -O hdf5.log
次のような表示になる. 「100% tests passed. 0 tests failed out of 2681」のように表示される.
なお Build Tools for Visual Studio 2017 よりも新しいバージョン (2019 や 2022)を使うと,エラーが出て,続行できないようである.
次のように設定する
%HOMEPATH%\CMake-hdf5-1.10.5\hdf5-1.10.5
次のように追加する
%HOMEPATH%\CMake-hdf5-1.10.5\build\bin\Release