mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +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:
@ -6,7 +6,7 @@
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2019-2022 OpenCFD Ltd.
|
||||
# Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -19,7 +19,7 @@
|
||||
#
|
||||
# Embedded Control Parameters
|
||||
#
|
||||
# WM_COMPILE_CONTROL (+openmp)
|
||||
# WM_COMPILE_CONTROL (+openmp | ~openmp)
|
||||
# WM_COMPILE_CONTROL (~openfoam)
|
||||
# WM_OSTYPE (windows)
|
||||
#
|
||||
@ -62,9 +62,13 @@ SYS_INC =
|
||||
SYS_LIBS =
|
||||
|
||||
# Add linkage for openmp into the system libraries
|
||||
# - if enabled (+openmp) and not disabled (~openmp).
|
||||
# - disable has higher precedence
|
||||
ifeq (,$(findstring ~openmp,$(WM_COMPILE_CONTROL)))
|
||||
ifneq (,$(findstring +openmp,$(WM_COMPILE_CONTROL)))
|
||||
SYS_LIBS = $(LINK_OPENMP)
|
||||
endif
|
||||
endif
|
||||
|
||||
# These are set by Make/options
|
||||
EXE_INC =
|
||||
|
||||
Reference in New Issue
Block a user