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

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

merged trunk-jpl and trunk for revision 11994M

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