2021-01-02 15:10:28 +08:00
|
|
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2017-09-17 04:00:32 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2017-09-17 04:00:32 +08:00
|
|
|
from spack import *
|
|
|
|
|
|
|
|
|
|
|
|
class Numactl(AutotoolsPackage):
|
|
|
|
"""NUMA support for Linux"""
|
|
|
|
|
2021-08-27 04:05:24 +08:00
|
|
|
homepage = "https://github.com/numactl/numactl"
|
2017-09-17 04:00:32 +08:00
|
|
|
url = "https://github.com/numactl/numactl/archive/v2.0.11.tar.gz"
|
|
|
|
|
2021-02-24 07:20:49 +08:00
|
|
|
force_autoreconf = True
|
|
|
|
|
2020-10-23 05:42:48 +08:00
|
|
|
version('2.0.14', sha256='1ee27abd07ff6ba140aaf9bc6379b37825e54496e01d6f7343330cf1a4487035')
|
2018-12-05 17:26:53 +08:00
|
|
|
version('2.0.12', sha256='7c3e819c2bdeb883de68bafe88776a01356f7ef565e75ba866c4b49a087c6bdf')
|
|
|
|
version('2.0.11', sha256='3e099a59b2c527bcdbddd34e1952ca87462d2cef4c93da9b0bc03f02903f7089')
|
2017-09-17 04:00:32 +08:00
|
|
|
|
2018-06-30 03:41:52 +08:00
|
|
|
patch('numactl-2.0.11-sysmacros.patch', when="@2.0.11")
|
2020-10-23 05:42:48 +08:00
|
|
|
# https://github.com/numactl/numactl/issues/94
|
|
|
|
patch('numactl-2.0.14-symver.patch', when="@2.0.14")
|
2021-02-24 11:13:22 +08:00
|
|
|
patch('fix-empty-block.patch', when="@2.0.10:2.0.14")
|
2018-06-30 03:41:52 +08:00
|
|
|
|
2017-09-17 04:00:32 +08:00
|
|
|
depends_on('autoconf', type='build')
|
|
|
|
depends_on('automake', type='build')
|
|
|
|
depends_on('libtool', type='build')
|
|
|
|
depends_on('m4', type='build')
|
2020-10-23 05:42:48 +08:00
|
|
|
|
2021-02-24 07:20:49 +08:00
|
|
|
def autoreconf(self, spec, prefix):
|
|
|
|
bash = which('bash')
|
|
|
|
bash('./autogen.sh')
|
|
|
|
|
2021-04-16 22:34:48 +08:00
|
|
|
@when('%nvhpc')
|
2020-10-23 05:42:48 +08:00
|
|
|
def patch(self):
|
2021-04-16 22:34:48 +08:00
|
|
|
self._nvhpc_patch()
|
|
|
|
|
|
|
|
@when('%pgi@20:')
|
|
|
|
def patch(self):
|
|
|
|
self._nvhpc_patch()
|
|
|
|
|
|
|
|
def _nvhpc_patch(self):
|
2020-10-23 05:42:48 +08:00
|
|
|
# Remove flags not recognized by the NVIDIA compiler
|
2021-04-16 22:34:48 +08:00
|
|
|
filter_file('-ffast-math -funroll-loops', '', 'Makefile.am')
|
|
|
|
filter_file('-std=gnu99', '-c99', 'Makefile.am')
|
2020-10-23 05:42:48 +08:00
|
|
|
|
|
|
|
# Avoid undefined reference errors
|
2021-04-16 22:34:48 +08:00
|
|
|
if self.spec.satisfies('@2.0.14'):
|
2020-10-23 05:42:48 +08:00
|
|
|
filter_file('numa_sched_setaffinity_v1_int',
|
|
|
|
'numa_sched_setaffinity_v1', 'libnuma.c')
|
|
|
|
filter_file('numa_sched_setaffinity_v2_int',
|
|
|
|
'numa_sched_setaffinity_v2', 'libnuma.c')
|
|
|
|
filter_file('numa_sched_getaffinity_v2_int',
|
|
|
|
'numa_sched_getaffinity_v2', 'libnuma.c')
|