Merge pull request #128 from mathstuf/netcdf-new-linker-mpi
netcdf: link to MPI
This commit is contained in:
commit
c8f01480d6
25
var/spack/packages/netcdf/netcdf-4.3.3-mpi.patch
Normal file
25
var/spack/packages/netcdf/netcdf-4.3.3-mpi.patch
Normal file
@ -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()
|
@ -10,19 +10,18 @@ class Netcdf(Package):
|
|||||||
|
|
||||||
version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae')
|
version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae')
|
||||||
|
|
||||||
|
patch('netcdf-4.3.3-mpi.patch')
|
||||||
|
|
||||||
# Dependencies:
|
# Dependencies:
|
||||||
# >HDF5
|
# >HDF5
|
||||||
depends_on("hdf5")
|
depends_on("hdf5")
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
configure(
|
with working_dir('spack-build', create=True):
|
||||||
"--prefix=%s" % prefix,
|
cmake('..',
|
||||||
"--disable-dap", # Disable DAP.
|
"-DCMAKE_INSTALL_PREFIX:PATH=%s" % prefix,
|
||||||
"--disable-shared", # Don't build shared libraries (use static libs).
|
"-DENABLE_DAP:BOOL=OFF", # Disable DAP.
|
||||||
"CPPFLAGS=-I%s/include" % spec['hdf5'].prefix, # Link HDF5's include dir.
|
"-DBUILD_SHARED_LIBS:BOOL=OFF") # Don't build shared libraries (use static libs).
|
||||||
"LDFLAGS=-L%s/lib" % spec['hdf5'].prefix) # Link HDF5's lib dir.
|
|
||||||
|
|
||||||
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
|
|
||||||
# Check the newly installed netcdf package. Currently disabled.
|
|
||||||
# make("check")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user