-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·112 lines (98 loc) · 2.75 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh
if [ -z ${XYCE_INSTALL+x} ]
then
XYCE_INSTALL=${ACT_HOME}
fi
export XYCE_INSTALL
echo
echo "Building+installing Xyce."
echo " install dir: XYCE_INSTALL ($XYCE_INSTALL)"
echo
echo "Xyce needs flex and bison; make sure you have those setup"
echo "on your system. Sometimes on MacOS you will need to set"
echo "the environment FLEX_INCLUDE_DIR to point to the location"
echo "of FlexLexer.h."
echo
if [ "x`which bison`" = "x" ]
then
echo "bison not found!"
exit 1
fi
if [ "x`which flex`" = "x" ]
then
echo "flex not found!"
exit 1
fi
case `uname -s` in
Darwin|darwin) flex_odd=1;;
*) flex_odd=0;;
esac
# check for weird mac issue
if [ $flex_odd -eq 1 ]
then
res=`find /Applications/Xcode.app/Contents/Developer/Toolchains/ -name FlexLexer.h 2>/dev/null | sed 's/\(.*\)FlexLexer.h/\1/'`
if [ "x$res" = "x" ]
then
flexdir=
else
flexdir="-DFLEX_INCLUDE_DIR=$res"
fi
fi
echo "*** Build and install cmake ***"
./build_cmake.sh
export PATH=${XYCE_INSTALL}/bin:${PATH}
hash -r
echo "*** Build/install SuiteSparse ***"
(cd SuiteSparse && \
if [ ! -d build ]; then mkdir build; fi && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=$XYCE_INSTALL -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;amd" .. && \
make && make install || exit 1)
(cd $XYCE_INSTALL/include; ln -s suitesparse/* .)
echo "*** Build/install Trilinos with Xyce options ***"
(cd trilinos && \
if [ ! -d build ]; then mkdir build; fi && \
cd build &&
cmake \
-G "Unix Makefiles" \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_CXX_FLAGS="-O3 -fPIC" \
-DCMAKE_C_FLAGS="-O3 -fPIC" \
-DCMAKE_Fortran_FLAGS="-O3 -fPIC" \
-DCMAKE_INSTALL_PREFIX=$XYCE_INSTALL \
-DCMAKE_MAKE_PROGRAM="make" \
-DTrilinos_ENABLE_NOX=ON \
-DNOX_ENABLE_LOCA=ON \
-DTrilinos_ENABLE_EpetraExt=ON \
-DEpetraExt_BUILD_BTF=ON \
-DEpetraExt_BUILD_EXPERIMENTAL=ON \
-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON \
-DTrilinos_ENABLE_TrilinosCouplings=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Belos=ON \
-DTrilinos_ENABLE_Teuchos=ON \
-DTeuchos_ENABLE_COMPLEX=ON \
-DTrilinos_ENABLE_Amesos=ON \
-DAmesos_ENABLE_KLU=ON \
-DTrilinos_ENABLE_Amesos2=ON \
-DAmesos2_ENABLE_KLU2=ON \
-DAmesos2_ENABLE_Basker=ON \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_Stokhos=ON \
-DTrilinos_ENABLE_Kokkos=ON \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF \
-DTrilinos_ENABLE_CXX11=ON \
-DAMD_LIBRARY_DIRS=$XYCE_INSTALL/lib \
-DTPL_AMD_INCLUDE_DIRS=$XYCE_INSTALL/include \
-DTPL_ENABLE_AMD=ON \
-DTPL_ENABLE_BLAS=ON \
-DTPL_ENABLE_LAPACK=ON \
.. && \
make -j 3 && make install || exit 1)
echo "*** Build/install Xyce ***"
(cd Xyce &&
if [ ! -d build ]; then mkdir build; fi && \
cd build &&
cmake -DCMAKE_INSTALL_PREFIX=$XYCE_INSTALL $flexdir .. && \
make -j 3 && make xycecinterface && make install || exit 1)