From e03493077503aa1198103800a35b18d81f1eede4 Mon Sep 17 00:00:00 2001 From: Matthew Archer <36638242+ma595@users.noreply.github.com> Date: Mon, 11 Oct 2021 16:20:43 +0100 Subject: 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 --- var/spack/repos/builtin/packages/kahip/package.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'var') 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 -- cgit v1.2.3-60-g2f50