diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/xgboost/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/xgboost/package.py | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/xgboost/package.py b/var/spack/repos/builtin/packages/xgboost/package.py index 15cdbb763e..5b9476faf6 100644 --- a/var/spack/repos/builtin/packages/xgboost/package.py +++ b/var/spack/repos/builtin/packages/xgboost/package.py @@ -1,4 +1,4 @@ -# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -7,25 +7,49 @@ from spack import * class Xgboost(CMakePackage, CudaPackage): - """Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) - Library, for Python, R, Java, Scala, C++ and more. Runs on single - machine, Hadoop, Spark, Flink and DataFlow""" + """XGBoost is an optimized distributed gradient boosting library designed to be + highly efficient, flexible and portable. It implements machine learning algorithms + under the Gradient Boosting framework. XGBoost provides a parallel tree boosting + (also known as GBDT, GBM) that solve many data science problems in a fast and + accurate way. The same code runs on major distributed environment (Hadoop, SGE, MPI) + and can solve problems beyond billions of examples.""" homepage = "https://xgboost.ai/" - url = "https://github.com/dmlc/xgboost/releases/download/v0.81/xgboost-0.81.tar.bz2" git = "https://github.com/dmlc/xgboost.git" - version('0.90', tag='v0.90', submodules=True) - version('0.81', sha256='9d8ff161699111d45c96bd15229aa6d80eb1cab7cbbef7e8eaa60ccfb5a4f806') + maintainers = ['adamjstewart'] + + version('master', branch='master', submodules=True) + version('1.3.3', tag='v1.3.3', submodules=True) + version('0.90', tag='v0.90', submodules=True, deprecated=True) + version('0.81', tag='v0.81', submodules=True, deprecated=True) + + variant('nccl', default=False, description='Build with NCCL to enable distributed GPU support') + variant('openmp', default=True, description='Build with OpenMP support') + + depends_on('cmake@3.13:', type='build') + depends_on('cmake@3.16:', when='platform=darwin', type='build') + depends_on('ninja', type='build') + depends_on('cuda@10:', when='+cuda') + depends_on('nccl', when='+nccl') + depends_on('llvm-openmp', when='%apple-clang +openmp') + + conflicts('%gcc@:4.999', msg='GCC version must be at least 5.0!') + conflicts('+nccl', when='~cuda', msg='NCCL requires CUDA') + conflicts('+cuda', when='~openmp', msg='CUDA requires OpenMP') + + generator = 'Ninja' def cmake_args(self): - return [ - '-DUSE_CUDA={0}'.format('YES' if '+cuda' in self.spec else 'NO') + # https://xgboost.readthedocs.io/en/latest/build.html + args = [ + self.define_from_variant('USE_CUDA', 'cuda'), + self.define_from_variant('USE_NCCL', 'nccl'), + self.define_from_variant('USE_OPENMP', 'openmp'), ] - def install(self, spec, prefix): - install_tree(str(self.stage.source_path), prefix) - # create a bin directory for executable "xgboost" which is possibly - # used in functional testing of the compilation target "libxgboost" - mkdirp(prefix.bin) - install('xgboost', prefix.bin) + if '+cuda' in self.spec and 'cuda_arch=none' not in self.spec: + args.append(self.define( + 'GPU_COMPUTE_VER', self.spec.variants['cuda_arch'].value)) + + return args |