]> https://gitweb.dealii.org/ - candi.git/commitdiff
fix PETSc with optimization flags 307/head
authorTimo Heister <timo.heister@gmail.com>
Sun, 28 Aug 2022 14:39:59 +0000 (10:39 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sun, 28 Aug 2022 14:39:59 +0000 (10:39 -0400)
fixes #306

I tried various combinations of single/double quotes and
reglob-protecting ${CONFOPTS} when passing to ./configure but none of
the options worked (PETSc either only picks up -O3 or fails to configure
with '-O3).

deal.II-toolchain/packages/petsc.package

index 6d62696149c1d2a47c1a3ed9c5efd86233c9094c..310ae0be32529679b343e5e8181613e8a1e236d7 100644 (file)
@@ -43,11 +43,16 @@ CONFOPTS="\
   --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
-    CONFOPTS="${CONFOPTS} \
-      COPTFLAGS='-O3 -march=native -mtune=native' \
-      CXXOPTFLAGS='-O3 -march=native -mtune=native' \
-      FOPTFLAGS='-O3 -march=native -mtune=native'"
+    OPTFLAGS="-O3 -march=native -mtune=native"
+else
+    # These are the PETSc default:
+    OPTFLAGS="-g -O"
 fi
 
 for external_pkg in hypre; do
@@ -118,7 +123,7 @@ package_specific_setup () {
     # make sure no other invalid PETSC_DIR is set:
     unset PETSC_DIR
     
-    ${PYTHON_INTERPRETER} ./configure --prefix=${INSTALL_PATH} ${CONFOPTS}
+    ${PYTHON_INTERPRETER} ./configure --prefix=${INSTALL_PATH} ${CONFOPTS} COPTFLAGS="${OPTFLAGS}" CXXOPTFLAGS="${OPTFLAGS}" FOPTFLAGS="${OPTFLAGS}"
     quit_if_fail "petsc ./configure failed"
     
     make all install

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.