Debian Codegraph @

tools/spack/cp2k_dev_repo/packages/lammps_user_pace/package.py

raw
1 # Copyright Spack Project Developers. See COPYRIGHT file for details.
2 #
3 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
4
5 from spack.package import *
6 from spack_repo.builtin.build_systems.cmake import CMakePackage
7
8
9 class LammpsUserPace(CMakePackage):
10 """Atomic Cluster Expansion (ACE) for carbon. The ACE was parameterized based
11 on an exhaustive set of important carbon structures that were computed using
12 accurate density functional theory (DFT) calculations."""
13
14 homepage = "https://github.com/ICAMS/lammps-user-pace"
15 url = "https://github.com/ICAMS/lammps-user-pace/archive/v.2023.11.25.fix2.tar.gz"
16 git = "https://github.com/ICAMS/lammps-user-pace.git"
17
18 license("GPL-2.0-only OR GPL-3.0-only", checked_by="mkrack")
19
20 maintainers("mkrack")
21
22 version(
23 "2023.11.25.fix2",
24 sha256="e0885351a8a730f5576dace2374fa470523a4526383c6a64af571e1344a40686",
25 )
26
27 variant("cxx_standard", default="11", description="Required CXX standard")
28 variant("pic", default=True, description="Compile position independent code (PIC)")
29
30 depends_on("cxx", type="build")
31
32 def cmake_args(self):
33 args = [
34 self.define_from_variant("CXX_STANDARD", "cxx_standard"),
35 self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
36 ]
37 return args
38
39 def install(self, spec, prefix):
40 mkdirp(join_path(prefix.include, "ace"))
41 install("ML-PACE/ace/*.h", join_path(prefix.include, "ace"))
42 mkdirp(join_path(prefix.include, "ace-evaluator"))
43 install("ML-PACE/ace-evaluator/*.h", join_path(prefix.include, "ace-evaluator"))
44 copy_tree("yaml-cpp/include", prefix.include)
45 with working_dir(prefix.lib, create=True):
46 for lib in ["libpace.a", "libcnpy.a", "build-yaml-cpp/libyaml-cpp-pace.a"]:
47 install(join_path(self.build_directory, lib), prefix.lib)