-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_petsc.sh
executable file
·61 lines (52 loc) · 1.84 KB
/
build_petsc.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
#!/bin/bash
set -e
source env_build.sh
# export CXXFLAGS="${CXXFLAGS} -std=c++0x"
echo "Downloading and building PETSc ${PETSC_VERSION}"
mkdir -p $BUILD_DIR/tar
# FROM https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=petsc-git
generic_flags="-fPIC -O3 -march=x86-64 -mtune=generic"
# generic_flags="-fPIC -fopenmp -O3 -march=amdfam10 -mtune=generic"
export COPTFLAGS="-O3"
export CXXOPTFLAGS="-O3"
export FOPTFLAGS="-O3"
export CPPFLAGS="$generic_flags"
export CFLAGS="$generic_flags"
export CXXFLAGS="$generic_flags"
export FFLAGS="$generic_flags"
export FCFLAGS="$generic_flags"
export F90FLAGS="$generic_flags"
export F77FLAGS="$generic_flags"
cd ${BUILD_DIR} && \
wget --quiet --read-timeout=10 -nc -P tar/ http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${PETSC_VERSION}.tar.gz && \
tar -xzf tar/petsc-lite-${PETSC_VERSION}.tar.gz && \
cd petsc-${PETSC_VERSION} && \
python2 ./configure \
--COPTFLAGS="$COPTFLAGS" \
--CXXOPTFLAGS="$CXXOPTFLAGS" \
--CPPFLAGS="$CPPFLAGS" \
--FOPTFLAGS="$FOPTFLAGS" \
--CFLAGS="$CFLAGS" \
--CXXFLAGS="$CXXFLAGS" \
--FFLAGS="$FFLAGS" \
--FCFLAGS="$FCFLAGS" \
--F90FLAGS="$F90FLAGS" \
--F77FLAGS="$F77FLAGS" \
--with-fortran-bindings=no \
--with-debugging=0 \
--download-blacs \
--download-hypre \
--download-metis \
--download-parmetis \
--download-mumps \
--download-ptscotch \
--download-scalapack \
--download-spai \
--download-suitesparse \
--download-superlu \
--prefix=${PREFIX} && \
make MAKE_NP=${BUILD_THREADS} && make install
if [ "$continue_on_key" = true ]; then
echo "Press any key to continue..."
read -n 1
fi