Building Dakota on Ubuntu 12.04 LTS
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.
Build instructions
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.
Setting 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.
Packages
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.
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.
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
Building Dakota from source
Download the Dakota source and unpack it:
Make a build directory:
Follow the instructions for copying the Dakota CMake script into the build directory. I made two(?) changes to the script:
Configure the build:
Compile:
Install: