Build Dakota
Prerequisites
Dakota relies on some other tools and libraries. Please refer to the Dakota’s official website. Most of the tools (such as CMake, Python) are already installed. The ones that need to take care of are:
- Linear Algebra libraries: BLAS and LAPACK
- Boost
System information of my case:
- System: Red Hat 8
- Conda package: Mambaforge, moose environment
Install Prerequisites
-
The linear algebra libraries BLAS and LAPACK are already in the moose conda environment. Please refer to “Build SAM from Source” for how to install moose conda environment using Mambaforge.
-
Install Boost 1.69.0. I also tried Boost 1.80, but it didn’t work.
- Download Boost 1.69.0 source code from https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.gz. Or use following command:
1wget https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.gz - Extract the source code:
1tar xzf boost_1_69_0.tar.gz - Configure and install.
--prefixoption specifies the installation location:1 2 3cd boost_1_69_0 ./bootstrap.sh --prefix=${HOME}/local/boost/1.69 ./b2 -j4 install
- Download Boost 1.69.0 source code from https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.gz. Or use following command:
Setup Dakota compiling environment
-
Activate moose conda environment:
1mamba activate moose -
Add Boost dynamic linked library to the
LD_LIBRARY_PATH:1export LD_LIBRARY_PATH=${HOME}/local/boost/1.69:$LD_LIBRARY_PATHOr if you use
Environment Modulesto manage your libraries, you can make a module file for Boost and load the Boost module. Please refer to “Use Environment Module to Manage Software Packages and Environment Variables in Linux” for how to useEnvironment Modules.
Build Dakota from Source
Build Dakota
-
Download Dakota source code. I downloaded the Dakota version 1.16.0, Source (Unix/OS X) from https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.16.0-public-src-cli.tar.gz. Or you can download it via command:
1wget https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.16.0-public-src-cli.tar.gz -
Extract the source code:
1tar xzf dakota-6.16.0-public-src-cli.tar.gz -
Make a build directory. Usually we can make the build directory inside the source code directory:
1 2cd dakota-6.16.0-public-src-cli mkdir build -
Configure in the build directory:
1 2cd build cmake -DCMAKE_INSTALL_PREFIX=${HOME}/local/dakota/6.16.0 ..Here we specify
${HOME}/local/dakota/6.16.0as the Dakota installation directory. -
Build Dakota:
1make -j 4It may take a while.
Test Dakota
Test the Dakota build:
|
|
If all the tests are passed, it shows the Dakota build was successful.
Install Dakota
Finally you can install Dakota:
|
|
The installation location is ${HOME}/local/dakota/6.16.0. You should add the Dakota binary executable to the system PATH:
|
|
so that the system can find it. Or you can make a symbolic link for it to link it to you executable directory. For example, I have all my user’s exectable or tools in $HOME/bin, so I linked Dakota binary executable to this directory:
|
|
You can check whether Dakota is recongnized by the system using:
|
|