mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: stricter handling of openmp vs no-openmp
- give precedence to ~openmp (-no-openmp) over +openmp (-openmp) in the general rules and in the Makefile. This makes it robuster when specifying +openmp in general, but ~openmp for specific build components. - disable openmp for OSspecific and Pstream components. Neither should contain any openmp code anyhow. Additionally, since OSspecific is generally built as a static object, it can become problematic (eg, with AMD ROCm) if the compiler generates information that openmp is required but then uses static linkage.
This commit is contained in:
@ -52,9 +52,13 @@ sinclude $(RULES)/general
|
||||
sinclude $(RULES)/c++
|
||||
endif
|
||||
|
||||
# Add compile flags for openmp
|
||||
# Compile flags for openmp
|
||||
# - if enabled (+openmp) and not disabled (~openmp).
|
||||
# - disable has higher precedence
|
||||
ifeq (,$(findstring ~openmp,$(WM_COMPILE_CONTROL)))
|
||||
ifneq (,$(findstring +openmp,$(WM_COMPILE_CONTROL)))
|
||||
c++FLAGS += $(COMP_OPENMP)
|
||||
c++FLAGS += $(COMP_OPENMP)
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(GENERAL_RULES)/transform
|
||||
|
||||
Reference in New Issue
Block a user