summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2016-03-21 14:33:00 +0100
committerDenis Davydov <davydden@gmail.com>2016-03-21 14:33:00 +0100
commitb926d8a0cdcf47de029e372cf15e281266930378 (patch)
tree0b4785d16ceee0cc5f39263ae61ffe27d8e62c41
parentdb61a09cf14cc791d7692aac0329e8958b228fb6 (diff)
downloadspack-b926d8a0cdcf47de029e372cf15e281266930378.tar.gz
spack-b926d8a0cdcf47de029e372cf15e281266930378.tar.bz2
spack-b926d8a0cdcf47de029e372cf15e281266930378.tar.xz
spack-b926d8a0cdcf47de029e372cf15e281266930378.zip
build parmetis against external metis
-rw-r--r--var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch13
-rw-r--r--var/spack/repos/builtin/packages/parmetis/package.py24
2 files changed, 17 insertions, 20 deletions
diff --git a/var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch b/var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch
new file mode 100644
index 0000000000..514781b8b8
--- /dev/null
+++ b/var/spack/repos/builtin/packages/parmetis/enable_external_metis.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ca945dd..1bf94e9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -33,7 +33,7 @@ include_directories(${GKLIB_PATH})
+ include_directories(${METIS_PATH}/include)
+
+ # List of directories that cmake will look for CMakeLists.txt
+-add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
++#add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis)
+ add_subdirectory(include)
+ add_subdirectory(libparmetis)
+ add_subdirectory(programs)
diff --git a/var/spack/repos/builtin/packages/parmetis/package.py b/var/spack/repos/builtin/packages/parmetis/package.py
index c897dec7e4..3f18dd76b8 100644
--- a/var/spack/repos/builtin/packages/parmetis/package.py
+++ b/var/spack/repos/builtin/packages/parmetis/package.py
@@ -25,9 +25,6 @@
from spack import *
-# FIXME : lot of code is duplicated from packages/metis/package.py . Inheriting from there may reduce
-# FIXME : the installation rules to just a few lines
-
class Parmetis(Package):
"""
@@ -43,13 +40,11 @@ class Parmetis(Package):
variant('debug', default=False, description='Builds the library in debug mode')
variant('gdb', default=False, description='Enables gdb support')
- variant('idx64', default=False, description='Use int64_t as default index type')
- variant('double', default=False, description='Use double precision floating point types')
-
depends_on('cmake @2.8:') # build dependency
depends_on('mpi')
- # FIXME : this should conflict with metis as it builds its own version internally
+ patch('enable_external_metis.patch')
+ depends_on('metis')
depends_on('gdb', when='+gdb')
@@ -63,8 +58,8 @@ class Parmetis(Package):
# FIXME : Once a contract is defined, MPI compilers should be retrieved indirectly via spec['mpi'] in case
# FIXME : they use a non-standard name
- options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=metis_source),
- '-DMETIS_PATH:PATH={metis_source}'.format(metis_source=metis_source),
+ options.extend(['-DGKLIB_PATH:PATH={metis_source}/GKlib'.format(metis_source=metis_source), # still need headers from METIS source, and they are not installed with METIS. shame...
+ '-DMETIS_PATH:PATH={metis_source}'.format(metis_source=spec['metis'].prefix),
'-DCMAKE_C_COMPILER:STRING=mpicc',
'-DCMAKE_CXX_COMPILER:STRING=mpicxx'])
@@ -78,18 +73,7 @@ class Parmetis(Package):
if '+gdb' in spec:
options.append('-DGDB:BOOL=ON')
- metis_header = join_path(metis_source, 'include', 'metis.h')
-
- if '+idx64' in spec:
- filter_file('IDXTYPEWIDTH 32', 'IDXTYPEWIDTH 64', metis_header)
-
- if '+double' in spec:
- filter_file('REALTYPEWIDTH 32', 'REALTYPEWIDTH 64', metis_header)
-
with working_dir(build_directory, create=True):
cmake(source_directory, *options)
make()
make("install")
- # Parmetis build system doesn't allow for an external metis to be used, but doesn't copy the required
- # metis header either
- install(metis_header, self.prefix.include)