Ceres ソルバ(Ceres Solver)は,非線形の最適化の機能をもったソフトウェア.
Ceres Solver (Ceres ソルバ)の利用条件などは、利用者が確認すること
Windows での Visual Studio Community 2022 のインストール: 別ページ »で説明
Visual Studio Community 2022 に, Build Tools for Visual Studio 2022の機能が含まれている.
Windows での Build Tools for Visual Studio 2022 (ビルドツール for Visual Studio 2022) のインストール: 別ページ »で説明
【関連する外部ページ】
Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
Windows での cmake のインストール: 別ページ »で説明
【関連する外部ページ】
cmake の公式ダウンロードページ: https://cmake.org/download/
次のページに記載の手順を行う.
https://github.com/jlblancoc/suitesparse-metis-for-windows
前もって,SuiteSparse, Metis をインストールするディレクトリを決めておく
このページでは,いずれも,c:\suitesparse 下にインストールするものとして説明する.
c: cd c:\ rmdir /s /q suitesparse-metis-for-windows
cd c:\ git clone --recursive https://github.com/jlblancoc/suitesparse-metis-for-windows call powershell -command "[System.Environment]::SetEnvironmentVariable(\"SP_ROOT\", \"c:\suitesparse-metis-for-windows\", \"Machine\")"
cmake でのオプションについて
cmake のオプションの 「Visual Studio 17 2022」のところは, 使用する Visual Studio のバージョンにあわせること. Visual Studio 2022 のときは,「Visual Studio 17 2022」. Visual Studio 2019 のときは,「Visual Studio 16 2019」
cmake の実行手順例は次の通り
cd c:\ cd suitesparse-metis-for-windows 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 ^ -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_INSTALL_PREFIX="C:/suitesparse"
エラーメッセージが出ていないこと.
cmake --build . --config RELEASE cmake --build . --config RELEASE --target INSTALL
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\suitesparse\lib\lapack_blas_windows\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\suitesparse\lib\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\suitesparse\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")"
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "[System.Environment]::SetEnvironmentVariable(\"SUITESPARSE_ROOT\", \"c:\suitesparse\", \"Machine\")"
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "[System.Environment]::SetEnvironmentVariable(\"METIS_ROOT\", \"c:\suitesparse\", \"Machine\")"
gflags の GitHub のページ: https://github.com/gflags/gflags
cmake のオプションの 「Visual Studio 17 2022」のところは, 使用する Visual Studio のバージョンにあわせること. Visual Studio 2022 のときは,「Visual Studio 17 2022」. Visual Studio 2019 のときは,「Visual Studio 16 2019」
C: cd %HOMEPATH% rmdir /s /q gflags git clone https://github.com/gflags/gflags cd gflags rmdir /s /q a mkdir a cd a del CMakeCache.txt cmake .. -G "Visual Studio 17 2022" -A x64 -T host=x64 ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX="C:/gflags" ^ -DBUILD_STATIC_LIBS=ON ^ -DBUILD_SHARED_LIBS=ON cmake --build . --config RELEASE cmake --build . --config RELEASE --target INSTALL
エラーメッセージが出ていないことを確認
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "[System.Environment]::SetEnvironmentVariable(\"GFLAGS_ROOT\", \"c:\gflags\", \"Machine\")"
glog のインストールの前に,gflags のインストールが終わっていること.
glog の GitHub のページ: https://github.com/google/glog
cmake のオプションの 「Visual Studio 17 2022」のところは, 使用する Visual Studio のバージョンにあわせること. Visual Studio 2022 のときは,「Visual Studio 17 2022」. Visual Studio 2019 のときは,「Visual Studio 16 2019」
C: cd %HOMEPATH% rmdir /s /q glog git clone https://github.com/google/glog cd glog 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 ^ -DCMAKE_INSTALL_PREFIX="C:/glog" cmake --build . --config RELEASE cmake --build . --config RELEASE --target INSTALL
エラーメッセージが出ていないことを確認
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "[System.Environment]::SetEnvironmentVariable(\"GLOG_ROOT\", \"c:\glog\", \"Machine\")"
次のページに記載の手順を行う.
http://ceres-solver.org/installation.html
前もって,Ceres ソルバ(Ceres Solver)をインストールするディレクトリを決めておく
このページでは,c:\ceres 下にインストールするものとして説明する.
C: cd %HOMEPATH% rmdir /s /q ceres-solver
次のページで確認
「-b 2.1.0」でバージョン指定している.
cd %HOMEPATH% git clone --recursive -b 2.1.0 https://github.com/ceres-solver/ceres-solver
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 ceres-solver rmdir /s /q a mkdir a cd a del CMakeCache.txt cmake .. -G "Visual Studio 17 2022" -A x64 -T host=x64 ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX="C:/ceres-solver" ^ -DBUILD_SHARED_LIBS=ON ^ -Dglog_DIR="C:/glog" ^ -Dgflags_DIR="C:/gflags" ^ -DBLAS_openblas_LIBRARY="C:/OpenBLAS/lib/openblas.lib" ^ -DSuiteSparse_DIR="C:/suitesparse" ^ -DMETIS_INCLUDE_DIR="C:/suitesparse/include" ^ -DMETIS_LIBRARY="C:/suitesparse/lib/metis.lib" ^ -DCXSparse_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DCXSparse_LIBRARY="C:/suitesparse/lib/libcxsparse.lib" ^ -DSuiteSparse_AMD_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_CAMD_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_CCOLAMD_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_CHOLMOD_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_COLAMD_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_Config_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_SPQR_INCLUDE_DIR="C:/suitesparse/include/suitesparse" ^ -DSuiteSparse_AMD_LIBRARY="C:/suitesparse/lib/libamd.lib" ^ -DSuiteSparse_CAMD_LIBRARY="C:/suitesparse/lib/libcamd.lib" ^ -DSuiteSparse_CCOLAMD_LIBRARY="C:/suitesparse/lib/libccolamd.lib" ^ -DSuiteSparse_CHOLMOD_LIBRARY="C:/suitesparse/lib/libcholmod.lib" ^ -DSuiteSparse_COLAMD_LIBRARY="C:/suitesparse/lib/libcolamd.lib" ^ -DSuiteSparse_Config_LIBRARY="C:/suitesparse/lib/suitesparseconfig.lib" ^ -DSuiteSparse_SPQR_LIBRARY="C:/suitesparse/lib/libspqr.lib"
エラーメッセージが出ていないこと.
cmake --build . --config RELEASE cmake --build . --config RELEASE --target INSTALL
エラーメッセージが出ていないこと.
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "[System.Environment]::SetEnvironmentVariable(\"CERES_ROOT\", \"c:\ceres-solver\", \"Machine\")"
コマンドプロンプトを管理者として実行: 別ページ »で説明
call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\gflags\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\glog\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\ceres-solver\bin\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")" call powershell -command "$oldpath = [System.Environment]::GetEnvironmentVariable(\"Path\", \"Machine\"); $oldpath += \";C:\ceres-solver\lib\"; [System.Environment]::SetEnvironmentVariable(\"Path\", $oldpath, \"Machine\")"