Building Dakota on Ubuntu 12.04 LTS: Difference between revisions

From CSDMS
No edit summary
No edit summary
Line 52: Line 52:




== CMake ==
== Building 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:




== Boost ==
== Building 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 74: Line 74:


Download the Dakota source and unpack it:
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:
Make a build directory:


Follow the [https://dakota.sandia.gov/content/using-builddakotatemplatecmake-script instructions] for copying the Dakota CMake script into the 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 made two(?) changes to the script:
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:

Revision as of 12:07, 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.


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.


Building 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.


Building 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:

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:

Additional information on the Dakota CMake script can be found here.

Configure the build:

Compile:

Install: