source: issm/trunk-jpl/externalpackages/dakota/install-6.2-mac.sh@ 24649

Last change on this file since 24649 was 24649, checked in by jdquinn, 5 years ago

CHG: Initial commit for all macOS binaries; relevant changes to respective Linux scripts/configs; cleanup

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1#!/bin/bash
2set -eu
3
4
5# Constants
6#
7DAK_ROOT=${ISSM_DIR}/externalpackages/dakota
8VER="6.2"
9
10## Environment
11#
12export BLAS_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lfblas -L/usr/local/gfortran/lib -lgfortran" # Need to export BLAS_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
13export BOOST_ROOT=${ISSM_DIR}/externalpackages/boost/install
14export CXXFLAGS='-std=c++98' # Setting CXXFLAGS to deal with C++11 incompatibility with Matlab's Boost (absolutely necessary for this version)
15export DAK_BUILD=${DAK_ROOT}/build
16export DAK_INSTALL=${DAK_ROOT}/install
17export DAK_SRC=${DAK_ROOT}/src
18export LAPACK_LIBS="-L${ISSM_DIR}/externalpackages/petsc/install/lib -lflapack -L/usr/local/gfortran/lib -lgfortran" # Need to export LAPACK_LIBS *and* pass it as an option to CMake to ensure that external packages also find it
19
20# Cleanup
21rm -rf build install src
22mkdir build install src
23
24# Download source
25${ISSM_DIR}/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${VER}-public.src.tar.gz" "dakota-${VER}-public-src.tar.gz"
26
27# Unpack source
28tar -zxvf dakota-${VER}-public-src.tar.gz
29
30# Move source to 'src' directory
31mv dakota-${VER}.0.src/* src
32rm -rf dakota-${VER}.0.src
33
34# Copy customized source and configuration files to 'src' directory
35cp configs/${VER}/packages/DDACE/src/Analyzer/MainEffectsExcelOutput.cpp ${DAK_SRC}/packages/DDACE/src/Analyzer
36cp configs/${VER}/packages/surfpack/src/surfaces/nkm/NKM_KrigingModel.cpp ${DAK_SRC}/packages/surfpack/src/surfaces/nkm
37cp configs/${VER}/src/DakotaInterface.cpp ${DAK_SRC}/src
38cp configs/${VER}/src/NonDLocalReliability.cpp ${DAK_SRC}/src
39cp configs/${VER}/src/NonDSampling.cpp ${DAK_SRC}/src
40
41# Copy customized source and configuration files specific to Mac to 'src' directory
42cp configs/${VER}/mac/cmake/BuildDakotaCustom.cmake ${DAK_SRC}/cmake
43cp configs/${VER}/mac/cmake/DakotaDev.cmake ${DAK_SRC}/cmake
44cp configs/${VER}/mac/packages/VPISparseGrid/src/sandia_rules.cpp ${DAK_SRC}/packages/VPISparseGrid/src
45
46# Configure
47cd ${DAK_BUILD}
48cmake \
49 -DBUILD_SHARED_LIBS=ON \
50 -DBUILD_STATIC_LIBS=OFF \
51 -DCMAKE_C_COMPILER=${MPI_HOME}/bin/mpicc \
52 -DCMAKE_CXX_COMPILER=${MPI_HOME}/bin/mpicxx \
53 -DCMAKE_Fortran_COMPILER=${MPI_HOME}/bin/mpif77 \
54 -DCMAKE_CXX_FLAGS="-fdelayed-template-parsing" \
55 -DHAVE_ACRO=OFF \
56 -DHAVE_JEGA=OFF \
57 -C${DAK_SRC}/cmake/BuildDakotaCustom.cmake \
58 -C${DAK_SRC}/cmake/DakotaDev.cmake \
59 ${DAK_SRC}
60
61# Compile and install
62if [ $# -eq 0 ]; then
63 make
64 make install
65else
66 make -j $1
67 make -j $1 install
68fi
69
70cd ${DAK_INSTALL}
71
72# Comment out definition of HAVE_MPI in Teuchos config header file in order to
73# avoid conflict with our definition
74sed -i -e "s/#define HAVE_MPI/\/* #define HAVE_MPI *\//g" include/Teuchos_config.h
Note: See TracBrowser for help on using the repository browser.