openfoam/wmake/rules/General/mpi-rules
Mark Olesen 435be2e5ec CONFIG: improve flexibility of MPI specification
- it is now possible to include the selected mpi version in the
  top-level bashrc or prefs.sh file. For example,

      WM_MPLIB=OPENMPI-4.1.1  or  WM_MPLIB=openmpi-4.1.1

  after evaluation of the config.sh/mpi, this will define

      WM_MPLIB=OPENMPI-4.1.1  and  FOAM_MPI=openmpi-4.1.1

  During the wmake, the mpi-rules will first load the MPI 'family'
  rules (OPENMPI in this example) before trying to load
  version-specific rules if they exist.

  NOTE: the regular user-defined prefs system is unaffected by this
  change. This means it is still possible to use a file such as
  'prefs.openmpi' to define the preferred version instead or as well.
  However, it does mean inconsistent naming can be specified.
  For example, specify WM_MPLIB=OPENMPI-4.1.1 at the top-level but
  actually have FOAM_MPI=openmpi-4.0.6 in the prefs.openmpi file.
  This will make the value of WM_MPLIB misleading.

CONFIG: foamConfigurePaths support for sys-openmpi major version

CONFIG: cleanup any shadow env variables
2021-10-29 17:04:51 +02:00

40 lines
1.0 KiB
Plaintext

#------------------------------------------------------------------------------
# MPI rules
PFLAGS =
PINC =
PLIBS =
# Extract the family name. For example,
# SYSTEMOPENMPI4 -> SYSTEMOPENMPI
# OPENMPI-4.0.6 -> OPENMPI
#
MPLIB_FAMILY = $(shell echo "$(WM_MPLIB)" | sed -e 's/[-+.0-9~].*//')
# Base rules
ifneq ("$(MPLIB_FAMILY)","$(WM_MPLIB)")
sinclude $(GENERAL_RULES)/mplib$(MPLIB_FAMILY)
sinclude $(DEFAULT_RULES)/mplib$(MPLIB_FAMILY)
# system-specific
ifneq ("$(RULES)","$(DEFAULT_RULES)")
sinclude $(RULES)/mplib$(MPLIB_FAMILY)
endif
endif
# Specific rules
ifneq ("","$(WM_MPLIB)")
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)
# system-specific
ifneq ("$(RULES)","$(DEFAULT_RULES)")
sinclude $(RULES)/mplib$(WM_MPLIB)
endif
endif
# Default target MPI libdir is PROJECT lib/<mpi-name>
ifeq (,$(FOAM_MPI_LIBBIN))
FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI)
endif
#------------------------------------------------------------------------------