]> https://gitweb.dealii.org/ - candi.git/commitdiff
Add arch native flags to p4est and trilinos if native optimazations is on.
authorMenno Fraters <menno.fraters@tutanota.com>
Thu, 4 Nov 2021 00:47:47 +0000 (17:47 -0700)
committerUwe Köcher <mail@uwe.koecher.cc>
Fri, 29 Apr 2022 17:32:42 +0000 (19:32 +0200)
deal.II-toolchain/packages/p4est.package
deal.II-toolchain/packages/trilinos.package

index 12f4a0001f469a0f805cd98064b3ade7a61e425e..2d892c83f5b3e2017cb860e46d559d9b9916224c 100644 (file)
@@ -47,7 +47,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.