install_petsc.sh 853 Bytes
Newer Older
1
2
3
4
5
6
7
#! /bin/bash

set -e
set -x

ROOT=${PWD}

8
9
10
PETSC_VERSION="3.5.4"
PETSC_FILENAME="petsc-lite-${PETSC_VERSION}.tar.gz"

11
12
13
14
15
16
INSTALL_PREFIX=${ROOT}/install
mkdir -p ${INSTALL_PREFIX}

BUILD_DIR=/tmp/$USER/petsc_build
mkdir -p ${BUILD_DIR}

17
# install petsc
18
19
20
21
if [ ! -d ${INSTALL_PREFIX}/petsc ]; then
  curl -SL "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${PETSC_FILENAME}" \
    | tar --strip-components=1 -xzC ${BUILD_DIR}
   cd ${BUILD_DIR}
22
   # minimal petsc configuration, just for test purposes
23
   ./configure --prefix=${INSTALL_PREFIX}/petsc --with-pic=1 \
24
25
26
               --with-clanguage=c++ --with-debugging=0 \
               --with-metis=1       --download-metis=yes \
               --with-parmetis=1    --download-parmetis=yes \
27
28
               --with-fblaslapack=1 --download-fblaslapack=yes
   make && make install
29
   rm -rf ${BUILD_DIR}
30
fi