-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathpetsc.package
165 lines (129 loc) · 4.49 KB
/
petsc.package
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
################################################################################
## PETSc ##
################################################################################
VERSION=3.22.2;CHECKSUM=d18caed83d1bf351c4ccb574b0b376e5
#VERSION=3.21.6;CHECKSUM=ab98f5f22731549eda3ae2704b05e9f7
#VERSION=3.21.4;CHECKSUM=e8d76467696fcff970bd56c93dd83476
#VERSION=3.19.4;CHECKSUM=477c30e120498dba4fad01020d4b0ffc
#VERSION=3.18.6;CHECKSUM=8eb924facc586b3368536ad2b9df1d35
#VERSION=3.16.4
#CHECKSUM=7de82ee5543cba9a7c12ca00c81f0b87
#VERSION=3.13.1
#CHECKSUM=b8b99c4a16fbc7d6694a70af044dbaac
#VERSION=3.11.3
#CHECKSUM=e04cbb1aaccde4a33c8843e75a1fba15
#VERSION=3.7.6
#CHECKSUM=152c1f15f535af22fc015de1d3099db3
#VERSION=3.6.4
#CHECKSUM=e7a5253621253eef8f5a19ddc03dd0d4
NAME=petsc-${VERSION}
SOURCE=https://web.cels.anl.gov/projects/petsc/download/release-snapshots/
PACKING=.tar.gz
EXTRACTSTO=petsc-${VERSION}
BUILDCHAIN=custom
INSTALL_PATH=${INSTALL_PATH}/${EXTRACTSTO}
################################################################################
with64bit=0
if [ ${USE_64_BIT_INDICES} = ON ]; then
with64bit=1
else
with64bit=0
fi
CONFOPTS="\
--with-debugging=0 \
--with-shared-libraries=1 \
--with-mpi=1 \
--with-x=0 \
--with-64-bit-indices=${with64bit}"
# It would seem simpler to put the {C|CXX|F}OPTFLAGS directly into the
# CONFOPTS variable, but there is no easy way to quote the
# multiarguments and retain the quotes correctly when passing to
# PETSc. Instead, we specify the individual *OPTFLAGS in the call to
# ./configure below.
if [ ${NATIVE_OPTIMIZATIONS} = ON ]; then
OPTFLAGS="-O3 -march=native -mtune=native"
else
# These are the PETSc default:
OPTFLAGS="-g -O"
fi
for external_pkg in hypre; do
CONFOPTS="${CONFOPTS} --download-${external_pkg}=1"
done
if [ ! -z "${CC}" ]; then
CONFOPTS="${CONFOPTS} CC=${CC}"
fi
if [ ! -z "${CXX}" ]; then
CONFOPTS="${CONFOPTS} CXX=${CXX}"
fi
if [ ! -z "${FC}" ]; then
CONFOPTS="${CONFOPTS} FC=${FC}"
fi
if [ ! -z "${F77}" ]; then
CONFOPTS="${CONFOPTS} F77=${F77}"
fi
if [ ! -z "${F90}" ]; then
CONFOPTS="${CONFOPTS} F90=${F90}"
fi
if [ ! -z "${MKL_DIR}" ]; then
cecho ${INFO} "petsc: configuration with MKL"
cecho ${INFO} "petsc: configuration with blas-lapack-dir=${MKL_DIR}"
CONFOPTS="${CONFOPTS} --with-blas-lapack-dir=${MKL_DIR}"
else
if [ ! -z "${BLAS_LIB}" ]; then
cecho ${INFO} "petsc: configuration with --with-blas-lapack-lib=${BLAS_LIB}"
CONFOPTS="${CONFOPTS} --with-blas-lapack-lib=${BLAS_LIB}"
fi
fi
# Add ParMETIS, if present
if [ ! -z "${PARMETIS_DIR}" ]; then
cecho ${INFO} "PETSc: configuration with ParMETIS"
CONFOPTS="${CONFOPTS} \
--with-parmetis-dir=${PARMETIS_DIR} \
--with-metis-dir=${PARMETIS_DIR}"
fi
if [ ! -z "${SCALAPACK_DIR}" ]; then
cecho ${INFO} "PETSc: configuration with SCALAPACK"
CONFOPTS="${CONFOPTS} \
--with-scalapack-dir=${SCALAPACK_DIR}"
else
CONFOPTS="${CONFOPTS} --download-scalapack=1"
fi
if [ ! -z "${MUMPS_DIR}" ]; then
cecho ${INFO} "PETSc: configuration with MUMPS"
CONFOPTS="${CONFOPTS} \
--with-mumps-dir=${MUMPS_DIR}"
else
CONFOPTS="${CONFOPTS} --download-mumps=1"
fi
################################################################################
package_specific_setup () {
cd ${BUILDDIR}
cp -rf ${UNPACK_PATH}/${EXTRACTSTO}/* .
# Make sure we don't pick up any environment copies of PETSc variables. This
# duplicates the same unset commands in candi.sh to ensure that, should this
# function run as a shell script (i.e., not with the source command), they
# are not reset by .bash_profile or some other shell initialization script.
unset PETSC_DIR
unset PETSC_ARCH
${PYTHON_INTERPRETER} ./configure --prefix=${INSTALL_PATH} ${CONFOPTS} COPTFLAGS="${OPTFLAGS}" CXXOPTFLAGS="${OPTFLAGS}" FOPTFLAGS="${OPTFLAGS}"
quit_if_fail "petsc ./configure failed"
make all install
quit_if_fail "petsc make all install failed"
}
package_specific_register () {
export PETSC_DIR=${INSTALL_PATH}
if [ ! -z "${SCALAPACK_DIR}" ]; then
export SCALAPACK_DIR=${INSTALL_PATH}
fi
}
package_specific_conf () {
# Generate configuration file
CONFIG_FILE=${CONFIGURATION_PATH}/${EXTRACTSTO}
rm -f ${CONFIG_FILE}
echo "
export PETSC_DIR=${INSTALL_PATH}
" >> ${CONFIG_FILE}
if [ ! -z "${SCALAPACK_DIR}" ]; then
echo "export SCALAPACK_DIR=${INSTALL_PATH}" >> ${CONFIG_FILE}
fi
}