2022-01-13 03:21:41 +08:00
|
|
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
|
2021-12-17 21:22:46 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2021-12-17 21:22:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Autodiff(CMakePackage):
|
|
|
|
"""autodiff is automatic differentiation made easier for C++."""
|
|
|
|
|
|
|
|
homepage = "https://autodiff.github.io"
|
2022-07-31 06:19:18 +08:00
|
|
|
url = "https://github.com/autodiff/autodiff/archive/refs/tags/v0.6.4.tar.gz"
|
2021-12-17 21:22:46 +08:00
|
|
|
list_url = "https://github.com/autodiff/autodiff/releases"
|
2022-07-31 06:19:18 +08:00
|
|
|
git = "https://github.com/autodiff/autodiff.git"
|
2021-12-17 21:22:46 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
maintainers = ["wdconinc", "HadrienG2"]
|
2021-12-17 21:22:46 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
version("0.6.4", sha256="cfe0bb7c0de10979caff9d9bfdad7e6267faea2b8d875027397486b47a7edd75")
|
|
|
|
version("0.5.13", sha256="a73dc571bcaad6b44f74865fed51af375f5a877db44321b5568d94a4358b77a1")
|
2021-12-17 21:22:46 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
variant(
|
|
|
|
"python", default="False", description="Enable the compilation of the python bindings."
|
|
|
|
)
|
|
|
|
variant(
|
|
|
|
"examples", default="False", description="Enable the compilation of the example files."
|
|
|
|
)
|
2021-12-17 21:22:46 +08:00
|
|
|
|
2022-07-31 06:19:18 +08:00
|
|
|
depends_on("cmake@3.0:", type="build")
|
|
|
|
depends_on("eigen")
|
|
|
|
depends_on("py-pybind11", type=("build", "run"))
|
2021-12-17 21:22:46 +08:00
|
|
|
|
|
|
|
def cmake_args(self):
|
|
|
|
args = [
|
2022-07-31 06:19:18 +08:00
|
|
|
self.define("AUTODIFF_BUILD_TESTS", self.run_tests),
|
|
|
|
self.define_from_variant("AUTODIFF_BUILD_PYTHON", "python"),
|
|
|
|
self.define_from_variant(
|
|
|
|
"AUTODIFF_BUILD_EXAMPLES",
|
|
|
|
"examples",
|
|
|
|
),
|
2021-12-17 21:22:46 +08:00
|
|
|
]
|
|
|
|
return args
|