summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2015-10-15 09:20:16 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2015-10-15 09:20:16 -0400
commit9ec4ae83af7f88110e464fca22a9d1377d74b28e (patch)
tree99e0048d7f81f453556d21af23d5e68dc04802ec /var
parentd16095c8560cbaae1020a8e84494b8877bfe36f5 (diff)
downloadspack-9ec4ae83af7f88110e464fca22a9d1377d74b28e.tar.gz
spack-9ec4ae83af7f88110e464fca22a9d1377d74b28e.tar.bz2
spack-9ec4ae83af7f88110e464fca22a9d1377d74b28e.tar.xz
spack-9ec4ae83af7f88110e464fca22a9d1377d74b28e.zip
netcdf: link to MPI
Newer GNU linker refuses to use transitive linking; if netcdf calls MPI_Allreduce, it must link the providing library directly. Also switched to CMake because I don't know autoconf well enough to know how to put MPI stuff into it.
Diffstat (limited to 'var')
-rw-r--r--var/spack/packages/netcdf/netcdf-4.3.3-mpi.patch25
-rw-r--r--var/spack/packages/netcdf/package.py29
2 files changed, 39 insertions, 15 deletions
diff --git a/var/spack/packages/netcdf/netcdf-4.3.3-mpi.patch b/var/spack/packages/netcdf/netcdf-4.3.3-mpi.patch
new file mode 100644
index 0000000000..46dda5fc9d
--- /dev/null
+++ b/var/spack/packages/netcdf/netcdf-4.3.3-mpi.patch
@@ -0,0 +1,25 @@
+diff -Nur netcdf-4.3.3/CMakeLists.txt netcdf-4.3.3.mpi/CMakeLists.txt
+--- netcdf-4.3.3/CMakeLists.txt 2015-02-12 16:44:35.000000000 -0500
++++ netcdf-4.3.3.mpi/CMakeLists.txt 2015-10-14 16:44:41.176300658 -0400
+@@ -753,6 +753,7 @@
+ SET(USE_PARALLEL OFF CACHE BOOL "")
+ MESSAGE(STATUS "Cannot find HDF5 library built with parallel support. Disabling parallel build.")
+ ELSE()
++ FIND_PACKAGE(MPI REQUIRED)
+ SET(USE_PARALLEL ON CACHE BOOL "")
+ SET(STATUS_PARALLEL "ON")
+ ENDIF()
+diff -Nur netcdf-4.3.3/liblib/CMakeLists.txt netcdf-4.3.3.mpi/liblib/CMakeLists.txt
+--- netcdf-4.3.3/liblib/CMakeLists.txt 2015-02-12 16:44:35.000000000 -0500
++++ netcdf-4.3.3.mpi/liblib/CMakeLists.txt 2015-10-14 16:44:57.757793634 -0400
+@@ -71,6 +71,10 @@
+ SET(TLL_LIBS ${TLL_LIBS} ${CURL_LIBRARY})
+ ENDIF()
+
++IF(USE_PARALLEL)
++ SET(TLL_LIBS ${TLL_LIBS} ${MPI_C_LIBRARIES})
++ENDIF()
++
+ IF(USE_HDF4)
+ SET(TLL_LIBS ${TLL_LIBS} ${HDF4_LIBRARIES})
+ ENDIF()
diff --git a/var/spack/packages/netcdf/package.py b/var/spack/packages/netcdf/package.py
index 34284ea725..e1e0d836c6 100644
--- a/var/spack/packages/netcdf/package.py
+++ b/var/spack/packages/netcdf/package.py
@@ -1,28 +1,27 @@
from spack import *
class Netcdf(Package):
- """NetCDF is a set of software libraries and self-describing, machine-independent
- data formats that support the creation, access, and sharing of array-oriented
- scientific data."""
+ """NetCDF is a set of software libraries and self-describing, machine-independent
+ data formats that support the creation, access, and sharing of array-oriented
+ scientific data."""
homepage = "http://www.unidata.ucar.edu/software/netcdf/"
url = "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.tar.gz"
version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae')
+ patch('netcdf-4.3.3-mpi.patch')
+
# Dependencies:
- # >HDF5
+ # >HDF5
depends_on("hdf5")
- def install(self, spec, prefix):
- configure(
- "--prefix=%s" % prefix,
- "--disable-dap", # Disable DAP.
- "--disable-shared", # Don't build shared libraries (use static libs).
- "CPPFLAGS=-I%s/include" % spec['hdf5'].prefix, # Link HDF5's include dir.
- "LDFLAGS=-L%s/lib" % spec['hdf5'].prefix) # Link HDF5's lib dir.
-
- make("install")
+ def install(self, spec, prefix):
+ with working_dir('spack-build', create=True):
+ cmake('..',
+ "-DCMAKE_INSTALL_PREFIX:PATH=%s" % prefix,
+ "-DENABLE_DAP:BOOL=OFF", # Disable DAP.
+ "-DBUILD_SHARED_LIBS:BOOL=OFF") # Don't build shared libraries (use static libs).
- # Check the newly installed netcdf package. Currently disabled.
- # make("check")
+ make()
+ make("install")