diff options
author | haralmha <47558670+haralmha@users.noreply.github.com> | 2022-07-20 16:45:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 07:45:01 -0700 |
commit | cf3774aa462abe9a3787037fbabc48373d066dd9 (patch) | |
tree | b074b819529823f6244ba9509de04321af787e1b /var | |
parent | e7be8dbbcfe1a053d568c99cfeb2e921c3b1471a (diff) | |
download | spack-cf3774aa462abe9a3787037fbabc48373d066dd9.tar.gz spack-cf3774aa462abe9a3787037fbabc48373d066dd9.tar.bz2 spack-cf3774aa462abe9a3787037fbabc48373d066dd9.tar.xz spack-cf3774aa462abe9a3787037fbabc48373d066dd9.zip |
xgboost: Add version 1.6.1 and make openmp variant compatible with clang (#31557)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-xgboost/package.py | 4 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/xgboost/package.py | 22 |
2 files changed, 25 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/py-xgboost/package.py b/var/spack/repos/builtin/packages/py-xgboost/package.py index aa11a80914..2f7f518899 100644 --- a/var/spack/repos/builtin/packages/py-xgboost/package.py +++ b/var/spack/repos/builtin/packages/py-xgboost/package.py @@ -18,6 +18,7 @@ class PyXgboost(PythonPackage): maintainers = ['adamjstewart'] import_modules = ['xgboost'] + version('1.6.1', sha256='24072028656f3428e7b8aabf77340ece057f273e41f7f85d67ccaefb7454bb18') version('1.5.2', sha256='404dc09dca887ef5a9bc0268f882c54b33bfc16ac365a859a11e7b24d49da387') version('1.3.3', sha256='397051647bb837915f3ff24afc7d49f7fca57630ffd00fb5ef66ae2a0881fb43') @@ -26,9 +27,10 @@ class PyXgboost(PythonPackage): variant('dask', default=False, description='Enables Dask extensions for distributed training.') variant('plotting', default=False, description='Enables tree and importance plotting.') - for ver in ['1.3.3', '1.5.2']: + for ver in ['1.3.3', '1.5.2', '1.6.1']: depends_on('xgboost@' + ver, when='@' + ver) + depends_on('python@3.7:', when='@1.6:', type=('build', 'run')) depends_on('python@3.6:', type=('build', 'run')) depends_on('py-setuptools', type=('build')) depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/xgboost/package.py b/var/spack/repos/builtin/packages/xgboost/package.py index dc464576d4..2b822e253a 100644 --- a/var/spack/repos/builtin/packages/xgboost/package.py +++ b/var/spack/repos/builtin/packages/xgboost/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack.package import * @@ -20,6 +22,7 @@ class Xgboost(CMakePackage, CudaPackage): maintainers = ['adamjstewart'] version('master', branch='master', submodules=True) + version('1.6.1', tag='v1.6.1', submodules=True) version('1.5.2', tag='v1.5.2', submodules=True) version('1.3.3', tag='v1.3.3', submodules=True) @@ -34,6 +37,7 @@ class Xgboost(CMakePackage, CudaPackage): depends_on('cuda@10:11.4', when='@:1.5.0+cuda') depends_on('nccl', when='+nccl') depends_on('llvm-openmp', when='%apple-clang +openmp') + depends_on('hwloc', when='%clang') conflicts('%gcc@:4', msg='GCC version must be at least 5.0!') conflicts('+nccl', when='~cuda', msg='NCCL requires CUDA') @@ -59,4 +63,22 @@ class Xgboost(CMakePackage, CudaPackage): if '@1.5: ^cuda@11.4:' in self.spec: args.append(self.define('BUILD_WITH_CUDA_CUB', True)) + if self.spec.satisfies('+openmp%clang'): + OpenMP_C_FLAGS = "-fopenmp=libomp" + OpenMP_C_LIB_NAMES = "libomp" + args += [ + self.define('OpenMP_C_FLAGS', OpenMP_C_FLAGS), + self.define('OpenMP_C_LIB_NAMES', OpenMP_C_LIB_NAMES), + self.define('OpenMP_CXX_FLAGS', OpenMP_C_FLAGS), + self.define('OpenMP_CXX_LIB_NAMES', OpenMP_C_LIB_NAMES), + ] + clang = self.compiler.cc + clang_bin = os.path.dirname(clang) + clang_root = os.path.dirname(clang_bin) + args += [ + self.define('OpenMP_libomp_LIBRARY', + find_libraries('libomp', root=clang_root, + shared=True, recursive=True)) + ] + return args |