From 4176ce5c0780b7eebe97e500d8fdc383a77bb341 Mon Sep 17 00:00:00 2001 From: FJ-NaokiMatsumura <98728917+FJ-NaokiMatsumura@users.noreply.github.com> Date: Tue, 15 Mar 2022 20:46:21 +0900 Subject: [PATCH] h5z-zfp: fix build with Fujitsu compiler (#29029) --- .../packages/h5z-zfp/Makefile.0.7.0.patch | 11 +++++ .../packages/h5z-zfp/config.make.0.7.0.patch | 11 +++++ .../packages/h5z-zfp/config.make.patch | 46 +++++++++++++++++++ .../repos/builtin/packages/h5z-zfp/fj.patch | 23 ++++++++++ .../repos/builtin/packages/h5z-zfp/package.py | 13 +++++- 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 var/spack/repos/builtin/packages/h5z-zfp/Makefile.0.7.0.patch create mode 100644 var/spack/repos/builtin/packages/h5z-zfp/config.make.0.7.0.patch create mode 100644 var/spack/repos/builtin/packages/h5z-zfp/config.make.patch create mode 100644 var/spack/repos/builtin/packages/h5z-zfp/fj.patch diff --git a/var/spack/repos/builtin/packages/h5z-zfp/Makefile.0.7.0.patch b/var/spack/repos/builtin/packages/h5z-zfp/Makefile.0.7.0.patch new file mode 100644 index 0000000000..2f82ac7c5b --- /dev/null +++ b/var/spack/repos/builtin/packages/h5z-zfp/Makefile.0.7.0.patch @@ -0,0 +1,11 @@ +--- spack-src/src/Makefile.orig 2022-02-02 17:42:03.000000000 +0900 ++++ spack-src/src/Makefile 2022-02-02 17:42:34.000000000 +0900 +@@ -54,7 +54,7 @@ + $(INSTALL) libh5zzfp.a $(PREFIX)/lib + $(INSTALL) -m 644 H5Zzfp.h H5Zzfp_lib.h H5Zzfp_plugin.h H5Zzfp_props.h $(PREFIX)/include + ifneq ($(FC),) +- $(INSTALL) -m 644 H5Zzfp_props_f.mod $(PREFIX)/include ++ $(INSTALL) -m 644 *.[mM][oO][dD] $(PREFIX)/include + endif + + clean: diff --git a/var/spack/repos/builtin/packages/h5z-zfp/config.make.0.7.0.patch b/var/spack/repos/builtin/packages/h5z-zfp/config.make.0.7.0.patch new file mode 100644 index 0000000000..e163292acc --- /dev/null +++ b/var/spack/repos/builtin/packages/h5z-zfp/config.make.0.7.0.patch @@ -0,0 +1,11 @@ +--- spack-src/config.make.orig 2017-06-09 21:15:21.000000000 +0900 ++++ spack-src/config.make 2022-02-02 17:04:31.000000000 +0900 +@@ -16,6 +16,8 @@ + H5Z_ZFP_BASE := ../src + else ifeq ($(PWD_BASE),H5Z-ZFP) + H5Z_ZFP_BASE := ./src ++else ++ H5Z_ZFP_BASE := ./src + endif + H5Z_ZFP_PLUGIN := $(H5Z_ZFP_BASE)/plugin + H5Z_ZFP_VERSINFO := $(shell grep '^\#define H5Z_FILTER_ZFP_VERSION_[MP]' $(H5Z_ZFP_BASE)/H5Zzfp_plugin.h | cut -d' ' -f3 | tr '\n' '.' | cut -d'.' -f-3 2>/dev/null) diff --git a/var/spack/repos/builtin/packages/h5z-zfp/config.make.patch b/var/spack/repos/builtin/packages/h5z-zfp/config.make.patch new file mode 100644 index 0000000000..4879a1b755 --- /dev/null +++ b/var/spack/repos/builtin/packages/h5z-zfp/config.make.patch @@ -0,0 +1,46 @@ +diff --git a/config.make b/config.make +index d782bd1..1c53ab8 100644 +--- a/config.make ++++ b/config.make +@@ -128,18 +128,37 @@ ZFP_INC = $(ZFP_HOME)/inc + else + ZFP_INC = $(ZFP_HOME)/include + endif ++ifeq ($(wildcard $(ZFP_HOME)/lib),) ++ZFP_LIB = $(ZFP_HOME)/lib64 ++else + ZFP_LIB = $(ZFP_HOME)/lib ++endif ++ ++# Check if specified individually the HDF5 include directory, ++# library directory and bin directory separated by commas, i.e. HDF5_HOME=INC,LIB,BIN + +-HDF5_INC = $(HDF5_HOME)/include +-HDF5_LIB = $(HDF5_HOME)/lib +-HDF5_BIN = $(HDF5_HOME)/bin ++ifneq (,$(findstring ",",$(HDF5_HOME))) ++ HDF5_INC = $(shell echo $(HDF5_HOME) | awk -F'[,]' '{print $$1}') ++ HDF5_LIB = $(shell echo $(HDF5_HOME) | awk -F'[,]' '{print $$2}') ++ HDF5_BIN = $(shell echo $(HDF5_HOME) | awk -F'[,]' '{print $$3}') ++ MAKEVARS = ++else ++ HDF5_INC = $(HDF5_HOME)/include ++ ifeq ($(wildcard $(HDF5_HOME)/lib),) ++ HDF5_LIB = $(HDF5_HOME)/lib64 ++ else ++ HDF5_LIB = $(HDF5_HOME)/lib ++ endif ++ HDF5_BIN = $(HDF5_HOME)/bin ++ MAKEVARS = HDF5_HOME=$(HDF5_HOME) ++endif + + ifeq ($(PREFIX),) + PREFIX := $(shell pwd)/install + endif + INSTALL ?= install + +-MAKEVARS = ZFP_HOME=$(ZFP_HOME) HDF5_HOME=$(HDF5_HOME) PREFIX=$(PREFIX) ++MAKEVARS += ZFP_HOME=$(ZFP_HOME) PREFIX=$(PREFIX) + + .SUFFIXES: + .SUFFIXES: .c .F90 .h .o .mod diff --git a/var/spack/repos/builtin/packages/h5z-zfp/fj.patch b/var/spack/repos/builtin/packages/h5z-zfp/fj.patch new file mode 100644 index 0000000000..fd3ff5c76d --- /dev/null +++ b/var/spack/repos/builtin/packages/h5z-zfp/fj.patch @@ -0,0 +1,23 @@ +--- spack-src/config.make.org 2022-02-01 18:43:23.000000000 +0900 ++++ spack-src/config.make 2022-02-01 18:42:54.000000000 +0900 +@@ -106,6 +106,11 @@ + SOEXT ?= so + SHFLAG ?= -qmkshrobj + PREPATH = -Wl,-R, ++else ifneq ($(findstring fcc, $(CC)),) ++ CFLAGS += -KPIC ++ SOEXT ?= so ++ SHFLAG ?= -shared ++ PREPATH = -Wl,-rpath, + endif + + ifneq ($(findstring gfortran, $(FC)),) +@@ -118,6 +123,8 @@ + FCFLAGS += -qpic + else ifneq ($(findstring bgxlf_r, $(FC)),) + FCFLAGS += -qpic ++else ifneq ($(findstring frt, $(FC)),) ++ FCFLAGS += -KPIC + else ifneq ($(findstring f77, $(FC)),) + # some makefile versions set FC=f77 if FC is not set + FC = diff --git a/var/spack/repos/builtin/packages/h5z-zfp/package.py b/var/spack/repos/builtin/packages/h5z-zfp/package.py index ad4756711d..4f3861aaee 100644 --- a/var/spack/repos/builtin/packages/h5z-zfp/package.py +++ b/var/spack/repos/builtin/packages/h5z-zfp/package.py @@ -12,10 +12,12 @@ class H5zZfp(MakefilePackage): homepage = "https://h5z-zfp.readthedocs.io/en/latest" git = "https://github.com/LLNL/H5Z-ZFP.git" + url = "https://github.com/LLNL/H5Z-ZFP/archive/refs/tags/v1.0.1.tar.gz" version('develop', branch='master') - version('0.8.0', commit='af165c4') - version('0.7.0', commit='58ac811') + version('1.0.1', sha256='b9ed91dab8e2ef82dc6706b4242c807fb352875e3b21c217dd00782dd1a22b24') + version('0.8.0', sha256='a5eb089191369a5e929c51ec9e5da107afaee39c6ab3b7ad693c454319ab9217') + version('0.7.0', sha256='f728b0bcb9e9cf8bafe05909ab02fec39415635d275e98b661176f69d34f87b3') variant('fortran', default=True, description='Enable Fortran support') @@ -23,6 +25,13 @@ class H5zZfp(MakefilePackage): depends_on('hdf5', when='~fortran') depends_on('zfp bsws=8') + patch('https://github.com/LLNL/H5Z-ZFP/commit/983a1870cefff5fdb643898a14eda855c2c231e4.patch', + sha256='64a624880ca944ebcc174f66d739dd0458a6dab2f0bccc6ed99bf4c0c9b9e388', when='@1.0.1') + patch('config.make.patch', when='@0.7.0:0.8.0') + patch('config.make.0.7.0.patch', when='@0.7.0') + patch('Makefile.0.7.0.patch', when='@0.7.0') + patch('fj.patch', when='@0.7.0: %fj') + @property def make_defs(self): make_defs = [