source: issm/trunk-jpl/externalpackages/petsc/install-3.12-mac-solid_earth-static.sh@ 25612

Last change on this file since 25612 was 25612, checked in by jdquinn, 4 years ago

BUG: Fixes for latest version of gfortran

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2set -eu
3
4
5# NOTE: There is a single difference between the Linux and macOS
6# configurations, which is the addition of the -fallow-argument-mismatch
7# and -static-libgfortran options to FFLAGS on the macOS static
8# configurations. For the sake of consistency, we maintain separate files
9# for each, respective Linux and macOS configuration.
10#
11
12## Constants
13#
14VER="3.12.3"
15
16# Download source
17$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
18
19# Unpack source
20tar -zxvf petsc-${VER}.tar.gz
21
22# Cleanup
23rm -rf install src
24mkdir install src
25
26# Move source to 'src' directory
27mv petsc-${VER}/* src/
28rm -rf petsc-${VER}
29
30# Configure
31#
32# NOTE:
33# - Cannot use --with-fpic option when compiling static libs,
34#
35# Cannot determine compiler PIC flags if shared libraries is turned off
36# Either run using --with-shared-libraries or --with-pic=0 and supply the
37# compiler PIC flag via CFLAGS, CXXXFLAGS, and FCFLAGS
38#
39# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
40#
41# error: The Fortran compiler gfortran will not compile files that call
42# the same routine with arguments of different types.
43#
44# This has only been added to macOS static builds, but may be needed
45# elsewhere.
46#
47cd src
48./config/configure.py \
49 --prefix="${ISSM_DIR}/externalpackages/petsc/install" \
50 --PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
51 --with-shared-libraries=0 \
52 --CFLAGS="-fPIC" \
53 --CXXFLAGS="-fPIC" \
54 --FFLAGS="-fPIC -fallow-argument-mismatch -static-libgfortran" \
55 --with-debugging=0 \
56 --with-valgrind=0 \
57 --with-x=0 \
58 --with-ssl=0 \
59 --download-fblaslapack=1 \
60 --download-mpich=1 \
61 --download-metis=1 \
62 --download-parmetis=1 \
63 --download-scalapack=1 \
64 --download-mumps=1 \
65 --download-zlib=1 \
66 --download-hdf5=1
67
68# Compile and install
69make
70make install
Note: See TracBrowser for help on using the repository browser.