ENH: add wmake -show-mpi-compile, -show-mpi-link options

- useful for diagnosing which MPI paths and flags are being used
  when setting up for a new MPI configuration.
This commit is contained in:
Mark Olesen 2020-12-15 21:45:59 +01:00
parent c77194e6a1
commit d5260b18d7
2 changed files with 20 additions and 5 deletions

View File

@ -5,11 +5,10 @@
# \\ / A nd | www.openfoam.com # \\ / A nd | www.openfoam.com
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Copyright (C) 2019 OpenCFD Ltd. # Copyright (C) 2019-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, licensed under GNU General Public License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
# <http://www.gnu.org/licenses/>.
# #
# File # File
# wmake/makefiles/info # wmake/makefiles/info
@ -46,6 +45,7 @@ EXT_SO = .so
GENERAL_RULES = $(WM_DIR)/rules/General GENERAL_RULES = $(WM_DIR)/rules/General
include $(GENERAL_RULES)/general include $(GENERAL_RULES)/general
include $(GENERAL_RULES)/mpi-rules
# Commands # Commands
COMPILE_C := $(strip $(cc) $(cFLAGS)) COMPILE_C := $(strip $(cc) $(cFLAGS))
@ -95,4 +95,14 @@ cflags-arch:
cxxflags-arch: cxxflags-arch:
@echo "$(strip $(c++ARCH))" @echo "$(strip $(c++ARCH))"
#----------------------------- vim: set ft=make: ------------------------------ # Like openmpi mpicc --showme:compile
.PHONY: mpi-compile
mpi-compile:
@echo "$(strip $(PINC))"
# Like openmpi mpicc --showme:link
.PHONY: mpi-link
mpi-link:
@echo "$(strip $(PLIBS))"
#------------------------------------------------------------------------------

View File

@ -86,6 +86,7 @@ cat<<HELP_FULL
-module-prefix=TYPE Specify FOAM_MODULE_PREFIX as predefined type -module-prefix=TYPE Specify FOAM_MODULE_PREFIX as predefined type
(u,user | g,group | o,openfoam) (u,user | g,group | o,openfoam)
-no-scheduler Disable scheduled parallel compilation -no-scheduler Disable scheduled parallel compilation
-show-api Print api value (from Make rules) -show-api Print api value (from Make rules)
-show-ext-so Print shared library extension (with '.' separator) -show-ext-so Print shared library extension (with '.' separator)
-show-c Print C compiler value -show-c Print C compiler value
@ -98,6 +99,9 @@ cat<<HELP_FULL
-show-compile-cxx Same as '-show-cxx -show-cxxflags' -show-compile-cxx Same as '-show-cxx -show-cxxflags'
-show-path-c Print path to C compiler -show-path-c Print path to C compiler
-show-path-cxx Print path to C++ compiler -show-path-cxx Print path to C++ compiler
-show-mpi-compile Print mpi-related flags used when compiling
-show-mpi-link Print mpi-related flags used when linking
HELP_FULL HELP_FULL
fi fi
@ -263,7 +267,8 @@ do
-show-api | -show-ext-so | \ -show-api | -show-ext-so | \
-show-compile-c | -show-c | -show-cflags | -show-cflags-arch | \ -show-compile-c | -show-c | -show-cflags | -show-cflags-arch | \
-show-compile-cxx | -show-cxx | -show-cxxflags | -show-cxxflags-arch ) -show-compile-cxx | -show-cxx | -show-cxxflags | -show-cxxflags-arch | \
-show-mpi-compile | -show-mpi-link )
printInfo "${1#-show-}" printInfo "${1#-show-}"
optShow=true optShow=true
;; ;;