CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Dakota / OpenFOAM (

niklas February 10, 2010 03:52

Dakota / OpenFOAM
Anyone here have any experience with Dakota in conjuction with openfoam?

It looks like it can do most of the things modeFrontier can do...and alot cheaper.


calebamiles June 25, 2011 07:10

Hello Niklas,

I am also intertested in using DAKOTA with OpenFoam, where you able to find any information on coupling the two? My first thought is to use something like pyFoam to modify parameters and DAKTOA to drive pyFoam, but I have no experience with this.


niklas June 25, 2011 07:54

Dakota works great with any kind of software that you can run via script.

Im using this every day in my work. It is really nice.

At first it can seem abit confusing, but if you download Jaguar (the GUI to dakota) and run
some examples it will become clear.

Jonas Ansoni October 6, 2011 17:29


I'm starting the studies about openfoam and dakota and a first question is: What's the best linux OS to run openfoam with dakota? Ubuntu, CentOS, Fedora, Suse?



Originally Posted by niklas (Post 313532)
Dakota works great with any kind of software that you can run via script.

Im using this every day in my work. It is really nice.

At first it can seem abit confusing, but if you download Jaguar (the GUI to dakota) and run
some examples it will become clear.

niklas October 7, 2011 01:36


Originally Posted by Jonas Ansoni (Post 326964)

I'm starting the studies about openfoam and dakota and a first question is: What's the best linux OS to run openfoam with dakota? Ubuntu, CentOS, Fedora, Suse?


I've used it successfully on RedHat, SuSe and Ubuntu.

Jonas Ansoni October 24, 2011 15:45

Hi Niklas,

Do you have any material or tutorial explaining how to make the coupling Openfoam - Dakota?


niklas October 25, 2011 01:41

nope, I started to write one but I never finished it cause I think
the available dakota tutorials are good enough.

and if you use the Jaguar GUI that they also supply its quite easy to get started.


donQi November 22, 2013 01:53

Dakota 5.3.1 installation with CentOS 6.4 and OF2.2.x
Few days ago I have installed Dakota 5.3.1 on CentOS6.4. I have found the installation process a bit difficult since there was a conflict with an OpenFOAM library called "" which has the same name of a DAKOTA library. The problem disappeared by using static libraries.
Here the instructions list I did on my pc, hope can be helpful to somebody else:

install all the required library as explained here


sudo su -
yum install boost boost-system boost-signals boost-regex boost-filesystem boost-devel blas blas-devel lapack lapack-devel openmpi openmpi-devel openmotif openmotif-devel libX11 libXau libXext libXmu libXmu-devel libXp libXp-devel libXpm libXpm-devel

1) uncompress the source code tar from dakota website
2) in the CMakeLists.txt do the following modifications
2A]-> instead of

option(BUILD_SHARED_LIBS "Build shared libraries?" ON)  #145 line
set libraries as static in the following way:

    # option(BUILD_SHARED_LIBS "Build shared libraries?" ON)
    # Build static libraries ONLY
    set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries" FORCE)
    set(BUILD_SHARED_LIBS OFF CACHE BOOL "Set to ON to build DSO libraries" FORCE)

2B]-> set to on the Documentation installation.

option(ENABLE_DAKOTA_DOCS "Enable DAKOTA documentation build." ON)
2C]-> add the following two lines:

    set(BLAS_LIBS "/usr/lib64/")   
    set(LAPACK_LIBS "/usr/lib64/")

just above the lines (to find these lines search "LAPACK"):

    # TODO: Can't this be integrated into the following logic?
        find_package(LAPACK REQUIRED NO_MODULE)

3) star the compilation process:

cd /home/yourPATH        #where you want to install Dakota
sudo cmake28 /home/download/DAKOTA/sourceCodeDistribution    # where you downloaded the source code
make dakota


gedit cmake_install.cmake
set the variable CMAKE_INSTALL_PREFIX as:


make install
5) update the .bashrc by adding the following lines

export PATH=$PATH:/home/yourPATH/bin:/home/yourPATH/test 
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yourPATH/bin:/home/yourPATH/lib

6) open a new terminal or

source ~/.bashrc
and launch openFoam 2.2
7) in the same terminal check that your Dakota installation is working by typing

dakota -v
if you get the following message

DAKOTA version 5.3.1 released 05/15/2013.
    Subversion revision 1606 built Nov 17 2013 15:43:33.

everything should be OK.

wyldckat December 1, 2013 13:44

Greetings donQi and many thanks for these instructions!

Is there any chance I can convince you to also post these instructions on the openfoamwiki? Namely in this section:

For now, I've left the link there to your post, but having the complete instructions on the wiki would make it easier for others to edit the page, in case there is some additional detail that can come in handy!

If you do not have the time to copy-paste-adjust your instructions to the wiki page, all we need is permission to do it for you. I'm emphasising this because the wiki complies with this license:

Content is available under GNU Free Documentation License 1.3.
Best regards,

donQi December 6, 2013 02:48

Greetings Bruno,

yes, of course you have my permission. This weekend I won't have time so thank you if you can do it for me. But I will probably have some time next week, so I'll check openFoamWiki, if it's still not done I'll do it.


wyldckat December 8, 2013 10:08

Hi Al,

I won't be able to look into this before the 25th of December :(
So please, do go ahead and write on the wiki when you have the time+opportunity!

Best regards,

brugiere_olivier January 10, 2014 12:09

Hi all,

I'm using another software to realize uncertainty quantification in CFD. But, I've some problems with this soft. In fact, to do UQ, I create my design of experiments (DoE) then I simulate my cases with openFoam and I use a second time the soft to reconstruct solutions. But sometimes, some simulations in the DoE don't perform and when I try to do the reconstruction, it's impossible because the soft need all the points in the DoE.
So I would like to know if somebody have try to do uncertainty quantification with DAKOTA and if it's possible to reconstruct solutions without some points in the DoE in DAKOTA or in an other software ?

Thanks for your answers


brugiere_olivier January 16, 2014 05:02

Hi all,

I've tried to install dakota but I've a problem when I compile from sources. This is the error message :


[ 98%] Building C object packages/motif/CMakeFiles/DGraphics.dir/src/Widgets/Common.c.o
Common.w: In function `class_initialize':
Common.w:287:43: error: `cvtStringToIcon' undeclared (first use in this function)
Common.w:287:43: note: each undeclared identifier is reported only once for each function it appears in
Common.w:289:10: error: `cvtIconDestructor' undeclared (first use in this function)
make[3]: *** [packages/motif/CMakeFiles/DGraphics.dir/src/Widgets/Common.c.o] Error 1
make[2]: *** [packages/motif/CMakeFiles/DGraphics.dir/all] Error 2
make[1]: *** [src/CMakeFiles/dakota.dir/rule] Error 2
make: *** [dakota] Error 2

I'm on centos 6.5 and I've gcc 4.8.2

Thanks for your answers


wyldckat January 26, 2014 14:22

Greetings Brugiere,

A few questions:
  1. How did you install gcc 4.8.2 on CentOS 6.5?
  2. How are you certain that gcc 4.8.2 was detected by the Dakota build system?
Best regards,

brugiere_olivier January 27, 2014 03:58

Greetings Santos,

I've try to compile dakota 5.3.1 on my laptop and I've not problem on a centos 6.5. So I think, I've a conflict on my computer with gcc 4.8.2
I have not had enough time to redo the compilation on my computer. I'll try this week and I'll post the conclusion.

Thanks for your answer

thetrademark March 7, 2014 14:36

Any resolution to src/CMakeFiles/dakota.dir/rule error?
I am getting same error as posted above.

make[1]: *** [src/CMakeFiles/dakota.dir/rule] Error 2
make: *** [dakota] Error 2

Any suggestions for resolution of this error?

wyldckat May 4, 2014 12:50

Greetings to all!

I've finally managed to look into this and here's what I've found:
  1. The instructions written by donQi indicate all of the necessary packages that need to be installed in the system. This includes Boost, LAPACK and BLAS. For this reason, it's best to use CentOS' own GCC version as well, namely 4.4.7.
  2. When I tried to build Dakota 5.3.1 using GCC 4.8.1 from an OpenFOAM 2.3.0 installation on CentOS 6.5 (followed these instructions: ), it didn't work. It did reach the same last 2 lines as Brugiere and Ben, but the error is completely different from the one Brugiere got.
    • The problem in my case seemed to be related to an incompatibility between the system's Boost version and the custom GCC 4.8.1 build I'm using for OpenFOAM 2.3.0.
  3. @Ben: Knowing the error messages you got above those last two lines is very important, since those error messages indicate what exactly went wrong.
  4. @Brugiere: I was not able to reproduce the error you got, but I do believe that the version you have installed in the laptop did build without any problems, only because the default settings found when running cmake will automatically be pointing to CentOS' own installation of GCC.
I've updated the instructions at the wiki page, based on my findings:
Hopefully following the updated instructions will reduce the change of unsuccessful builds.

Best regards,

crixman July 16, 2014 10:36

Hi all,
I tried in any way and wasn't able to install Dakota on Ubuntu (I tried with Ubuntu 12.04 and 13.10).
Compiling from source, I have problems with cmake, probably I can't set properly the library paths in the file BuildDakotaCustom.cmake

Can anyone provide step-by-step instructions as you did for CentOS?
Thanks in advance!

Tobi September 17, 2014 09:34

Compiling in Ubuntu
Dear crixmax,

I did not realize that here is a thread about DAKOTA and FOAM. Nontheless using or compiling the software on ubuntu, just follow the instruction in the README/INSTALL file.

What you also need are prerequirements (LAPACK, BLAS)...
You get it with (Ubuntu 14.04 LTS):

sudo apt-get install liblapack-dev libblas-dev
Additional you need bloost libs and header files. You can install it simply or download the boost-source and compile it yourself like:

tar xzf boost_1_49_0.tar.gz 
cd boost_1_49_0 ./ --with-libraries=filesystem,program_options,regex,serialization,signals,system --prefix=${HOME}/install_location_of_you_choice/boost/1.49
./b2 install

Then you have to copy or modify (as mentioned in the README/INSTALL instruction files) the BuildDakotaCostum.make file.
Add pathes to the boost compiling folder (if you compiled it yourself) and maybe change the prefix for your install file.

Next steps are clearly described in the mentioned files.
Maybe you have/had problems due to Prerequisites!

Non the less I have a question to you guys:

  • Do you compile dakota with MPI support or is it not necessary? In my case it was not possible to compile in MPI supported way
  • Anyway I also compiled without X Window support but I think that is not necessary too (I use gnuplot instead)


  • Which problems did you solve with dakota?
  • Do you still using Dakota + FOAM?
  • Can you give me an very simple example of a good intruduction problem which I can try dakota and FOAM ?

Thanks in advance,

wyldckat September 20, 2014 09:01


Originally Posted by Tobi (Post 510667)
  • Can you give me an very simple example of a good intruduction problem which I can try dakota and FOAM ?

Quick answer:

All times are GMT -4. The time now is 11:04.