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

Last change on this file since 12332 was 12332, checked in by Mathieu Morlighem, 13 years ago

merged trunk-jpl and trunk for revision 12326M

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