@@ -70,14 +70,20 @@ PETSC_DOWNLOAD := $(PETSC_DOWNLOAD) --download-cmake
7070endif
7171PETSC_DOWNLOAD_C := $(PETSC_DOWNLOAD_C ) --download-htool
7272unexport MAKEFLAGS
73- COMMON_FLAGS := --with-debugging=0 --with-ssl=0 --with-x=0 --with-fortran-bindings=0 --with-hg=0 --with-c2html=0 --with-coverage=0 --with-syclc=0 --with-hipc=0 --with-cudac=0 --with-tau-perfstubs=0 --with-python=0 \
73+ COMMON_FLAGS := --with-debugging=0 FOPTFLAGS=-O --with-ssl=0 --with-x=0 --with-fortran-bindings=0 --with-hg=0 --with-c2html=0 --with-coverage=0 --with-syclc=0 --with-hipc=0 --with-cudac=0 --with-tau-perfstubs=0 --with-python=0 \
7474 --download-slepc --download-hpddm
7575
7676ifneq ($(wildcard ~/.petsc_pkg) ,)
7777COMMON_FLAGS += --with-packages-download-dir=~/.petsc_pkg
7878endif
79+
7980ifeq ($(FF_generic_petsc ) , yes)
80- COMMON_FLAGS += --with-avx512-kernels=0 CFLAGS+='-mtune=generic' CXXFLAGS+='-mtune=generic' FFLAGS+='-mtune=generic'
81+ COMMON_FLAGS += COPTFLAGS=-O2 CXXOPTFLAGS=-O2 --with-avx512-kernels=0 FFLAGS+='-mtune=generic'
82+ ifeq ($(WIN32DLLTARGET ) ,)
83+ COMMON_FLAGS += CFLAGS+='-mtune=generic' CXXFLAGS+='-mtune=generic'
84+ endif
85+ else
86+ COMMON_FLAGS += COPTFLAGS=-O3 CXXOPTFLAGS=-O3
8187endif
8288
8389ifeq ($(FC ) ,)
@@ -126,10 +132,12 @@ endif
126132endif
127133
128134ifneq ($(WIN32DLLTARGET ) ,)
129- COMMON_FLAGS += --with-shared-libraries=0 \
130- CXXFLAGS+='-fno-stack-protector -Wno-format -Wno-format-extra-args' \
131- CFLAGS+='-fno-stack-protector -Wno-format -Wno-format-extra-args -Wno-maybe-uninitialized' \
132- --with-mpiexec='/C/Program\ Files/Microsoft\ MPI/Bin/mpiexec'
135+ COMMON_FLAGS += --with-shared-libraries=0 --with-mpiexec='/C/Program\ Files/Microsoft\ MPI/Bin/mpiexec'
136+ PETSC_CXXFLAGS := -fno-stack-protector -Wno-format -Wno-format-extra-args
137+ ifeq ($(FF_generic_petsc ) , yes)
138+ PETSC_CXXFLAGS += -mtune=generic
139+ endif
140+ COMMON_FLAGS += CFLAGS+='$(PETSC_CXXFLAGS ) -Wno-maybe-uninitialized' CXXFLAGS+='$(PETSC_CXXFLAGS ) '
133141ifneq ($(FC ) ,)
134142ifneq ($(wildcard ~/.petsc_pkg) ,)
135143PETSC_DOWNLOAD += '--download-slepc-configure-arguments=--with-packages-build-dir=$(PETSC_DIR ) /fr/externalpackages --download-arpack --with-packages-download-dir=~/.petsc_pkg'
0 commit comments