install_petsc.sh 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#! /bin/bash

set -e
set -x

ROOT=${PWD}

if [ ! -d install/ ]; then
   mkdir -p install
fi
11
INSTALL_PREFIX=${ROOT}/install
12
13
cd install

14
15
16
PETSC_VERSION="3.5.4"
PETSC_FILENAME="petsc-lite-${PETSC_VERSION}.tar.gz"

17
18
# install petsc
if [ ! -d petsc ]; then
19
   curl -o petsc.tar.gz "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/${PETSC_FILENAME}"
20
21
22
23
24
   mkdir petsc_tmp
   tar --strip-components=1 -xf petsc.tar.gz -C petsc_tmp
   rm petsc.tar.gz
   cd petsc_tmp
   # minimal petsc configuration, just for test purposes
25
   ./configure --prefix=${INSTALL_PREFIX}/petsc/${PETSC_VERSION}/ --with-pic=1 --with-debugging=0 \
26
27
28
29
30
31
32
33
               --with-clanguage=c++ --with-cxx-dialect=c++11 \
               --with-metis=1 --download-metis=yes \
               --with-parmetis=1 --download-parmetis=yes \
               --with-fblaslapack=1 --download-fblaslapack=yes
   make && make install
   cd ${ROOT}/install
   rm -rf petsc_tmp
fi
34
35
36
37
38
39

# set a symbolic link to the latest boost installation
if [ ! -e ${INSTALL_PREFIX}/petsc/latest ]; then
  rm -f ${INSTALL_PREFIX}/petsc/latest
fi
ln -s ${INSTALL_PREFIX}/petsc/${PETSC_VERSION} ${INSTALL_PREFIX}/petsc/latest