aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/local.mk4
-rw-r--r--gnu/packages/maths.scm37
-rw-r--r--gnu/packages/patches/hdf-eos5-build-shared.patch31
-rw-r--r--gnu/packages/patches/hdf-eos5-fix-szip.patch30
-rw-r--r--gnu/packages/patches/hdf-eos5-fortrantests.patch156
-rw-r--r--gnu/packages/patches/hdf-eos5-remove-gctp.patch55
6 files changed, 313 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 867946dc24..1ce95f21c1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -571,6 +571,10 @@ dist_patch_DATA = \
%D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \
%D%/packages/patches/gtkglext-disable-disable-deprecated.patch \
%D%/packages/patches/hdf5-config-date.patch \
+ %D%/packages/patches/hdf-eos5-build-shared.patch \
+ %D%/packages/patches/hdf-eos5-remove-gctp.patch \
+ %D%/packages/patches/hdf-eos5-fix-szip.patch \
+ %D%/packages/patches/hdf-eos5-fortrantests.patch \
%D%/packages/patches/higan-remove-march-native-flag.patch \
%D%/packages/patches/hop-bigloo-4.0b.patch \
%D%/packages/patches/hop-linker-flags.patch \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 6442564ddb..d5e82bb4fa 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -14,6 +14,7 @@
;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -483,6 +484,42 @@ extremely large and complex data collections.")
(license (license:x11-style
"http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
+(define-public hdf-eos5
+ (package
+ (name "hdf-eos5")
+ (version "1.15")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
+/edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
+ (sha256
+ (base32
+ "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
+ (patches (search-patches "hdf-eos5-build-shared.patch"
+ "hdf-eos5-remove-gctp.patch"
+ "hdf-eos5-fix-szip.patch"
+ "hdf-eos5-fortrantests.patch"))))
+ (native-inputs
+ `(("gfortran" ,gfortran)))
+ (build-system gnu-build-system)
+ (inputs
+ `(("hdf5" ,hdf5)
+ ("zlib" ,zlib)
+ ("gctp" ,gctp)))
+ (arguments
+ `(#:configure-flags '("--enable-install-include" "--enable-shared"
+ "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
+ #:parallel-tests? #f))
+ (synopsis "HDF5-based data format for NASA's Earth Observing System")
+ (description
+ "HDF-EOS5 is a software library built on HDF5 to support the construction
+of data structures used in NASA's Earth Observing System (Grid, Point and
+Swath).")
+ (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
+
+ ;; Source files carry a permissive license header.
+ (license (license:non-copyleft home-page))))
+
(define-public hdf5-parallel-openmpi
(package (inherit hdf5)
(name "hdf5-parallel-openmpi")
diff --git a/gnu/packages/patches/hdf-eos5-build-shared.patch b/gnu/packages/patches/hdf-eos5-build-shared.patch
new file mode 100644
index 0000000000..f4ae5c73e3
--- /dev/null
+++ b/gnu/packages/patches/hdf-eos5-build-shared.patch
@@ -0,0 +1,31 @@
+Make shared library linking work.
+---
+ src/Makefile.in | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index 86880e5..24efffe 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -72,7 +72,7 @@ LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS) -DH5_USE_16_API
+ CCLD = $(CC)
+-LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
++LINK = HDF5_USE_SHLIB=yes $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ SOURCES = $(libhe5_hdfeos_la_SOURCES)
+ DIST_SOURCES = $(libhe5_hdfeos_la_SOURCES)
+@@ -124,9 +124,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+
+-# Set LDFLAGS to allow the HDF-EOS library to use extern variables from
+-# HDF5
+-LDFLAGS = -Wl,-single_module
+ LIBOBJS = @LIBOBJS@
+ LIBS = @LIBS@
+ LIBTOOL = @LIBTOOL@
+--
+2.10.0
+
diff --git a/gnu/packages/patches/hdf-eos5-fix-szip.patch b/gnu/packages/patches/hdf-eos5-fix-szip.patch
new file mode 100644
index 0000000000..799f542ef3
--- /dev/null
+++ b/gnu/packages/patches/hdf-eos5-fix-szip.patch
@@ -0,0 +1,30 @@
+Ill-placed #endif causes missing symbol errors when compiling without
+szip. Reported to upstream maintainer.
+---
+ src/EHapi.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/EHapi.c b/src/EHapi.c
+index 46a9b5c..208f447 100755
+--- a/src/EHapi.c
++++ b/src/EHapi.c
+@@ -11379,6 +11379,7 @@ int HE5_szip_can_encode(void )
+ return(-1);
+ }
+
++#endif /* H5_HAVE_FILTER_SZIP */
+
+
+ /*----------------------------------------------------------------------------|
+@@ -11509,8 +11510,6 @@ HE5_EHHEisHE5(char *filename)
+ }
+ }
+
+-#endif /* H5_HAVE_FILTER_SZIP */
+-
+
+ #ifndef __cplusplus
+
+--
+2.10.0
+
diff --git a/gnu/packages/patches/hdf-eos5-fortrantests.patch b/gnu/packages/patches/hdf-eos5-fortrantests.patch
new file mode 100644
index 0000000000..7333056342
--- /dev/null
+++ b/gnu/packages/patches/hdf-eos5-fortrantests.patch
@@ -0,0 +1,156 @@
+Fix fortran line length/indentation issues in Fortran test programs.
+Reported to upstream maintainer.
+
+diff --git a/samples/he5_gd_writedataF_32.f b/samples/he5_gd_writedataF_32.f
+index 515edf9..9c86299 100755
+--- a/samples/he5_gd_writedataF_32.f
++++ b/samples/he5_gd_writedataF_32.f
+@@ -77,26 +77,26 @@ c ------------------------------
+
+ attr4 = "ABCDEFGH"
+ count(1) = 8
+- status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_gdwrattr(): ',status
+
+ attr4 = "111"
+ count(1) = 3
+- status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_gdwrgattr(): ',status
+
+ attr4 = "222222"
+ count(1) = 6
+- status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_ehwrglatt(): ',status
+
+ attr5 = "abcdefgh111111111111"
+ count(1) = 20
+- status = he5_gdwrlattr(gdid,"Vegetation","LocalAttribute_0",
+- 1 HE5T_NATIVE_CHAR,count,attr5)
++ status = he5_gdwrlattr(gdid,"Vegetation"
++ & ,"LocalAttribute_0",HE5T_NATIVE_CHAR,count,attr5)
+ write(*,*) 'Status returned by he5_gdwrlattr(): ',status
+
+ endif
+diff --git a/samples/he5_gd_writedataF_64.f b/samples/he5_gd_writedataF_64.f
+index eff04f5..62a7398 100755
+--- a/samples/he5_gd_writedataF_64.f
++++ b/samples/he5_gd_writedataF_64.f
+@@ -77,26 +77,26 @@ c ------------------------------
+
+ attr4 = "ABCDEFGH"
+ count(1) = 8
+- status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_gdwrattr(): ',status
+
+ attr4 = "111"
+ count(1) = 3
+- status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_gdwrgattr(): ',status
+
+ attr4 = "222222"
+ count(1) = 6
+- status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_ehwrglatt(): ',status
+
+ attr5 = "abcdefgh111111111111"
+ count(1) = 20
+- status = he5_gdwrlattr(gdid,"Vegetation","LocalAttribute_0",
+- 1 HE5T_NATIVE_CHAR,count,attr5)
++ status = he5_gdwrlattr(gdid,"Vegetation"
++ & ,"LocalAttribute_0",HE5T_NATIVE_CHAR,count,attr5)
+ write(*,*) 'Status returned by he5_gdwrlattr(): ',status
+
+ endif
+diff --git a/samples/he5_sw_writedataF_32.f b/samples/he5_sw_writedataF_32.f
+index 7abab9b..fedd49a 100755
+--- a/samples/he5_sw_writedataF_32.f
++++ b/samples/he5_sw_writedataF_32.f
+@@ -173,20 +173,21 @@ c Write Global Attribute
+ c ----------------------
+ attr4 = "ABCDEFGH"
+ count(1) = 8
+- status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_swwrattr(): ',status
+
+ attr4 = "111"
+ count(1) = 3
+- status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+ write(*,*) 'Status returned by he5_swwrgattr(): ',status
+
+ attr4 = "222222"
+ count(1) = 6
+- status = he5_ehwrglatt(swfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_ehwrglatt(swfid
++ & ,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR
++ & ,count,attr4)
+ write(*,*) 'Status returned by he5_ehwrglatt(): ',status
+
+ c Write Local Attribute
+diff --git a/samples/he5_sw_writedataF_64.f b/samples/he5_sw_writedataF_64.f
+index 79e34bd..e5d74cb 100755
+--- a/samples/he5_sw_writedataF_64.f
++++ b/samples/he5_sw_writedataF_64.f
+@@ -162,25 +162,27 @@ c Write Global Attribute
+ c ----------------------
+ attr4 = "ABCDEFGH"
+ count(1) = 8
+- status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+
+ attr4 = "111"
+ count(1) = 3
+- status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1"
++ & ,HE5T_NATIVE_CHAR,count,attr4)
+
+ attr4 = "222222"
+ count(1) = 6
+- status = he5_ehwrglatt(swfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
+- 1 count,attr4)
++ status = he5_ehwrglatt(swfid
++ & ,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR
++ & ,count,attr4)
+
+ c Write Local Attribute
+ c ---------------------
+ attr5 = "abababababababababab"
+ count(1) = 20
+- status = he5_swwrlattr(swid,"Density","LocalAttribute_0",
+- 1 HE5T_NATIVE_CHAR,count,attr5)
++ status = he5_swwrlattr(swid,"Density"
++ & ,"LocalAttribute_0",HE5T_NATIVE_CHAR,count
++ & ,attr5)
+
+
+ endif
+--
+2.10.0
+
diff --git a/gnu/packages/patches/hdf-eos5-remove-gctp.patch b/gnu/packages/patches/hdf-eos5-remove-gctp.patch
new file mode 100644
index 0000000000..3b78357129
--- /dev/null
+++ b/gnu/packages/patches/hdf-eos5-remove-gctp.patch
@@ -0,0 +1,55 @@
+Don't build/install/use bundled gctp code/headers.
+
+* cproj.h, proj.h: part of GCTP, therefore already present.
+* HE5_config.h, tutils.h: used for library building and testing.
+
+diff --git a/Makefile.in b/Makefile.in
+index f160d0d..367b537 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -206,7 +206,7 @@ LIBGCTP = $(top_builddir)/gctp/src/libGctp.la
+ @TESTDRIVERS_CONDITIONAL_TRUE@TESTDRIVERS = testdrivers
+ @INSTALL_INCLUDE_CONDITIONAL_FALSE@INCLUDE =
+ @INSTALL_INCLUDE_CONDITIONAL_TRUE@INCLUDE = include
+-SUBDIRS = gctp src $(INCLUDE) samples $(TESTDRIVERS)
++SUBDIRS = src $(INCLUDE) samples $(TESTDRIVERS)
+ all: all-recursive
+
+ .SUFFIXES:
+diff --git a/samples/Makefile.in b/samples/Makefile.in
+index 59331dd..64fda89 100644
+--- a/samples/Makefile.in
++++ b/samples/Makefile.in
+@@ -206,7 +206,6 @@ he5_gd_datainfo_SOURCES = he5_gd_datainfo.c
+ he5_gd_datainfo_OBJECTS = he5_gd_datainfo.$(OBJEXT)
+ he5_gd_datainfo_LDADD = $(LDADD)
+ am__DEPENDENCIES_1 = $(top_builddir)/src/libhe5_hdfeos.la
+-am__DEPENDENCIES_2 = $(top_builddir)/gctp/src/libGctp.la
+ he5_gd_datainfo_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2)
+ he5_gd_defexternalfld_SOURCES = he5_gd_defexternalfld.c
+@@ -1093,7 +1092,7 @@ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+ LIBHDFEOS5 = $(top_builddir)/src/libhe5_hdfeos.la
+-LIBGCTP = $(top_builddir)/gctp/src/libGctp.la
++LIBGCTP =
+
+ # Boilerplate definitions file
+
+diff --git a/include/Makefile.in b/include/Makefile.in
+index a572128..64dabb5 100644
+--- a/include/Makefile.in
++++ b/include/Makefile.in
+@@ -190,8 +190,7 @@ LIBGCTP = $(top_builddir)/gctp/src/libGctp.la
+ # Boilerplate include
+
+ # Headers to install
+-include_HEADERS = HE5_GctpFunc.h HE5_HdfEosDef.h HE5_config.h cproj.h ease.h \
+- isin.h proj.h tutils.h cfortHdf.h
++include_HEADERS = HE5_GctpFunc.h HE5_HdfEosDef.h ease.h isin.h cfortHdf.h
+
+ all: HE5_config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+--
+2.10.0