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
RevLine 
[25672]1#!/bin/bash
2set -eu
3
4
5## Constants
[26950]6#
[27000]7VER="3.14.6"
[25672]8
[26950]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
[25672]12# Download source
[26950]13$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
[25672]14
15# Unpack source
16tar -zxvf petsc-${VER}.tar.gz
17
18# Cleanup
[26950]19rm -rf ${PREFIX} ${PETSC_DIR}
[27202]20mkdir -p ${PETSC_DIR}
[25672]21
[26950]22# Move source to $PETSC_DIR
23mv petsc-${VER}/* ${PETSC_DIR}
[25672]24rm -rf petsc-${VER}
25
[27544]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
[25672]32# Configure
[25800]33#
34# NOTE:
[26950]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).
[25800]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#
[26950]44cd ${PETSC_DIR}
[25672]45./config/configure.py \
[26950]46 --prefix="${PREFIX}" \
47 --PETSC_DIR="${PETSC_DIR}" \
[25800]48 --CFLAGS="-Wno-error=implicit-function-declaration" \
49 --FFLAGS="-fallow-argument-mismatch" \
[25672]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
[25713]65make
66make install
Note: See TracBrowser for help on using the repository browser.