金子邦彦研究室インストールWindows の種々のソフトウェア(インストール)HDF5 1.10.5 のインストール(ソースコードを使用)(Windows 上)

HDF5 1.10.5 のインストール(ソースコードを使用)(Windows 上)

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 のインストール(Windows 上)

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) のインストール: 別ページ »で説明

Git のインストール(Windows 上)

Windows での Git のインストール: 別ページ »で説明

関連する外部ページ

Git の公式ページ: https://git-scm.com/

cmake のインストール(Windows 上)

Windows での cmake のインストール: 別ページ »で説明

関連する外部ページ

cmake の公式ダウンロードページ: https://cmake.org/download/

7-Zip のインストール(Windows 上)

Windows での 7-Zip のインストール: 別ページ »で説明

関連する外部ページ

7-Zip の公式ページ: https://sevenzip.osdn.jp/

hdf5 のインストール(Build Tools for Visual Studio を利用)(Windows 上)

  1. hdf5 のバージョン確認

    https://support.hdfgroup.org/ftp/HDF5/current/src

  2. Visual Studio の x64 Native Tools コマンドプロンプトを開く.

    Windows のスタートメニューで「Visual Studio 2017」の下の「VS2017 用 x64 Native Tools コマンドプロンプト」で起動する.(あるいは類似のものを探す)

  3. hdf5 の作業ディレクトリとインストールディレクトリを削除する
    cd %HOMEPATH%
    rmdir /s /q CMake-hdf5-1.10.5
    

    [image]
  4. hdf5 のソースコードをダウンロード
    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
    

    [image]
  5. Windows で hdf5 を ソースコードからビルドし、インストールする

    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
    
  6. 結果の確認

    次のような表示になる. 「100% tests passed. 0 tests failed out of 2681」のように表示される.

    なお Build Tools for Visual Studio 2017 よりも新しいバージョン (2019 や 2022)を使うと,エラーが出て,続行できないようである.

    [image]
  7. Windowsシステム環境変数 HDF5_ROOT の設定

    次のように設定する

    %HOMEPATH%\CMake-hdf5-1.10.5\hdf5-1.10.5

  8. Windowsシステム環境変数 LIB の設定

    次のように追加する

    %HOMEPATH%\CMake-hdf5-1.10.5\build\bin\Release