summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Archer <36638242+ma595@users.noreply.github.com>2021-10-11 16:20:43 +0100
committerGitHub <noreply@github.com>2021-10-11 10:20:43 -0500
commite03493077503aa1198103800a35b18d81f1eede4 (patch)
treea152eb686ab6946625179441095c479aabc35516
parent79aba5942ad3ae6b4ad79e9ca49f5de87280d877 (diff)
downloadspack-e03493077503aa1198103800a35b18d81f1eede4.tar.gz
spack-e03493077503aa1198103800a35b18d81f1eede4.tar.bz2
spack-e03493077503aa1198103800a35b18d81f1eede4.tar.xz
spack-e03493077503aa1198103800a35b18d81f1eede4.zip
kahip: update build system to cmake for v3.11, retain scons for older versions (#25645)
* kahip: update to cmake for v3.11, retain scons for older versions * kahip: update build system to cmake for v3.11, retain SCons for older versions * address PR comments and add maintainer * address PR comments - correct version to 2.10, add deprecated and url, and remove scons version
-rw-r--r--var/spack/repos/builtin/packages/kahip/package.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/kahip/package.py b/var/spack/repos/builtin/packages/kahip/package.py
index e9f4c4501b..5a601436d6 100644
--- a/var/spack/repos/builtin/packages/kahip/package.py
+++ b/var/spack/repos/builtin/packages/kahip/package.py
@@ -9,7 +9,7 @@ import re
from spack import *
-class Kahip(SConsPackage):
+class Kahip(CMakePackage):
"""KaHIP - Karlsruhe High Quality Partitioning - is a family of graph
partitioning programs. It includes KaFFPa (Karlsruhe Fast Flow
Partitioner), which is a multilevel graph partitioning algorithm,
@@ -23,12 +23,15 @@ class Kahip(SConsPackage):
"""
homepage = 'http://algo2.iti.kit.edu/documents/kahip/index.html'
- url = 'https://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.00.tar.gz'
- git = 'https://github.com/schulzchristian/KaHIP.git'
+ url = 'https://github.com/KaHIP/KaHIP/archive/v3.11.tar.gz'
+ git = 'https://github.com/KaHIP/KaHIP.git'
+ maintainers = ["ma595"]
version('develop', branch='master')
- version('2.00', sha256='1cc9e5b12fea559288d377e8b8b701af1b2b707de8e550d0bda18b36be29d21d')
+ version('3.11', sha256='347575d48c306b92ab6e47c13fa570e1af1e210255f470e6aa12c2509a8c13e3')
+ version('2.00', sha256='1cc9e5b12fea559288d377e8b8b701af1b2b707de8e550d0bda18b36be29d21d', url='https://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.00.tar.gz', deprecated=True)
+ depends_on('scons', type='build', when='@2:2.10')
depends_on('argtable')
depends_on('mpi') # Note: upstream package only tested on openmpi
@@ -39,11 +42,13 @@ class Kahip(SConsPackage):
# statement to a function)
# Split into 2 patch files:
# *) first file patches Sconstruct files present in all versions (from
- # 2.00 to 2.11)
+ # 2.00 to 2.10)
# *) second is for files only present in 2.00
- patch('fix-sconstruct-for-py3.patch', when='@2: ^python@3:')
+ patch('fix-sconstruct-for-py3.patch', when='@2:2.10 ^python@3:')
patch('fix-sconstruct-for-py3-v2.00.patch', when='@2.00 ^python@3:')
+ # 'when' decorators to override new CMake build approach (old build was SConstruct).
+ @when("@:2.10")
def patch(self):
"""Internal compile.sh scripts hardcode number of cores to build with.
Filter these out so Spack can control it."""
@@ -57,11 +62,17 @@ class Kahip(SConsPackage):
for f in files:
filter_file('NCORES=.*', 'NCORES={0}'.format(make_jobs), f)
+ @when("@:2.10")
+ def cmake(self, spac, prefix):
+ pass
+
+ @when("@:2.10")
def build(self, spec, prefix):
"""Build using the KaHIP compile.sh script. Uses scons internally."""
builder = Executable('./compile.sh')
builder()
+ @when("@:2.10")
def install(self, spec, prefix):
"""Install under the prefix"""
# Ugly: all files land under 'deploy' and we need to disentangle them