Skip to content

Commit

Permalink
NERSC Programming Environment prototype (AMReX-Codes#2848)
Browse files Browse the repository at this point in the history
  • Loading branch information
kngott authored Jun 23, 2022
1 parent 4872676 commit 3d3ad21
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions Tools/GNUMake/sites/Make.nersc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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),)
Expand Down

0 comments on commit 3d3ad21

Please sign in to comment.