#! /bin/bash # This is an automated installation script to install Dakota automatically in $HOME/Dakota. # Execute this code as an user in your $HOME directory # Read and try to understand what this script does before using it. # # This script should work for Ubuntu. # 1. # Execute this script by issuing the command in a terminal as sudo: ## chmod +x sh inst_dakota_Ubuntu.txt; sudo ./inst_dakota_Ubuntu.txt # # 2. Mandatory requirements 1: (i) CMake 3.10, (ii) g++, (iii) boost, (iv) lapack, blas, mpicxx sudo apt install liblapack-dev libopenmpi-dev libblas-dev libboost-all-dev unzip sudo apt install gcc g++ gfortran cmake openmpi-bin openmpi-doc xorg-dev libmotif-dev echo ' ' >> $HOME/.bashrc echo 'Added by inst_dakota_Ubuntu.txt' >> $HOME/.bashrc echo 'alias g++="g++ --std=c++0x"' >> $HOME/.bashrc # 3. Download and install dakota automatically from the internet cd $HOME wget https://dakota.sandia.gov/sites/default/files/distributions/public/dakota-6.10.0-release-public-src-UI.zip unzip dakota-6.10.0-release-public-src-UI.zip cd dakota-6.10.0-release-public.src-UI DAK_SRC=$(echo $PWD) mkdir -p $HOME/dakota-build DAK_BUILD=$HOME/dakota-build export DAK_SRC=$DAK_SRC export DAK_BUILD=$DAK_BUILD # 4. Begin compilation. cd $DAK_BUILD #cmake -C $DAK_SRC/cmake/BuildDakotaCustom.cmake $DAK_SRC cmake DAKOTA_HAVE_MPI:BOOL=TRUE BUILD_STATIC_LIBS:BOOL=ON BUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=$HOME/Dakota -MPI_CXX-/usr/bin/mpicxx $DAK_SRC -DCMAKE_CXX_COMPILER=/usr/bin/mpicxx -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran make -j2 make install echo PATH=$HOME'/Dakota/bin:'$HOME'/Dakota/share/dakota/test:$PATH' >> ~/.bashrc echo PYTHONPATH=$HOME'/Dakota/share/dakota/Python:$PYTHONPATH' >> ~/.bashrc echo ' ' >> $HOME/.bashrc export PATH=$HOME'/Dakota/bin:'$HOME'/Dakota/share/dakota/test:$PATH' export PYTHONPATH=$HOME'/Dakota/share/dakota/Python:$PYTHONPATH' # 5. The dakota executable is known as dakota. If it gets compiled correctly, it should be found in $HOME/Dakota/bin which dakota