Skip to content
Snippets Groups Projects
Verified Commit 018f69b6 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Windows package: stronger compiler optimization flags

– enable maximum optimization (-O3), which in particular triggers code
  auto-vectorization
– raise the minimal architectural requirement to match MSYS2 policy
  (roughly requires CPUs from ~2006/7+)
parent 39626726
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,11 @@ BASENAME=dynare-$VERSION ...@@ -54,6 +54,11 @@ BASENAME=dynare-$VERSION
LIB64="$ROOT_DIRECTORY"/deps/lib64 LIB64="$ROOT_DIRECTORY"/deps/lib64
LIB64_MSYS2="$ROOT_DIRECTORY"/deps/lib64-msys2 LIB64_MSYS2="$ROOT_DIRECTORY"/deps/lib64-msys2
# Set compilation flags
# For the architectural baseline, we follow MSYS2:
# https://www.msys2.org/news/#2022-10-18-new-minimum-hardware-requirements-cpus-from-20067
arch_flags="-march=nocona -msahf -mtune=generic"
export CFLAGS="-O3 $arch_flags"
# MSYS2 libraries are now built with -fstack-protector-strong, see: # MSYS2 libraries are now built with -fstack-protector-strong, see:
# https://www.msys2.org/news/#2022-10-23-mingw-packages-now-built-with-d_fortify_source2-and-fstack-protector-strong # https://www.msys2.org/news/#2022-10-23-mingw-packages-now-built-with-d_fortify_source2-and-fstack-protector-strong
# As of 2023-01-03, when linking against HDF5 (and possibly other libraries), # As of 2023-01-03, when linking against HDF5 (and possibly other libraries),
...@@ -64,7 +69,8 @@ LIB64_MSYS2="$ROOT_DIRECTORY"/deps/lib64-msys2 ...@@ -64,7 +69,8 @@ LIB64_MSYS2="$ROOT_DIRECTORY"/deps/lib64-msys2
# and there seems to be no easy way of linking it statically. # and there seems to be no easy way of linking it statically.
# Also note that adding this flag is not necessary when building from MSYS2 shell. # Also note that adding this flag is not necessary when building from MSYS2 shell.
# Maybe revisit this once our runners are upgraded to Debian “Bookworm” 12. # Maybe revisit this once our runners are upgraded to Debian “Bookworm” 12.
export CXXFLAGS="-O2 -fstack-protector" export CXXFLAGS="-O3 $arch_flags -fstack-protector"
export FCFLAGS="-O3 $arch_flags"
# Go to source root directory # Go to source root directory
cd .. cd ..
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment