Eigen は, 次の機能を持つ C++ テンプレートライブラリ.SSEを使うように最適化されている.
Eigen のインストールは,複数の方法がある.
Windows で,Eigen 最新版をソースコードからビルドして,インストールする手順をスクリーンショット等で説明する.
【目次】
eigen の利用条件などは、利用者が確認すること
謝辞
eigen の作者に感謝します
Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
Windows での cmake のインストール: 別ページ »で説明
【関連する外部ページ】
cmake の公式ダウンロードページ: https://cmake.org/download/
Windows での 7-Zip のインストール: 別ページ »で説明
【関連する外部ページ】
7-Zip の公式ページ: https://sevenzip.osdn.jp/
必要な場合には,次のように操作する.
c:\vcpkg\vcpkg --triplet x64-windows install blas fftw3[sse,sse2,avx,avx2,threads] gmp hwloc metis mpfr openblas[threads] pthread superlu
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";c:\vcpkg\installed\x64-windows\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")"
Windows での Build Tools for Visual Studio 2022,NVIDIA ドライバ,NVIDIA CUDA ツールキット 11.8,NVIDIA cuDNN v8.6 のインストールと動作確認: 別ページ »で説明
【関連する外部ページ】
前もって,eigen をインストールするディレクトリを決めておく
このページでは,c:\eigen 下にインストールするものとして説明する.
C: cd %HOMEPATH% rmdir /s /q eigen
cd %HOMEPATH% git clone https://gitlab.com/libeigen/eigen.git
cmake でのオプションについて
cmake のオプションの 「Visual Studio 17 2022」のところは, 使用する Visual Studio のバージョンにあわせること. Visual Studio 2022 のときは,「Visual Studio 17 2022」. Visual Studio 2019 のときは,「Visual Studio 16 2019」
cmake の実行手順例は次の通り
cd %HOMEPATH% cd eigen rmdir /s /q build mkdir build cd build del CMakeCache.txt cmake .. -G "Visual Studio 17 2022" -A x64 -T host=x64 ^ -DCMAKE_BUILD_TYPE=Release ^ -DBoost_INCLUDE_DIR="c:/boost/build/include/boost-1_81" ^ -DCUDA_NVCC_FLAGS="-allow-unsupported-compiler" ^ -DCMAKE_INSTALL_PREFIX="c:/eigen" ^ -DEIGEN_TEST_CUDA=ON
上に示した「実行手順例」でのcmake でのオプションを調整するとしたら
次のようなオプションを付ける.
-DVCPKG_TARGET_TRIPLET=x64-windows ^ -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ^
※ 下の通りになるとは限らない.エラーメッセージが出るなど場合は,前で cmake を実行したときの設定を変えてやり直す.
cmake --build . --config RELEASE cmake --build . --config RELEASE --target INSTALL
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "[System.Environment]::SetEnvironmentVariable(\"EIGEN_ROOT\", \"c:\eigen\", \"Machine\")"