source: issm/trunk-jpl/externalpackages/dakota/install-macosx64.sh@ 13246

Last change on this file since 13246 was 13246, checked in by seroussi, 13 years ago

CHG: added set -eu in all installation files to stop if an error occurs

  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#!/bin/bash
2set -eu
3
4#Get number of cpus
5NUMCPUS=$1;
6
7#Some cleanup
8rm -rf Dakota
9rm -rf src
10rm -rf install
11mkdir src install
12
13#Download from ISSM server
14$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/Dakota_4_3.src.tar.gz' 'Dakota_4_3.src.tar.gz'
15
16#Untar
17tar -zxvf Dakota_4_3.src.tar.gz
18
19#Move Dakota to src directory
20mv Dakota/* src
21rm -rf Dakota
22
23#Apply patches
24patch src/src/ParallelLibrary.C ./ParallelLibrary.C.patch
25patch src/src/ParallelLibrary.H ./ParallelLibrary.H.patch
26patch src/src/NIDRProblemDescDB.C ./NIDRProblemDescDB.C.patch
27patch src/src/NonDSampling.C ./NonDSampling.C.patch
28patch src/src/NonDLocalReliability.C ./NonDLocalReliability.C.patch
29patch src/src/NonDUnilevelRBDO.C ./NonDUnilevelRBDO.C.patch # source not even used?
30#patch -R src/packages/Pecos/src/LHSDriver.cpp ./LHSDriver.cpp.patch
31
32#Configure dakota
33cd src
34./configure \
35 --prefix="$ISSM_DIR/externalpackages/dakota/install" \
36 --without-graphics \
37 --with-pic \
38 --disable-mpi \
39 --with-blas="-L$ISSM_DIR/externalpackages/petsc/install/lib -lfblas " \
40 --with-lapack="-L$ISSM_DIR/externalpackages/petsc/install/lib -lflapack "
41cd ..
42
43#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages
44#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC
45#flag to the compilation.
46cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' > temp
47mv temp ./src/methods/NCSUOpt/Makefile
48
49cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
50mv temp ./src/methods/acro/packages/pebbl/src/Makefile
51
52cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
53mv temp ./src/methods/hopspack/src-nappspack/Makefile
54
55cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
56mv temp ./src/methods/hopspack/src-cddlib/Makefile
57
58cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
59mv temp ./src/methods/hopspack/src-shared/Makefile
60
61cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
62mv temp ./src/methods/hopspack/src-shared/Makefile
63
64cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
65mv temp ./src/methods/hopspack/src-conveyor/Makefile
66
67cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
68mv temp ./src/methods/hopspack/src-appspack/Makefile
69
70cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
71mv temp ./src/methods/acro/packages/colin/src/Makefile
72
73cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
74mv temp ./src/methods/acro/packages/coliny/src/Makefile
75
76cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
77mv temp ./src/methods/acro/packages/tpl/3po/Makefile
78
79cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
80mv temp ./src/methods/acro/packages/tpl/3po/Makefile
81
82cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2 -D_NONSTD_SOURCE/CFLAGS = -g -O2 -fPIC/g' > temp
83mv temp ./src/packages/ampl/Makefile
84
85#Compile and install dakota
86cd src
87if [ -z $NUMCPUS ];
88then
89 make
90 make install
91else
92 make -j $NUMCPUS
93 make -j $NUMCPUS install
94fi
95cd ..
96
97#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
98cd install/lib
99mv libamplsolver.a libamplsolver.a.bak
100ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Note: See TracBrowser for help on using the repository browser.