Sei sulla pagina 1di 13

cd /mnt/c/Users/Master/Desktop/CACTUS_V1_1

make && make cactus-nox CACTUS=/usr/bin/CACTUS

export DAK_SRC=$HOME/DAKOTA/dakota-6.10.0-release-public-linux.x86_64-GUI-only

1. Install some necessary packages:


Quote:

sudo apt-get install gcc g++ gfortran cmake cmake-curses-gui libboost-dev libboost-
all-dev libblas-dev liblapack-dev libopenmpi-dev openmpi-bin openmpi-doc xorg-dev
libmotif-dev
Explain:
Quote:

 GNU 4.8 compilers: gcc g++ gfortran


 CMake 2.8.12: cmake cmake-curses-gui
 Boost: libboost-dev libboost-all-dev
 Linear Algebra: libblas-dev liblapack-dev
 OpenMPI: libopenmpi-dev openmpi-bin openmpi-doc
 X Windows: xorg-dev libmotif-dev
 Python (optional): Python development dependencies (if using direct Python
interface): python-dev, and python-numpy if you'd like a NumPy interface.

2. Create the installation directory ($DAKOTA), and copy DAKOTA source code on it.

3.Extract file in terminal.


Quote:

tar -xzf dakota-6.4.0-public-src.tar.gz


4. Create and go to dakota-6.4.0 folder
Quote:

cd DAKOTA
mkdir dakota-6.4.0
cd dakota-6.4.0
5. Copy file BuildDakotaTemplate.cmake and rename it to BuildDakotaCustom.cmake.
You can edit some features if you want, check the content inside for detail.
Quote:
cp ~/DAKOTA/dakota-6.4.0.src/cmake/BuildDakotaTemplate.cmake
~/DAKOTA/dakota-6.4.0.src/cmake/BuildDakotaCustom.cmake
6. Run ccmake
Quote:

ccmake -C ~/DAKOTA/dakota-6.4.0.src/cmake/BuildDakotaCustom.cmake
~/DAKOTA/dakota-6.4.0.src -DCMAKE_INSTALL_PREFIX=~/DAKOTA/dakota-6.4.0
Quote:

 Cmake shows a simply GUI and when you enter in ccmake, first press the key
"c" to configure the script.
 If any error appears, go to the last line to check. If no, press "e" to return the
main GUI.
 In main GUI, press "t" to toggle some features. Now you can move down and
up the cursor. You can turn ON and OFF the features by press Enter.
 Go down, find BUILD_SHARE_LIBS and turn it OFF (by default: it's turned ON).
We turn off this since it conflicts with a library in OPENFOAM (libsampling.io).
 You also can move down to check the HAVE_X_GRAPHICS feature ON or OFF.
This function shows a graph when u run dakota.
 All finish, press "c" again to configure all scripts. If no error appears, you can
press "e" to back to the main menu.
 Finally press "g" to start generating the configuration.

7. Run make (The -j options is to compile in parallel, in this case I am compiling with 4
processors.)
Code:

make -j4

8. Install
Code:

make install

9. When you finish the compilation, do not forget to add the following environment
variables to your .bashrc file.
Code:

gedit ~/.bashrc

10. Add the following lines at the end of bashrc and save.
Quote:

export PATH=~/DAKOTA/dakota-6.4.0/bin:~/DAKOTA/dakota-6.4.0/test
export LD_LIBRARY_PATH=~/DAKOTA/dakota-6.4.0/bin:~/DAKOTA/dakota-6.4.0/lib
11. Test by typing: Dakota -v. The version number and build date should appear on the
terminal.

This all steps based on the hint by Dakota and the guide by Joegi in wikifoam.

Best regards,
B.Chien.
2.2 Dakota 6.4
Notes

 These instructions have been tested on Ubuntu 16.04 x86_64, but should work on any Linux Distribution
with x86_64 architecture.

Installation steps:

1. Download Dakota 6.4, specifically the Binary Executable for Linux, from here: Dakota Downloads page
2. Unpack it within the folder ~/OpenFOAM, e.g.:

3. cd ~/OpenFOAM

tar -xf ~/Downloads/dakota-6.4-public-Linux.x86_64.tar.gz

4. Rename the unpacked folder to dakota-6.4.0:

mv dakota-6.4.0.Linux.x86_64 dakota-6.4.0

5. The shell environment script code for loading this Dakota version can be placed inside the
script dakota-6.4.0/bashrc with the following commands:

6. echo 'DAKOTA_INSTALL=$HOME/OpenFOAM/dakota-6.4.0' > dakota-6.4.0/bashrc


7. echo 'export PATH=$PATH:$DAKOTA_INSTALL/bin:$DAKOTA_INSTALL/test' >> dakota-6.4.0/bash
rc

echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DAKOTA_INSTALL/lib:$DAKOTA_INSTALL/b


in' >> dakota-6.4.0/bashrc

8. Load Dakota into the current shell environment with the following command:

source $HOME/OpenFOAM/dakota-6.4.0/bashrc

WARNING: If you already have another version of Dakota loaded into the current terminal, then start a
new terminal without it being loaded it!

9. Then add the alias dakota640 to the personal .bashrc with the following command:

echo 'alias dakota640="source $HOME/OpenFOAM/dakota-6.4.0/bashrc"' >> ~/.bashrc

This way, whenever a new terminal window is opened, run the alias command that will load the
environment:
dakota640

10. Now try running Dakota, with the following command:

dakota --version

If it gives any error, then check the Troubleshooting section below

2.3 Dakota 6.5


Notes

 These instructions have been tested on Ubuntu 16.04 x86_64, but should work on any Linux Distribution
with x86_64 architecture.

Installation steps:

1. Download Dakota 6.5, specifically the Binary Executable for Linux, from here: Dakota Downloads page
2. Unpack it within the folder ~/OpenFOAM, e.g.:

3. cd ~/OpenFOAM

tar -xf ~/Downloads/dakota-6.5-public-Linux.x86_64.tar.gz

4. Rename the unpacked folder to dakota-6.5.0:

mv dakota-6.5.0.Linux.x86_64 dakota-6.5.0

5. The shell environment script code for loading this Dakota version can be placed inside the
script dakota-6.5.0/bashrc with the following commands:

6. echo 'DAKOTA_INSTALL=$HOME/OpenFOAM/dakota-6.5.0' > dakota-6.5.0/bashrc


7. echo 'export PATH=$PATH:$DAKOTA_INSTALL/bin:$DAKOTA_INSTALL/test' >> dakota-6.5.0/bash
rc

echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DAKOTA_INSTALL/lib:$DAKOTA_INSTALL/b


in' >> dakota-6.5.0/bashrc

8. Load Dakota into the current shell environment with the following command:

source $HOME/OpenFOAM/dakota-6.5.0/bashrc
WARNING: If you already have another version of Dakota loaded into the current terminal, then start a
new terminal without it being loaded it!

9. Then add the alias dakota650 to the personal .bashrc with the following command:

echo 'alias dakota650="source $HOME/OpenFOAM/dakota-6.5.0/bashrc"' >> ~/.bashrc

This way, whenever a new terminal window is opened, run the alias command that will load the
environment:

dakota650

10. Now try running Dakota, with the following command:

dakota --version

If it gives any error, then check the Troubleshooting section below

3 Troubleshooting
3.1 libmpi.so.1 not found
Symptom
When running dakota, if the following error appears:

error while loading shared libraries: libmpi.so.1: cannot open shared object fi
le: No such file or directory

Then it's because it's not able to find the correct Open-MPI library.
Possible solution
The following commands will fix this issue on Ubuntu 16.04 x86_64, but it will likely need re-
adapting for other Linux Distributions:

ln -s /etc/alternatives/libmpi.so $DAKOTA_INSTALL/lib/libmpi.so.1

3.2 libXm.so.4 not found


Symptom

dakota: error while loading shared libraries: libXm.so.4: cannot open shared ob
ject file: No such file or directory

Possible solutions
On Ubuntu 16.04 x86_64, the package libxm4 needs to be installed:

sudo apt-get install libxm4

 not connected to Facebook

 nicht mit Twitter verbunden

 nicht mit Google+ verbunden

 Einstellungen

Category:
 Installing Dakota

 What links here


 Related changes
 Special pages
 Permanent link
 Page information
 Browse properties

 This page was last modified on 26 March 2017, at 01:28.

Configure, Compile and Install


Dakota
Overview
Once required tools and libraries are installed, compiling a Dakota source distribution involves:

 Running CMake to (1) configure Dakota options as well as external software locations and
options, and (2) generate a development environment-specific build tree.
 Running the development environment's build process to compile and link, e.g., Unix
make; running Visual Studio or nmake on Windows.
 Testing the build
 Installing the build

This process will typically take from 10 minutes to an hour, depending on hardware and
operating system.

Simple Example to Configure, Compile and Install


This simple example shows the Dakota build process on a Unix-like platform where only a few
options are necessary:

mkdir build
cd build
# configure the build tree
cmake -DCMAKE_INSTALL_PREFIX=/path/to/dakota-installation /path/to/dakota-
source
# compile/link, specifying the number of processors
make -j 4
# run a minimal set of Dakota tests
cd test && ctest -j 4 -L Accept
# install to specified directory
make install
Specifying Additional CMake Options
Dakota has a number of required and optional and external package dependencies, and has
numerous internal subpackages. Thus, it is often necessary to specify additional CMake options
and/or environment variables to configure the build. See links below for instructions and more
detailed examples.

Dakota INSTALL
==============

Dakota is a framework which provides access to a broad variety of


algorithms and services. Downloading pre-built binaries from the
Dakota web site or accessing a site-supported installation are the
simplest routes to access Dakota.

For more experienced users, building Dakota from source (either


downloaded or checked out) allows customization with additional
packages and porting to additional platforms or operating systems.
This INSTALL file describes how to install pre-built binaries and setup
the environment, as well as how to compile from source code.

NOTE: The most up to date installation guidance and tips can be found
alongside the downloads on the Dakota website.

=================
Table of Contents
=================
Distribution Contents
Binary Quick Start
I. Install Unix-Like Binary (Linux RHEL6/7, or binary compatible, Mac OS
X)
II. Install Windows Executable
III. Test Binary Distribution installation.
Source Quick Start
Other Resources

=====================
Distribution Contents
=====================

The directories contained in Dakota distributions include:


* bin-dist denotes binary distributions
(dakota.<release>.<platform>.tar.gz,
dakota.<release>.<platform>.zip)
* src-dist denotes source or checkout distributions
(dakota.<release>.src.tar.gz, dakota.<release>.src.zip)

Distribution Directory Description


Type
------------ --------- --------------------------------------------------
bin-dist bin Binary files for Dakota, restart utility, dprepo
and various third-part libraries (TPLs).

bin-dist examples Example problems from the Users Manual, examples of


interfacing with other codes using script-based or
direct linkage-based interfaces, parallel computing
examples, and platform installation examples.

bin-dist test Files for regression and unit testing of the


src-dist unit_test Dakota system. Test simulator programs and
Dakota
input files are provided for testing different
capabilities.

bin-dist share dakota Python package and Bash interface helper


src-dist interfaces

bin-dist include Include files for Dakota and it's associated TPLs.

bin-dist lib Library files for Dakota and it's associated TPLs.

src-dist packages Libraries of iterative algorithms provided by


commercial vendors and related Sandia projects.
Additionally, libraries for parsing (nidr),
vector/matrix utilities (Trilinos Teuchos),
stochastic utilities (Pecos), algebraic
interface (AMPL), surface fitting (Surfpack), etc.

src-dist cmake Scripts supporting CMake builds.

src-dist docs The Users, Reference, and Developers Manuals are


maintained here. Other references are available
from
the Dakota Web site (http://dakota.sandia.gov).

src-dist src The main source code repository for Dakota core.
==================
Binary Quick Start
==================

Most users will install from a binary distribution, if available for


the target platform. This typically involves unpacking the archive
and setting the PATH variable, if required.

Dakota binary distributions are provided in archive format (either tar.gz


or zip).
* See Section I below to install tar.gz archive on Unix-like platform.
* See Section II below to install zip archive on Windows platform.
* See Section III below to test binary installion.

--------------------------------------------------------------------
I. Install Unix-Like Binary (Linux RHEL6/7 or binary compatible, Mac OS X)
--------------------------------------------------------------------

1. Extract archive file into suitable install location, e.g.


/home/username.
If you have root access, you may extract archive file in a shared
directory,
e.g. /usr/local.

$ cd /path/to/Dakota/install/directory
$ tar xzvf /path/to/dakota-<release>.src.tar.gz

Rename the extracted Dakota binary executable directory:

$ ls
dakota-<release>.<platform>
$ mv dakota-<release>.<platform> dakota

In the instructions below, $INSTALL_DIR refers to the path to this new


directory,
/path/to/Dakota/install/directory/dakota

2. Make sure Dakota executables (and optionally test files and current
directory) are available on the PATH by typing 'which dakota' at command
line prompt.

If your PATH variable is set correctly, the path to the dakota binary
should be displayed.
$ which dakota
$INSTALL_DIR/bin/dakota
where $INSTALL_DIR will be the absolute path specified in step #1 above.
Go to Section III to test the binary installation.

If your PATH variable is NOT set correctly, you will get a message like
the following:
$ which dakota
/usr/bin/which: no dakota in (/usr/local/bin:/usr/local/sbin)
Continue with step #3 to set your PATH variable.

3. If your PATH is not set correctly, make the following change to your
appropriate shell login script:

Bash shell
----------
a. Edit the startup file ~/.bashrc in your favorite text editor
b. Modify and export PATH variable. Type the following line, replacing
$INSTALL_DIR with the absolute path to your installation directory,
e.g. /home/username.

export PATH=$INSTALL_DIR/bin:$INSTALL_DIR/test:$PATH

c. Save and close file.


d. Update changes in your terminal window. At

$ source ~/.bashrc

C shell
-------
a. Edit the startup file ~/.cshrc in your favorite text editor
b. Set path variable. Type the following line, replacing
$INSTALL_DIR with the absolute path to your installation directory,
e.g. /home/username.

setenv path=($INSTALL_DIR/bin $INSTALL_DIR/test $path)

c. Save and close file.


d. Update changes in your terminal window. At

$ source ~/.cshrc

4. If you intend to use the dakota Python package, add the path
$INSTALL_DIR/share/dakota/Python/ to the environment variable
PYTHONPATH.
This can be made permanent by making this change in ~/.bashrc or
~/.cshrc.
Adapt the instructions in step 3.

--------------------------------------------------------------------
II. Install Windows Executable
--------------------------------------------------------------------

1. Extract archive file into suitable install location, e.g. C:\Dakota


using
the Windows extract utility.
a. In Windows Explorer window, highight
Dakota.<release>.<platform>.zip
file.
b. Right click and select "Extract All"
c. Select a destination, e.g. C:\Dakota, and click the Extract
button.
In the instructions below, %dest_dir% refers to this destination
directory.

Rename the extracted Dakota executable directory folder:


a. Right click the dakota-<release>.<platform> file, and select
'Rename'.
b. Rename file to 'Dakota'

In the instructions below, %install_dir% refers to the path to this new


directory, %dest_dir%\Dakota.

2. Set path to your executable.


a. Click the Start button and type 'cmd' in the 'Search program and
files'
text box to open cmd.exe.
b. At the command prompt, type the following command, replacing
%install_dir%
with the path to your Dakota installation:

C:\Users\name>
path=%path%;%install_dir%\bin;%install_dir%\test;%install_dir%\lib

Note that the path will be set only for as long as the cmd window
remains open. To permanently add Dakota to your path, consult the
documentation for your version of Windows.

3. If you intend to use the dakota Python package, add the path
%install_dir%\share\dakota\Python to the environment variable
PYTHONPATH. As
with the change to %path%, this change will be lost when the cmd Window
is
closed. Consult the documentation for your version of Windows to make an
environment variable persistent.

--------------------------------------------------------------------
III. Test Binary Distribution installation.
--------------------------------------------------------------------
1. At a terminal prompt (on Windows, dakota.exe), type 'dakota -v'. You
should
see Dakota version information displayed.

> dakota -v
Running serial executable in serial mode.
Dakota released <release date>.
Subversion revision ### build <build data & time>.
Dakota execution time in seconds;
Total CPU = ...
Total wall clock = ...

If you do not get the expected version information, you may use the
following Dakota wrapper script for your platform. This wrapper script
sets
expected environment variables and can be used instead of the executable
name. To test the Dakota installation use the following command:

Windows Command Terminal: dakota.bat -v


Linux: dakota.sh -v
Mac OS X: dakota.sh -v

2. Refer to the "Tutorial" section of the User's Manual for instructions


on using the dakota executables or see the Quick Start page on the
Dakota
web site.

==================
Source Quick Start
==================

To compile Dakota source distributions, use CMake to populate a build


tree for the target platform with generated Makefiles, and then
execute 'make'. Given the large number of supported packages,
specifying a few 'cmake' options and environment variables may be
required. Building the software with all packages may take from 15
minutes to over an hour.

The following are instructions for building Dakota on a Unix-like platform


in a Bash shell. You may need to use appropriate commands to work for your
particular platform or shell.
1. Install CMake 3.1 (or later) and ensure it is in your $PATH.

2. Extract Dakota source archive file. In the example below, Dakota will
be extracted into the user's home directory, /home/username.

$ cd $HOME
$ tar xzvf /path/to/dakota-<release>.public.src.tar.gz

You will see a new directory, /home/username/dakota-<release>.src. In


the instructions below, $DAK_SRC refers to this directory.

$ export DAK_SRC=$HOME/dakota-<release>.src

3. Create separate build directory, e.g. $HOME/dakota-build. In the


instructions below, $DAK_BUILD refers to the directory that you create
for CMake to configure and build Dakota.

$ mkdir -p /path/to/Dakota/build/directory
$ export DAK_BUILD=/path/to/Dakota/build/directory

4. Make a copy of the template BuildDakotaTemplate.cmake to customize a


CMake
Dakota build for our platform. Keep file in the $DAK_SRC/cmake directory
to use for subsequent Dakota CMake builds.

$ cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake \
$DAK_SRC/cmake/BuildDakotaCustom.cmake

5. Update $DAK_SRC/cmake/BuildDakotaCustom.cmake file to reflect your


platform
configuration. Instructions are provided in this file.

6. Configure and build Dakota.

$ cd $DAK_BUILD
$ cmake -C $DAK_SRC/cmake/BuildDakotaCustom.cmake $DAK_SRC
$ make [-j#]
$ make install

7. Set paths and library paths. In the instructions below, $DAK_INSTALL


refers to the Dakota installation path you specified for the variable
CMAKE_INSTALL_PREFIX in your BuildCustom.cmake file.

$ export PATH=$DAK_INSTALL/bin:$DAK_INSTALL/test:$PATH
$ export
LD_LIBRARY_PATH=$DAK_INSTALL/lib:$DAK_INSTALL/bin:$LD_LIBRARY_PATH

NOTE: For Mac OS X, you need to set DYLD_LIBRARY_PATH instead.

$ export
DYLD_LIBRARY_PATH=$DAK_INSTALL/lib:$DAK_INSTALL/bin:$DYLD_LIBRARY_PATH

Miscellaneous Notes:
* 'make [-j#]': Dakota supports concurrent build processes

* 'make install' requires write privileges in CMAKE_INSTALL_PREFIX.

* Executing cmake without any options will result in an attempt to


build with as many vendor algorithms and packages as are available
in the distribution. Options below and on the Dakota website
describe how to turn off features.

* Once make has successfully completed, the generated Dakota


executables (dakota and dakota_restart_util) will reside in
$DAK_BUILD/src. If 'make install' is invoked, copies of the
executables will be placed in CMAKE_INSTALL_PREFIX/bin and copies
of the libraries (libdakota.a, etc.) are placed in
CMAKE_INSTALL_PREFIX/lib. You may set CMAKE_INSTALL_PREFIX in
BuildDakotaCustom.cmake.

===============
Other Resources
===============

For additional help with installing Dakota from source, please


visit https://dakota.sandia.gov/content/build-compile-source-code

Topic include:
* accessing Dakota via Subversion repository checkout
* source installation dependencies
* source installation options
* Dakota CMake hints
* generating local documentation
* summary of distributed Dakota libraries
* installing commercial libraries, such as DOT, NPSOL, and NLPQL

Potrebbero piacerti anche