From: Menno Fraters Date: Thu, 4 Nov 2021 00:47:47 +0000 (-0700) Subject: Add arch native flags to p4est and trilinos if native optimazations is on. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F267%2Fhead;p=candi.git Add arch native flags to p4est and trilinos if native optimazations is on. --- diff --git a/deal.II-toolchain/packages/p4est.package b/deal.II-toolchain/packages/p4est.package index 3cba833..46869d8 100644 --- a/deal.II-toolchain/packages/p4est.package +++ b/deal.II-toolchain/packages/p4est.package @@ -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 diff --git a/deal.II-toolchain/packages/trilinos.package b/deal.II-toolchain/packages/trilinos.package index 9ba3c4a..cd5a443 100644 --- a/deal.II-toolchain/packages/trilinos.package +++ b/deal.II-toolchain/packages/trilinos.package @@ -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