source: issm/trunk-jpl/externalpackages/petsc/install-3.14-mac.sh@ 27544

Last change on this file since 27544 was 27544, checked in by jdquinn, 2 years ago

BUG: Use PETSc 3.14 for Intel-based Mac

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2set -eu
3
4
5## Constants
6#
7VER="3.14.6"
8
9PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
10PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
11
12# Download source
13$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
14
15# Unpack source
16tar -zxvf petsc-${VER}.tar.gz
17
18# Cleanup
19rm -rf ${PREFIX} ${PETSC_DIR}
20mkdir -p ${PETSC_DIR}
21
22# Move source to $PETSC_DIR
23mv petsc-${VER}/* ${PETSC_DIR}
24rm -rf petsc-${VER}
25
26# Modify source so that Python 3 can be used to compile PETSc
27sed -i '' 's|#!/usr/bin/env python|#!/usr/bin/env python3|g' ${PETSC_DIR}/config/configure.py
28
29# Modify source so that Python >= 3.9 can be used to compile PETSc
30sed -i '' 's|thread.isAlive|thread.is_alive|g' ${PETSC_DIR}/config/BuildSystem/script.py
31
32# Configure
33#
34# NOTE:
35# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12.
36# (may need to remove it for earlier versions not using the C99 standard).
37# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
38#
39# error: The Fortran compiler gfortran will not compile files that call
40# the same routine with arguments of different types.
41#
42# for gfortran 10 or later (may need to remove it for earlier versions).
43#
44cd ${PETSC_DIR}
45./config/configure.py \
46 --prefix="${PREFIX}" \
47 --PETSC_DIR="${PETSC_DIR}" \
48 --CFLAGS="-Wno-error=implicit-function-declaration" \
49 --FFLAGS="-fallow-argument-mismatch" \
50 --with-debugging=0 \
51 --with-valgrind=0 \
52 --with-x=0 \
53 --with-ssl=0 \
54 --with-pic=1 \
55 --download-fblaslapack=1 \
56 --download-mpich=1 \
57 --download-metis=1 \
58 --download-parmetis=1 \
59 --download-scalapack=1 \
60 --download-mumps=1 \
61 --download-zlib=1 \
62 --download-hdf5=1
63
64# Compile and install
65make
66make install
Note: See TracBrowser for help on using the repository browser.