HDF5 1.10.5 のインストール(ソースコードを使用)(Windows 上)
【目次】
HDF の利用条件などは、利用者が確認すること.
前準備
Build Tools for Visual Studio 2017 (ビルドツール for Visual Studio 2017)もしくは Visual Studio 2017 のインストール(Windows 上)
Build Tools for Visual Studio 2017 (ビルドツール for Visual Studio 2017)もしくはVisual Studio 2017 を,前もってインストールしておく.NVIDIA CUDA の nvcc を機能させるため.
Git のインストール(Windows 上) [クリックして展開]
管理者権限のコマンドプロンプトで以下を実行する.管理者権限は,winget の --scope machine オプションでシステム全体にインストールするために必要となる.
REM Git をシステム領域にインストール
winget install --scope machine --id Git.Git -e --silent --disable-interactivity --force --accept-source-agreements --accept-package-agreements --override "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS=""icons,ext\reg\shellhere,assoc,assoc_sh"" /o:PathOption=Cmd /o:CRLFOption=CRLFCommitAsIs /o:BashTerminalOption=MinTTY /o:DefaultBranchOption=main /o:EditorOption=VIM /o:SSHOption=OpenSSH /o:UseCredentialManager=Enabled /o:PerformanceTweaksFSCache=Enabled /o:EnableSymlinks=Disabled /o:EnableFSMonitor=Disabled"
CMakeのインストール(Windows 上) [クリックして展開]
管理者権限のコマンドプロンプトで以下を実行する。管理者権限のコマンドプロンプトを起動するには、Windows キーまたはスタートメニューから「cmd」と入力し、表示された「コマンドプロンプト」を右クリックして「管理者として実行」を選択する。
REM CMake をシステム領域にインストール
winget install --scope machine --id Kitware.CMake -e --silent --disable-interactivity --force --accept-source-agreements --accept-package-agreements --override "/qn /norestart ADD_CMAKE_TO_PATH=System"
hdf5 のインストール(Build Tools for Visual Studio を利用)(Windows 上)
- hdf5 のバージョン確認
- 以下の操作をx64 Native Tools コマンドプロンプト (x64 Native Tools Command Prompt)で実行する
(手順:スタートメニュー →
」の下の「x64 Native Tools コマンドプロンプト (x64 Native Tools Command Prompt)」を選ぶ)。 - hdf5 の作業ディレクトリとインストールディレクトリを削除する
cd /d c:%HOMEPATH% rmdir /s /q CMake-hdf5-1.10.5
- hdf5 のソースコードをダウンロード
cd /d c:%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 powershell Expand-Archive -DestinationPath . CMake-hdf5-1.10.5.zip
- Windows で hdf5 を ソースコードからビルドし、インストールする
【関連する外部ページ】 HDF5のページ: https://docs.hdfgroup.org/hdf5/v1_14/_intro_h_d_f5.html
cmake の実行手順例は次の通り
cd /d c:%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)を使うと,エラーが出て,続行できないようである.
- Windows の システム環境変数 HDF5_ROOT の設定
次のように設定する
%HOMEPATH%\CMake-hdf5-1.10.5\hdf5-1.10.5
- Windows の システム環境変数 LIB の設定
次のように追加する
%HOMEPATH%\CMake-hdf5-1.10.5\build\bin\Release
- hdf5 の作業ディレクトリとインストールディレクトリを削除する
【まとめ】 HDF5をダウンロード,ctestでビルド,環境変数を設定.