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

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

Changing the way externalpackages are installed: one script per version and per platform if necessary. The goal is to make the installation process more userfriendly

  • Property svn:executable set to *
File size: 3.5 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
35cd ..
36
37#Before compiling, if running on 64 bits, we need to active fPIC compilation. Some packages
38#do not register -fPIC in Dakota, which is a problem. Edit the faulty Makefiles and add the -fPIC
39#flag to the compilation.
40cat ./src/methods/NCSUOpt/Makefile | sed 's/FFLAGS = -g -O2/FFLAGS = -g -O2 -fPIC/g' > temp
41mv temp ./src/methods/NCSUOpt/Makefile
42
43cat ./src/methods/acro/packages/pebbl/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
44mv temp ./src/methods/acro/packages/pebbl/src/Makefile
45
46cat ./src/methods/hopspack/src-nappspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
47mv temp ./src/methods/hopspack/src-nappspack/Makefile
48
49cat ./src/methods/hopspack/src-cddlib/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
50mv temp ./src/methods/hopspack/src-cddlib/Makefile
51
52cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
53mv temp ./src/methods/hopspack/src-shared/Makefile
54
55cat ./src/methods/hopspack/src-shared/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
56mv temp ./src/methods/hopspack/src-shared/Makefile
57
58cat ./src/methods/hopspack/src-conveyor/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
59mv temp ./src/methods/hopspack/src-conveyor/Makefile
60
61cat ./src/methods/hopspack/src-appspack/Makefile | sed 's/CXXFLAGS = -g -O2/CXXFLAGS = -g -O2 -fPIC/g' > temp
62mv temp ./src/methods/hopspack/src-appspack/Makefile
63
64cat ./src/methods/acro/packages/colin/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
65mv temp ./src/methods/acro/packages/colin/src/Makefile
66
67cat ./src/methods/acro/packages/coliny/src/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CXXFLAGS = -O2 -fpermissive -fPIC/g' > temp
68mv temp ./src/methods/acro/packages/coliny/src/Makefile
69
70cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CFLAGS = -O2/CFLAGS = -O2 -fPIC/g' > temp
71mv temp ./src/methods/acro/packages/tpl/3po/Makefile
72
73cat ./src/methods/acro/packages/tpl/3po/Makefile | sed 's/CXXFLAGS = -O2 -fpermissive/CFLAGS = -O2 -fpermissive -fPIC/g' > temp
74mv temp ./src/methods/acro/packages/tpl/3po/Makefile
75
76cat ./src/packages/ampl/Makefile | sed 's/CFLAGS = -g -O2/CFLAGS = -g -O2 -fPIC/g' > temp
77mv temp ./src/packages/ampl/Makefile
78
79#Compile and install dakota
80cd src
81if [ -z $NUMCPUS ];
82then
83 make
84 make install
85else
86 make -j $NUMCPUS
87 make -j $NUMCPUS install
88fi
89cd ..
90
91#Weird behaviour of Dakota: libamplsolver.a and amplsolver.a are not the same thing!
92cd install/lib
93mv libamplsolver.a libamplsolver.a.bak
94ln -s ../../src/packages/ampl/amplsolver.a ./libamplsolver.a
Note: See TracBrowser for help on using the repository browser.