Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion repos/spack_repo/builtin/packages/adiak/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import os

from spack_repo.builtin.build_systems.cmake import CMakePackage

from spack.package import *
Expand All @@ -19,12 +21,15 @@ class Adiak(CMakePackage):

variant("mpi", default=True, description="Build with MPI support")
variant("shared", default=True, description="Build dynamic libraries")
variant("python", default=False, when="@0.5.0:", description="Build Python bindings")

license("MIT")

version("master", branch="master")
version(
"0.4.1", commit="7ac997111785bee6d9391664b1d18ebc2b3c557b", submodules=True, preferred=True
"0.5.0", commit="f08c8375c613e13e9b9c6a1db271cbf8f0d3f3e3", submodules=True, preferred=True
)
version("0.4.1", commit="7ac997111785bee6d9391664b1d18ebc2b3c557b", submodules=True)
version("0.4.0", commit="7e8b7233f8a148b402128ed46b2f0c643e3b397e", submodules=True)
version("0.2.2", commit="3aedd494c81c01df1183af28bc09bade2fabfcd3", submodules=True)
version("0.2.1", commit="950e3bfb91519ecb7b7ee7fa3063bfab23c0e2c9", submodules=True)
Expand All @@ -36,6 +41,11 @@ class Adiak(CMakePackage):

depends_on("mpi", when="+mpi")

with when("+python"):
extends("python")
depends_on("python@3:", type=("build", "link", "run"))
depends_on("[email protected]:", type=("build", "link", "run"))

def cmake_args(self):
args = []
if self.spec.satisfies("+mpi"):
Expand All @@ -50,5 +60,12 @@ def cmake_args(self):
else:
args.append("-DBUILD_SHARED_LIBS=OFF")

if self.spec.satisfies("+python"):
args.append("-DENABLE_PYTHON_BINDINGS=ON")
pybind11_cmake = os.path.join(
self.spec["py-pybind11"].prefix, "pybind11", "share", "cmake", "pybind11"
)
args.append(f"-Dpybind11_DIR={pybind11_cmake}")

args.append("-DENABLE_TESTS=OFF")
return args
Loading