Difference between revisions of "Installation/Dakota/CentOS SL RHEL"

From OpenFOAMWiki
(Dakota 5.3.1 on CentOS 6.4)
(Undo revision 17003 by Rudolf.hellmuth (talk))
 
(10 intermediate revisions by 3 users not shown)
Line 22: Line 22:
 
== Dakota 5.3.1 on CentOS 6.4 ==
 
== Dakota 5.3.1 on CentOS 6.4 ==
  
Instructions are available in this post: [http://www.cfd-online.com/Forums/openfoam-programming-development/72558-dakota-openfoam.html#post463033 Dakota 5.3.1 installation with CentOS 6.4 and OF2.2.x - post #8]
+
The following instructions are adapted from this post: [http://www.cfd-online.com/Forums/openfoam-programming-development/72558-dakota-openfoam.html#post463033 Dakota 5.3.1 installation with CentOS 6.4 and OF2.2.x - post #8] - subsequent changes were made based on further tests and feedback.
  
1) Install the following packages 
+
<ol>
 +
<li>Prerequisites:
 +
* Must use the system's GNU GCC 4.4.7. Using another version might not allow for a successful build.
 +
* At least CMake 2.8.4 must be available to use. Either get a binary build version available from [http://www.cmake.org www.cmake.org] or build from source. But usually it's already available from the ''ThirdParty'' builds in OpenFOAM, when building from source code. For example, see the instructions on this page: [[Installation/Linux/OpenFOAM-2.2.2/CentOS_SL_RHEL]].
 +
</li>
  
<bash>
+
<li>Switch to root:
sudo su -  
+
<bash>sudo su -</bash>
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
+
</li>
</bash>
+
  
2) Uncompress the source code tar from dakota website: http://dakota.sandia.gov/distributions/download.html
+
<li>Install the following packages:
 +
<bash>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</bash>
 +
</li>
  
3) in the CMakeLists.txt do the following modifications :
+
<li>Logout from root:
 +
<bash>exit</bash>
 +
</li>
  
3A) instead of :
+
<li>
 +
Uncompress the source code tar from Dakota website: [http://dakota.sandia.gov/distributions/download.html Dakota download page]
 +
</li>
  
<bash>
+
<li>
option(BUILD_SHARED_LIBS "Build shared libraries?" ON)  #145 line
+
In the {{tt|CMakeLists.txt}} file, do the following modifications:
</bash>
+
<ol>
 
+
<li>Instead of:
set libraries as static in the following way:  
+
<bash>option(BUILD_SHARED_LIBS "Build shared libraries?" ON)  #145 line</bash>
 
+
Set libraries as static in the following way:  
<bash>
+
<bash># option(BUILD_SHARED_LIBS "Build shared libraries?" ON)  
# option(BUILD_SHARED_LIBS "Build shared libraries?" ON)  
+
 
# Build static libraries ONLY  
 
# Build static libraries ONLY  
 
set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries" FORCE)  
 
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)
+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Set to ON to build DSO libraries" FORCE)</bash>
</bash>
+
this modification is necessary because using shared libraries can create a conflict with an OpenFOAM library called {{tt|libsampling.so}}, which has the same name of a Dakota library. The problem disappeared by using static libraries.
 +
</li>
  
this modification is necessary because using sharing libraries can create a conflict with an OpenFOAM library called "libsampling.so" which has the same name of a DAKOTA library. The problem disappeared by using static libraries.  
+
<li>
 +
Set to "on" the Documentation installation:
 +
<bash>option(ENABLE_DAKOTA_DOCS "Enable DAKOTA documentation build." ON)</bash>
 +
</li>
  
3B) set to "on" the Documentation installation:  
+
<li>Search for these two lines (to find these lines search "LAPACK"):
 +
<bash>    if(MSVC)
 +
        find_package(LAPACK REQUIRED NO_MODULE)</bash>
 +
Right above the first line, add the following two lines:  
 +
<bash>set(BLAS_LIBS "/usr/lib64/libblas.so")   
 +
set(LAPACK_LIBS "/usr/lib64/liblapack.so")</bash>
 +
</li>
 +
</ol>
  
<bash>
+
</li>
option(ENABLE_DAKOTA_DOCS "Enable DAKOTA documentation build." ON)
+
</bash>
+
  
3C) add the following two lines:  
+
<li>
 +
Start the compilation process:  
 +
<bash>#ensure that the system's GCC is used
 +
export CC=/usr/bin/gcc
 +
export CXX=/usr/bin/g++
  
<bash>
 
set(BLAS_LIBS "/usr/lib64/libblas.so.3.2.1")   
 
set(LAPACK_LIBS "/usr/lib64/liblapack.so.3.2.1")
 
</bash>
 
 
just above the lines (to find these lines search "LAPACK"):
 
<bash>
 
    if(MSVC)
 
        find_package(LAPACK REQUIRED NO_MODULE)
 
</bash>
 
 
4) star the compilation process:
 
 
<bash>
 
 
cd /home/yourPATH        #where you want to install Dakota  
 
cd /home/yourPATH        #where you want to install Dakota  
sudo cmake28 /home/download/DAKOTA/sourceCodeDistribution    # where you downloaded the source code
+
cmake28 /home/download/DAKOTA/sourceCodeDistribution    # where you downloaded the source code
 
make dakota
 
make dakota
 
</bash>
 
</bash>
 +
</li>
  
5) set the directory of installation:
+
<li>
 +
Set the directory of installation:
  
 +
<ol>
 +
<li>
 
Open the cmake_install.cmake file with your favourite text editor:
 
Open the cmake_install.cmake file with your favourite text editor:
 +
<bash>gedit cmake_install.cmake</bash>
 +
Set the variable {{tt|CMAKE_INSTALL_PREFIX}} as:
 +
<bash>set(CMAKE_INSTALL_PREFIX "/home/yourPATH")</bash>
 +
</li>
  
<bash>
+
<li>
gedit cmake_install.cmake
+
Then in terminal:
</bash>
+
<bash>make install</bash>
 +
</li>
 +
</ol>
  
set the variable CMAKE_INSTALL_PREFIX as:
+
</li>
<bash>
+
set(CMAKE_INSTALL_PREFIX "/home/yourPATH")
+
</bash>
+
  
then in terminal:  
+
<li>
 +
Update the {{tt|.bashrc}} by adding the following lines
 +
<bash>export PATH=$PATH:/home/yourPATH/bin:/home/yourPATH/test 
 +
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yourPATH/bin:/home/yourPATH/lib</bash>
 +
</li>
  
<bash>
+
<li>
make install
+
Open a new terminal, or run:
</bash>
+
<bash>source ~/.bashrc</bash>
 +
and/to activate the OpenFOAM shell environment.
 +
</li>
  
6) update the .bashrc by adding the following lines
+
<li>
 
+
In the same terminal check that your Dakota installation is working by running:
<bash>
+
<bash>dakota -v</bash>
export PATH=$PATH:/home/yourPATH/bin:/home/yourPATH/test 
+
If you get a message of this type:
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yourPATH/bin:/home/yourPATH/lib
+
<bash>DAKOTA version 5.3.1 released 05/15/2013.  
</bash>
+
Subversion revision 1606 built Nov 17 2013 15:43:33.</bash>
 
+
everything should be OK.
7) open a new terminal or
+
</li>
 
+
</ol>
<bash>
+
source ~/.bashrc
+
</bash>
+
 
+
and launch openFOAM 2.2
+
 
+
8) in the same terminal check that your Dakota installation is working by typing
+
 
+
<bash>
+
dakota -v
+
</bash>
+
 
+
if you get the following message
+
 
+
<bash>
+
DAKOTA version 5.3.1 released 05/15/2013.  
+
    Subversion revision 1606 built Nov 17 2013 15:43:33.
+
</bash>
+
  
 
[[Category:Installing Dakota]]
 
[[Category:Installing Dakota]]

Latest revision as of 17:16, 22 July 2015

1 Introduction

This page is dedicated to explaining how to install Dakota in:

  • Community ENTerprise Operating System, aka CentOS.
  • Red Hat Enterprise Linux, aka RHEL.
  • Scientific Linux, aka SL.

In theory, all of the above follow the same versioning. Therefore, at the time this page was first written, RHEL, CentOS and SL were all at version 6.4.

If you do not yet feel comfortable using Linux, then perhaps you better first read the page Working with the Shell and train a bit with the shell/terminal environments, so you can have a better perception of the steps shown below.


2 Copy-Paste steps

A few notes before you start copy-pasting:

  1. Lines that start with # don't have to be copy-pasted. They are just comments to let you know what's going on.
  2. One wrong character is enough for breaking this guide, so make sure you can read the characters properly or that the installed language system does not break the copied characters!


2.1 Dakota 5.3.1 on CentOS 6.4

The following instructions are adapted from this post: Dakota 5.3.1 installation with CentOS 6.4 and OF2.2.x - post #8 - subsequent changes were made based on further tests and feedback.

  1. Prerequisites:
    • Must use the system's GNU GCC 4.4.7. Using another version might not allow for a successful build.
    • At least CMake 2.8.4 must be available to use. Either get a binary build version available from www.cmake.org or build from source. But usually it's already available from the ThirdParty builds in OpenFOAM, when building from source code. For example, see the instructions on this page: Installation/Linux/OpenFOAM-2.2.2/CentOS_SL_RHEL.
  2. Switch to root:
    sudo su -
  3. Install the following packages:
    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
  4. Logout from root:
    exit
  5. Uncompress the source code tar from Dakota website: Dakota download page
  6. In the CMakeLists.txt file, do the following modifications:
    1. 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)

      this modification is necessary because using shared libraries can create a conflict with an OpenFOAM library called libsampling.so, which has the same name of a Dakota library. The problem disappeared by using static libraries.

    2. Set to "on" the Documentation installation:
      option(ENABLE_DAKOTA_DOCS "Enable DAKOTA documentation build." ON)
    3. Search for these two lines (to find these lines search "LAPACK"):
          if(MSVC) 
              find_package(LAPACK REQUIRED NO_MODULE)

      Right above the first line, add the following two lines:

      set(BLAS_LIBS "/usr/lib64/libblas.so")    
      set(LAPACK_LIBS "/usr/lib64/liblapack.so")
  7. Start the compilation process:
    #ensure that the system's GCC is used
    export CC=/usr/bin/gcc
    export CXX=/usr/bin/g++
     
    cd /home/yourPATH         #where you want to install Dakota 
    cmake28 /home/download/DAKOTA/sourceCodeDistribution     # where you downloaded the source code
    make dakota
  8. Set the directory of installation:
    1. Open the cmake_install.cmake file with your favourite text editor:
      gedit cmake_install.cmake

      Set the variable CMAKE_INSTALL_PREFIX as:

      set(CMAKE_INSTALL_PREFIX "/home/yourPATH")
    2. Then in terminal:
      make install
  9. 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
  10. Open a new terminal, or run:
    source ~/.bashrc

    and/to activate the OpenFOAM shell environment.

  11. In the same terminal check that your Dakota installation is working by running:
    dakota -v

    If you get a message of this type:

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

    everything should be OK.