[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/10: gnu: Add NetCDF.
From: |
Eric Bavier |
Subject: |
10/10: gnu: Add NetCDF. |
Date: |
Thu, 12 May 2016 20:02:43 +0000 (UTC) |
bavier pushed a commit to branch master
in repository guix.
commit 889187a464d83475715a124805c99fb57ee99c31
Author: Eric Bavier <address@hidden>
Date: Tue Apr 12 10:04:01 2016 -0500
gnu: Add NetCDF.
* gnu/packages/maths.scm (netcdf, netcdf-parallel-openmpi): New variables.
---
gnu/local.mk | 1 +
gnu/packages/maths.scm | 51 +++++++++++++++++++++++++
gnu/packages/patches/netcdf-config-date.patch | 47 +++++++++++++++++++++++
3 files changed, 99 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0582d9e..e7001ec 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -643,6 +643,7 @@ dist_patch_DATA =
\
gnu/packages/patches/mupen64plus-ui-console-notice.patch \
gnu/packages/patches/mutt-store-references.patch \
gnu/packages/patches/net-tools-bitrot.patch \
+ gnu/packages/patches/netcdf-config-date.patch \
gnu/packages/patches/ngircd-handle-zombies.patch \
gnu/packages/patches/ngircd-no-dns-in-tests.patch \
gnu/packages/patches/ninja-tests.patch \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 57d27a1..10b1e9b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -55,6 +55,7 @@
#:use-module (gnu packages gcc)
#:use-module (gnu packages gd)
#:use-module (gnu packages ghostscript)
+ #:use-module (gnu packages graphviz)
#:use-module (gnu packages gtk)
#:use-module (gnu packages image)
#:use-module (gnu packages less)
@@ -489,6 +490,56 @@ extremely large and complex data collections.")
HDF5 file is encoded according to the HDF File Format Specification.")
(license (license:x11-style "file://COPYING"))))
+(define-public netcdf
+ (package
+ (name "netcdf")
+ (version "4.4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
+ "netcdf-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0y6gdcplarwqqnrav2xg1xd6ih732rzzbmdw78v3rl5b8mwcnh0d"))
+ (patches (list (search-patch "netcdf-config-date.patch")))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("m4" ,m4)
+ ("doxygen" ,doxygen)
+ ("graphviz" ,graphviz)))
+ (inputs
+ `(("hdf5" ,hdf5)
+ ("zlib" ,zlib)))
+ (arguments
+ `(#:configure-flags '("--enable-doxygen" "--enable-dot")
+ #:parallel-tests? #f)) ;various race conditions
+ (home-page "http://www.unidata.ucar.edu/software/netcdf/")
+ (synopsis "Library for scientific data")
+ (description "NetCDF is an interface for scientific data access and a
+software library that provides an implementation of the interface. The netCDF
+library defines a machine-independent format for representing scientific data.
+Together, the interface, library, and format support the creation, access, and
+sharing of scientific data.")
+ (license (license:x11-style "file://COPYRIGHT"))))
+
+(define-public netcdf-parallel-openmpi
+ (package (inherit netcdf)
+ (name "netcdf-parallel-openmpi")
+ (inputs
+ `(("mpi" ,openmpi)
+ ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
+ (package-inputs netcdf))))
+ ;; TODO: Replace pkg-config references in nc-config with absolute
references
+ (arguments
+ (substitute-keyword-arguments (package-arguments netcdf)
+ ((#:configure-flags flags)
+ `(cons* "CC=mpicc" "CXX=mpicxx"
+ "--enable-parallel-tests"
+ ;; Shared libraries not supported with parallel IO.
+ "--disable-shared" "--with-pic"
+ ,flags))))))
+
(define-public nlopt
(package
(name "nlopt")
diff --git a/gnu/packages/patches/netcdf-config-date.patch
b/gnu/packages/patches/netcdf-config-date.patch
new file mode 100644
index 0000000..5054612
--- /dev/null
+++ b/gnu/packages/patches/netcdf-config-date.patch
@@ -0,0 +1,47 @@
+Honor SOURCE_DATE_EPOCH when exporting configuration date.
+Autoconf-level patch submitted upstream on Fri Apr 15 23:07:42 UTC 2016
+
+--- a/configure
++++ b/configure
+@@ -2866,7 +2866,17 @@
+
+
+ # Configuration Date
+- CONFIG_DATE="`date`"
++ CONFIG_DATE="`date -u`"
++if test -n "$SOURCE_DATE_EPOCH"; then
++ CONFIG_DATE=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null \
++ || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null`
++ if test -z "$CONFIG_DATE"; then
++ as_fn_error $? "malformed SOURCE_DATE_EPOCH" "$LINENO" 5
++ fi
++fi
++cat >>confdefs.h <<_ACEOF
++#define CONFIG_DATE "$CONFIG_DATE"
++_ACEOF
+
+ # Find out about the host we're building on.
+ ac_aux_dir=
+--- a/libdispatch/derror.c
++++ b/libdispatch/derror.c
+@@ -13,7 +13,7 @@
+ #endif
+
+ /* Tell the user the version of netCDF. */
+-static const char nc_libvers[] = PACKAGE_VERSION " of "__DATE__" "__TIME__"
$";
++static const char nc_libvers[] = PACKAGE_VERSION " of "CONFIG_DATE" $";
+
+ /**
+ \defgroup lib_version Library Version
+--- a/config.h.in
++++ b/config.h.in
+@@ -393,6 +393,9 @@
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+
++/* Define to the configuration date */
++#undef CONFIG_DATE
++
+ /* The size of `double', as computed by sizeof. */
+ #undef SIZEOF_DOUBLE
+
- branch master updated (f6292ba -> 889187a), Eric Bavier, 2016/05/12
- 05/10: gnu: hdf5: Patch output references to zlib., Eric Bavier, 2016/05/12
- 04/10: gnu: hdf5: Update to 1.8.17., Eric Bavier, 2016/05/12
- 07/10: gnu: Add hdf5-openmpi., Eric Bavier, 2016/05/12
- 09/10: gnu: Add Matio., Eric Bavier, 2016/05/12
- 06/10: gnu: hdf5: Have configure honor SOURCE_DATE_EPOCH., Eric Bavier, 2016/05/12
- 10/10: gnu: Add NetCDF.,
Eric Bavier <=
- 08/10: gnu: Add h5check., Eric Bavier, 2016/05/12
- 02/10: gnu: Add doc++., Eric Bavier, 2016/05/12
- 03/10: gnu: Add HYPRE., Eric Bavier, 2016/05/12
- 01/10: gnu: Move asciidoc and doxygen to new module., Eric Bavier, 2016/05/12