-
Notifications
You must be signed in to change notification settings - Fork 95
/
.build_petsc_for_ci.sh
executable file
·61 lines (49 loc) · 1.6 KB
/
.build_petsc_for_ci.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
#!/bin/bash
set -e
if test $BUILD_PETSC ; then
if [[ ! -d $HOME/local/petsc/include/petsc ]] || test $1 ; then
echo "****************************************"
echo "Building PETSc"
echo "****************************************"
branch=${1:-release}
git clone -b $branch https://gitlab.com/petsc/petsc.git petsc --depth=1
unset PETSC_DIR
unset PETSC_ARCH
pushd petsc
./configure \
--with-mpi=yes \
--with-precision=double \
--with-scalar-type=real \
--with-shared-libraries=1 \
--with-debugging=0 \
{C,CXX,F}OPTFLAGS="-O3" \
--prefix=$HOME/local/petsc
make && make install
popd
echo "****************************************"
echo " Finished building PETSc"
echo "****************************************"
echo "****************************************"
echo "Building SLEPc"
echo "****************************************"
git clone -b $branch https://gitlab.com/slepc/slepc.git slepc --depth=1
pushd slepc
unset SLEPC_DIR
unset SLEPC_ARCH
PETSC_DIR=$HOME/local/petsc ./configure --prefix=$HOME/local/slepc
make SLEPC_DIR=$(pwd) PETSC_DIR=$HOME/local/petsc
make SLEPC_DIR=$(pwd) PETSC_DIR=$HOME/local/petsc install
popd
echo "****************************************"
echo " Finished building SLEPc"
echo "****************************************"
else
echo "****************************************"
echo " PETSc already installed"
echo "****************************************"
fi
else
echo "****************************************"
echo " PETSc not requested"
echo "****************************************"
fi