Building Dakota on Ubuntu 12.04 LTS: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== | == Instructions from the Dakota developers == | ||
The Dakota developers provide help for building Dakota from source. | The Dakota developers provide help for building Dakota from source. | ||
Line 25: | Line 25: | ||
== | == Set up an Ubuntu VM == | ||
We don't have an Ubuntu test machine at CSDMS, | We don't have an Ubuntu test machine at CSDMS, | ||
Line 37: | Line 37: | ||
== | == Install Dependencies == | ||
Here are the Ubuntu packages that are both required | Here are the Ubuntu packages that are both required | ||
Line 52: | Line 52: | ||
== | == Build CMake == | ||
The version (2.8.7) of CMake provided with the Ubuntu distro is older than the version (2.8.9) recommended by the Dakota developers. | The version (2.8.7) of CMake provided with the Ubuntu distro is older than the version (2.8.9) recommended by the Dakota developers. | ||
Line 58: | Line 58: | ||
== | == Build Boost == | ||
The version (1.48) of Boost provided with the Ubuntu distro is older than the version (1.49) recommended by the Dakota developers. | The version (1.48) of Boost provided with the Ubuntu distro is older than the version (1.49) recommended by the Dakota developers. | ||
Line 71: | Line 71: | ||
== | == Build Dakota from source == | ||
Download the Dakota source and unpack it: | Download the Dakota source and unpack it: | ||
Line 87: | Line 87: | ||
cp ../cmake/BuildDakotaTemplate.cmake BuildDakota.cmake | cp ../cmake/BuildDakotaTemplate.cmake BuildDakota.cmake | ||
I made two | I made two changes to the script. I set the Boost path: | ||
<blockquote> | |||
set( BOOST_ROOT "home/mpiper/dakota-6.4.0.Linux-Ubuntu.x86_64" CACHE PATH "Use non-standard Boost install" FORCE )<br> | |||
set( Boost_NO_SYSTEM_PATHS TRUE CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE ) | |||
</blockquote> | |||
and I set the install location: | |||
<blockquote> | |||
set( CMAKE_INSTALL_PREFIX "home/mpiper/dakota-6.4.0.Linux-Ubuntu.x86_64" CACHE PATH "Path to Dakota installation" ) | |||
</blockquote> | |||
Additional information on the Dakota CMake script can be found [https://dakota.sandia.gov/content/using-builddakotatemplatecmake-script here]. | Additional information on the Dakota CMake script can be found [https://dakota.sandia.gov/content/using-builddakotatemplatecmake-script here]. | ||
Configure the build: | Configure the build: | ||
cmake -C BuildDakota.cmake /home/mpiper/dakota-6.4-public.src | |||
Compile: | Compile: | ||
make | |||
Test the build: | |||
cd test && make test | |||
Install: | Install: | ||
cd .. | |||
make install |
Revision as of 13:14, 22 August 2016
The developers of Dakota provide binary distributions for Mac OS X and the CentOS (RHEL-compatible) Linux distribution. They don't, however, provide a binary for the Ubuntu (Debian-compatible) Linux distribution, requesting that users compile Dakota from source. This is a long and moderately difficult task, so it may be out of reach for many Dakota users who prefer to use Ubuntu. Additionally, the Travis CI web service that CSDMS uses for integration testing runs Ubuntu 12.04 LTS, so for us to test our software with Dakota, it would be convenient to have a pre-built binary that can be easily accessed by Travis. These are a set of notes for building Dakota from source on Ubuntu 12.04 LTS.
Instructions from the Dakota developers
The Dakota developers provide help for building Dakota from source. In particular, I followed their instructions
although, as always, the details are important, so I'll try to be careful in explaining what I did. I chose not to build optional features such as OpenMPI, X Windows, and Python.
Set up an Ubuntu VM
We don't have an Ubuntu test machine at CSDMS, so I installed Ubuntu 12.04 LTS as a VM on my iMac using VirtualBox.
Be sure to provide at least:
- 20 GB of hard disk space
- 2 GB of system memory
I couldn't compile the Boost library until I bumped up the base system memory. Graphics memory and acceleration aren't needed.
Install Dependencies
Here are the Ubuntu packages that are both required and are available through the package manager (i.e., they don't need to be built from source):
libblas-dev
(no need to symlink libblas.so -> libblas.so.3)liblapack-dev
(no need to symlink liblapack.so -> liblapack.so.3)g++
gfortran
fort77
libteuchos-dev
(although this lib optional, it will be built by Dakota unless it's installed)
Install these packages with sudo apt-get install {package name}
before doing anything else.
Build CMake
The version (2.8.7) of CMake provided with the Ubuntu distro is older than the version (2.8.9) recommended by the Dakota developers. Their instructions for obtaining, compiling, and installing CMake worked.
Build Boost
The version (1.48) of Boost provided with the Ubuntu distro is older than the version (1.49) recommended by the Dakota developers. Their instructions for obtaining, compiling, and installing Boost worked, but it took several attempts. I chose to install Boost along with Dakota, so my actions, which differed slightly from those in the instructions, were:
tar xzf boost_1_49_0.tar.gz cd boost_1_49_0 ./bootstrap.sh --prefix=${HOME}/dakota-6.4.0.Linux-Ubuntu.x86_64 ./b2 -j4 install
Build Dakota from source
Download the Dakota source and unpack it:
wget https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.4-public.src.tar.gz tar zxf dakota-6.4-public.src.tar.gz
Make a build directory:
cd dakota-6.4-public.src mkdir build && cd build
Copy the Dakota CMake script into the build directory:
cp ../cmake/BuildDakotaTemplate.cmake BuildDakota.cmake
I made two changes to the script. I set the Boost path:
set( BOOST_ROOT "home/mpiper/dakota-6.4.0.Linux-Ubuntu.x86_64" CACHE PATH "Use non-standard Boost install" FORCE )
set( Boost_NO_SYSTEM_PATHS TRUE CACHE BOOL "Supress search paths other than BOOST_ROOT" FORCE )
and I set the install location:
set( CMAKE_INSTALL_PREFIX "home/mpiper/dakota-6.4.0.Linux-Ubuntu.x86_64" CACHE PATH "Path to Dakota installation" )
Additional information on the Dakota CMake script can be found here.
Configure the build:
cmake -C BuildDakota.cmake /home/mpiper/dakota-6.4-public.src
Compile:
make
Test the build:
cd test && make test
Install:
cd .. make install