]> https://gitweb.dealii.org/ - candi.git/commitdiff
Add arch native flags to p4est and trilinos if native optimazations is on. 267/head
authorMenno Fraters <menno.fraters@tutanota.com>
Thu, 4 Nov 2021 00:47:47 +0000 (17:47 -0700)
committerMenno Fraters <menno.fraters@tutanota.com>
Thu, 4 Nov 2021 00:47:47 +0000 (17:47 -0700)
deal.II-toolchain/packages/p4est.package
deal.II-toolchain/packages/trilinos.package

index 3cba8330a2ca199a0f93581cf72aa4e99e849298..46869d84f86942e3cd99331ead84bed23612acd1 100644 (file)
@@ -39,7 +39,11 @@ package_specific_setup() {
     fi
 
     if test -z "${CFLAGS}" -a -z "${P4EST_CFLAGS_FAST}"; then
-        export CFLAGS_FAST="-O2"
+         if [ ${NATIVE_OPTIMIZATIONS} = OFF ]; then
+             export CFLAGS_FAST="-O2"
+         else
+             export CFLAGS_FAST="-O2 -march=native"
+         fi
     else
         export CFLAGS_FAST="${CFLAGS} ${P4EST_CFLAGS_FAST}"
     fi
index 9ba3c4a893899b3b13f8c0b5039c896893162e23..cd5a443ad9cc8a9295a8d5b35c4baa5b37157229 100644 (file)
@@ -153,10 +153,17 @@ if [ ! -z "${FC}" ]; then
       -D CMAKE_Fortran_COMPILER=${FC}"
 fi
 
+if [ ${NATIVE_OPTIMIZATIONS} = OFF ]; then
 CONFOPTS="${CONFOPTS} \
   -D CMAKE_CXX_FLAGS:STRING='-fPIC -g -O3' \
   -D CMAKE_C_FLAGS:STRING='-fPIC -g -O3' \
   -D CMAKE_FORTRAN_FLAGS:STRING='-g -O3'"
+else
+CONFOPTS="${CONFOPTS} \
+  -D CMAKE_CXX_FLAGS:STRING='-fPIC -g -O3 -march=native' \
+  -D CMAKE_C_FLAGS:STRING='-fPIC -g -O3 -march=native' \
+  -D CMAKE_FORTRAN_FLAGS:STRING='-g -O3 -march=native'"
+fi
 
 # Add ParMETIS, if present
 if [ ! -z "${PARMETIS_DIR}" ]; then

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.