Skip to content

Commit

Permalink
put USE_HDF5 in the GNUMake build system (AMReX-Codes#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers authored and dwillcox committed Oct 3, 2020
1 parent 63fd846 commit 06a7b20
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
7 changes: 1 addition & 6 deletions Tests/HDF5Benchmark/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEBUG = FALSE

DIM = 3

COMP = gnu
COMP = gnu

PRECISION = DOUBLE

Expand All @@ -28,11 +28,6 @@ include $(AMREX_HOME)/Tools/GNUMake/Make.rules

USE_HDF5 = TRUE
HDF5_HOME = $(HOME)/hdf5/develop_build/hdf5
ifeq ($(USE_HDF5), TRUE)
DEFINES += -DAMREX_USE_HDF5
INCLUDE_LOCATIONS += $(HDF5_HOME)/include
LIBRARIES += -lhdf5 -lz -ldl -L$(HDF5_HOME)/lib
endif

# To use HDF5 asynchronous I/O VOL connector, follow the instructions at https://bitbucket.hdfgroup.org/projects/HDF5VOL/repos/async/browse
USE_HDF5_ASYNC = FALSE
Expand Down
5 changes: 0 additions & 5 deletions Tests/Slice/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ include $(AMREX_HOME)/Tools/GNUMake/Make.rules

HDF5_HOME = /global/homes/s/sbyna/software/hdf5develop/install
USE_HDF5 = FALSE
ifeq ($(USE_HDF5), TRUE)
DEFINES += -DBL_HDF5
INCLUDE_LOCATIONS += $(HDF5_HOME)/include
LIBRARIES += -lhdf5 -L$(HDF5_HOME)/lib
endif
11 changes: 11 additions & 0 deletions Tools/GNUMake/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ else
USE_SENSEI_INSITU := FALSE
endif

ifdef USE_HDF5
USE_HDF5 := $(strip $(USE_HDF5))
else
USE_HDF5 := FALSE
endif

ifdef EBASE
EBASE := $(strip $(EBASE))
else
Expand Down Expand Up @@ -964,6 +970,11 @@ ifeq ($(USE_SENSEI_INSITU),TRUE)
include $(AMREX_HOME)/Tools/GNUMake/tools/Make.sensei
endif

ifeq ($(USE_HDF5),TRUE)
$(info Loading $(AMREX_HOME)/Tools/GNUMake/packages/Make.hdf5...)
include $(AMREX_HOME)/Tools/GNUMake/packages/Make.hdf5
endif

ifneq ("$(wildcard $(AMREX_HOME)/Tools/GNUMake/Make.local)","")
$(info Loading $(AMREX_HOME)/Tools/GNUMake/Make.local...)
include $(AMREX_HOME)/Tools/GNUMake/Make.local
Expand Down
19 changes: 19 additions & 0 deletions Tools/GNUMake/packages/Make.hdf5
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CPPFLAGS += -DAMREX_USE_HDF5

ifndef AMREX_HDF5_HOME
ifdef HDF5_DIR
AMREX_HDF5_HOME = $(HDF5_DIR)
endif
ifdef HDF5_HOME
AMREX_HDF5_HOME = $(HDF5_HOME)
endif
endif

LIBRARIES += -lhdf5 -lz -ldl

ifdef AMREX_HDF5_HOME
HDF5_ABSPATH = $(abspath $(AMREX_HDF5_HOME))
INCLUDE_LOCATIONS += $(HDF5_ABSPATH)/include
LIBRARY_LOCATIONS += $(HDF5_ABSPATH)/lib
LDFLAGS += -Xlinker=-rpath -Xlinker=$(HDF5_ABSPATH)/lib
endif

0 comments on commit 06a7b20

Please sign in to comment.