Skip to content

Commit 81a993c

Browse files
committed
Minor tweaks to the config file for macOS
In the time since this config file was written, the way that the build-system handles unsafe floating-point optimizations has been streamlined. These minor tweaks reflect those changes (the tweaks also make the structure of darwin_clang.cmake more closely mirror the structure of linux_gcc.cmake)
1 parent 073c07f commit 81a993c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

config/darwin_clang.cmake

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# This is the configuration for a generic macOS installation using clang and
66
# gfortran
7-
# - this was tested on clean installation of version 12.5 of macOS on an
7+
# - this was tested on a clean installation of version 12.5 of macOS on an
88
# Intel-based MacBook Pro on July 24, 2022
99
# - historically there were challenges associated with installing Charm++ and
1010
# Cello/Enzo-E on Macs, but these issues seem to have been implicitly
@@ -36,15 +36,18 @@ if(NOT __processedUserDefaults)
3636
set(CMAKE_Fortran_COMPILER gfortran CACHE STRING "")
3737
set(CMAKE_Fortran_FLAGS "-ffixed-line-length-132" CACHE STRING "Default Fortran flags")
3838

39-
# Set some architecture-specific optimization flags
40-
set(__ARCH_C_OPT_FLAGS "-O3 -DNDEBUG -funroll-loops")
39+
# these flag(s) are currently only used when using openmp-simd optimizations
40+
# (to specify available/prefered instruction sets).
41+
# This particular value tells the compiler to optimize the code for the
42+
# instruction set of the machine used to compile the code.
43+
set(CONFIG_ARCH_FLAGS "-march=native")
4144

42-
set(CMAKE_C_FLAGS_RELEASE "${__ARCH_C_OPT_FLAGS}")
43-
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g ${__ARCH_C_OPT_FLAGS}")
44-
set(CMAKE_CXX_FLAGS_RELEASE "${__ARCH_C_OPT_FLAGS}")
45-
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g ${__ARCH_C_OPT_FLAGS}")
45+
# add flag to unroll loops (this flag would also be enabled anyways when
46+
# OPTIMIZE_FP=TRUE)
47+
set(CMAKE_C_FLAGS "-funroll-loops" CACHE STRING "Default C flags")
48+
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "Default C++ flags")
4649

47-
# Setting package paths (e.g., Grackle)
50+
# Setting package paths (e.g., Grackle) - (meant for personal machine files)
4851

4952
# Mark done
5053
set(__processedUserDefaults ON)

0 commit comments

Comments
 (0)