From 3d3ad213ca4b60421c9a80328e1316b23435958f Mon Sep 17 00:00:00 2001 From: kngott Date: Thu, 23 Jun 2022 13:39:59 -0700 Subject: [PATCH] NERSC Programming Environment prototype (#2848) --- Tools/GNUMake/sites/Make.nersc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Tools/GNUMake/sites/Make.nersc b/Tools/GNUMake/sites/Make.nersc index c8c938a627a..f894dcd7d7c 100644 --- a/Tools/GNUMake/sites/Make.nersc +++ b/Tools/GNUMake/sites/Make.nersc @@ -25,11 +25,16 @@ ifeq ($(which_computer),$(filter $(which_computer),perlmutter)) endif ifeq ($(USE_CUDA),TRUE) + ifdef NPE_VERSION + CFLAGS += -Xcompiler="$(filter-out -Wl%, $(wordlist 2,1024,$(shell mpicc -show 2> /dev/null)))" + CXXFLAGS += -Xcompiler="$(filter-out -Wl%, $(wordlist 2,1024,$(shell mpicxx -show 2> /dev/null)))" + else CFLAGS += -Xcompiler="$(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null))" CXXFLAGS += -Xcompiler="$(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null))" + endif else ifeq ($(USE_MPI),FALSE) - CFLAGS += $(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null)) - CXXFLAGS += $(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null)) + CFLAGS += $(wordlist 2,1024,$(shell cc -craype-verbose 2> /dev/null)) + CXXFLAGS += $(wordlist 2,1024,$(shell CC -craype-verbose 2> /dev/null)) endif ifeq ($(USE_MPI),TRUE) @@ -41,7 +46,9 @@ ifeq ($(which_computer),$(filter $(which_computer),perlmutter)) LIBRARIES += -lmpichf90 endif - includes += $(shell CC --cray-print-opts=cflags) + ifndef NPE_VERSION + includes += $(shell CC --cray-print-opts=cflags) + endif endif ifeq ($(USE_CUDA),TRUE) @@ -51,11 +58,23 @@ ifeq ($(which_computer),$(filter $(which_computer),perlmutter)) includes += $(CRAY_CUDATOOLKIT_INCLUDE_OPTS) endif + ifdef NPE_VERSION + includes += $(CRAY_CUDATOOLKIT_INCLUDE_OPTS) + endif + comm := , ifneq ($(BL_NO_FORT),TRUE) + ifdef NPE_VERSION + LIBRARIES += $(subst -Wl$(comm),-Xlinker=,$(wordlist 2,1024,$(shell mpifort -show))) + else LIBRARIES += $(subst -Wl$(comm),-Xlinker=,$(shell ftn --cray-print-opts=libs)) + endif else + ifdef NPE_VERSION + LIBRARIES += $(subst -Wl$(comm),-Xlinker=,$(wordlist 2,1024,$(shell mpicxx -show))) + else LIBRARIES += $(subst -Wl$(comm),-Xlinker=,$(shell CC --cray-print-opts=libs)) + endif endif ifneq ($(CUDA_ROOT),)