diff options
author | Andreas Baumbach <healther@users.noreply.github.com> | 2020-08-22 21:42:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 14:42:46 -0500 |
commit | 27b9727926139ae2cfde6d3cdcdf5746ed28e03d (patch) | |
tree | 2e225184d5bb79638369a2a6d55e731312dc62ca | |
parent | 2e2c06121a502975c07e4574d43ebb17862c5840 (diff) | |
download | spack-27b9727926139ae2cfde6d3cdcdf5746ed28e03d.tar.gz spack-27b9727926139ae2cfde6d3cdcdf5746ed28e03d.tar.bz2 spack-27b9727926139ae2cfde6d3cdcdf5746ed28e03d.tar.xz spack-27b9727926139ae2cfde6d3cdcdf5746ed28e03d.zip |
Add new package arbor (#11914)
* Add new package arbor
Change-Id: I70a442d6ad74979d13bd9f599df238c085d4baf9
* Update package.py
* add additional dependencies
* change download to tar-ball
* py26 compatibility
* restrict noqas and expand comment
Co-authored-by: Eric Müller <mueller@kip.uni-heidelberg.de>
-rw-r--r-- | var/spack/repos/builtin/packages/arbor/package.py | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/arbor/package.py b/var/spack/repos/builtin/packages/arbor/package.py new file mode 100644 index 0000000000..7ed69fe47c --- /dev/null +++ b/var/spack/repos/builtin/packages/arbor/package.py @@ -0,0 +1,70 @@ +# Copyright 2013-2019 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) + +from spack import * + + +class Arbor(CMakePackage): + """Arbor is a high-performance library for computational neuroscience + simulations.""" + + homepage = "https://github.com/arbor-sim/arbor/" + url = "https://github.com/arbor-sim/arbor/archive/v0.2.tar.gz" + + version('0.2', sha256='43c9181c03be5f3c9820b2b50592d7b41344f37e1200980119ad347eb7bcf4eb') + + variant('vectorize', default=False, + description='Enable vectorization of computational kernels') + variant('gpu', default=False, description='Enable GPU support') + variant('mpi', default=False, description='Enable MPI support') + variant('python', default=False, + description='Enable Python frontend support') + variant('unwind', default=False, + description='Enable libunwind for pretty stack traces') + + depends_on('cuda', when='+gpu') + depends_on('mpi', when='+mpi') + depends_on('libunwind', when='+unwind') + + extends('python@3.6:', when='+python') + depends_on('py-mpi4py', when='+mpi+python', type=('build', 'run')) + + depends_on('cmake@3.9:', type='build') + # mentioned in documentation but shouldn't be necessary when + # using the archive + # depends_on('git@2.0:', type='build') + + # compiler dependencies + # depends_on(C++14) + # depends_on('gcc@6.1.0:', type='build') + # depends_on('llvm@4:', type='build') + # depends_on('clang-apple@9:', type='build') + + # when building documentation, this could be an optional dependency + depends_on('py-sphinx', type='build') + + def patch(self): + filter_file( + r'find_library\(_unwind_library_target unwind-\${libunwind_arch}', + r'find_library(_unwind_library_target unwind-${_libunwind_arch}', + 'cmake/FindUnwind.cmake' + ) + filter_file( + r'target_compile_definitions\(arbor-private-deps ARB_WITH_UNWIND\)', # noqa: E501 + r'target_compile_definitions(arbor-private-deps INTERFACE WITH_UNWIND)', # noqa: E501 + 'CMakeLists.txt' + ) + + def cmake_args(self): + args = [ + '-DARB_VECTORIZE=' + ('ON' if '+vectorize' in self.spec else 'OFF'), # noqa: E501 + '-DARB_WITH_GPU=' + ('ON' if '+gpu' in self.spec else 'OFF'), + '-DARB_WITH_PYTHON=' + ('ON' if '+python' in self.spec else 'OFF'), + ] + + if '+unwind' in self.spec: + args.append('-DUnwind_ROOT_DIR={0}'.format(self.spec['libunwind'].prefix)) # noqa: E501 + + return args |