Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abacus: version and feature update #42974

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
82ba7c8
add new versions
yizeyi18 Jan 30, 2024
93aa2d8
variants and depends
yizeyi18 Jan 30, 2024
076b67c
cmake build system
yizeyi18 Jan 30, 2024
e9c36e9
a elpa fix
yizeyi18 Jan 31, 2024
e5617a6
lapack fix: unable to use blas other than openblas currently
yizeyi18 Jan 31, 2024
b4bdd89
v3.5.3 update and experimental feature support
yizeyi18 Feb 28, 2024
dd30d88
disable outer-dependent experimental feature
yizeyi18 Feb 28, 2024
13c55e8
update for compatibility to Sugon dcu toolkit
yizeyi18 Mar 2, 2024
3acde90
maintainers update
yizeyi18 Mar 2, 2024
84ee25c
url update
yizeyi18 Mar 4, 2024
cd06de8
elpa dependent update
yizeyi18 Mar 4, 2024
e562287
[@spackbot] updating style on behalf of yizeyi18
yizeyi18 Mar 4, 2024
ea62977
spacify virtual denendent with spack v0.21 syntax
yizeyi18 Mar 4, 2024
5625890
Merge branch 'abacus' of https://github.com/yizeyi18/spack into abacus
yizeyi18 Mar 4, 2024
45218ea
[@spackbot] updating style on behalf of yizeyi18
yizeyi18 Mar 4, 2024
17044c3
fix flake8 issues
yizeyi18 Mar 4, 2024
02e0c27
[@spackbot] updating style on behalf of yizeyi18
yizeyi18 Mar 4, 2024
d72d923
v3.5.4 update
yizeyi18 Mar 4, 2024
c88a03c
fix typing error, add conflict flags for @:3.5.4
yizeyi18 Mar 4, 2024
3d7bc59
remove virtual dependency specification in conflict flags
yizeyi18 Mar 4, 2024
7d4af67
updating style on behalf of yizeyi18
yizeyi18 Mar 4, 2024
f7c95cc
package name fix
yizeyi18 Mar 4, 2024
699deb9
conflict fix
yizeyi18 Mar 4, 2024
675fa1b
simplift requires flag in `+rocm`
yizeyi18 Mar 28, 2024
484229d
update makefile edit method args
yizeyi18 Mar 28, 2024
62cdff7
Update var/spack/repos/builtin/packages/abacus/package.py
yizeyi18 Mar 28, 2024
3c96d82
Add dependency types for dependents
yizeyi18 Mar 28, 2024
94a4e01
add v3.6.0
yizeyi18 Mar 28, 2024
f38aa6b
replace string 'or' with to depends_on
yizeyi18 Apr 16, 2024
45ce442
remove newly-added deprecated versions
yizeyi18 Apr 16, 2024
ee81248
new version
yizeyi18 Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
267 changes: 250 additions & 17 deletions var/spack/repos/builtin/packages/abacus/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,218 @@

import re

from spack.build_systems import cmake, makefile
from spack.package import *


class Abacus(MakefilePackage):
class Abacus(MakefilePackage, CMakePackage, CudaPackage, ROCmPackage):
"""ABACUS (Atomic-orbital Based Ab-initio Computation at UStc)
is an open-source computer code package aiming
for large-scale electronic-structure simulations
from first principles"""

maintainers("bitllion")
maintainers("yizeyi18", "QuantumMisaka", "caic99")

build_system("cmake", conditional("makefile", when="@:2.3.4"), default="cmake")

homepage = "http://abacus.ustc.edu.cn/"
git = "https://github.com/abacusmodeling/abacus-develop.git"
url = "https://github.com/abacusmodeling/abacus-develop/archive/refs/tags/v2.2.1.tar.gz"
git = "https://github.com/deepmodeling/abacus-develop.git"
url = "https://github.com/deepmodeling/abacus-develop/archive/refs/tags/v2.2.1.tar.gz"

license("LGPL-3.0-or-later")

version("develop", branch="develop")
version("2.2.3", sha256="88dbf6a3bdd907df3e097637ec8e51fde13e2f5e0b44f3667443195481320edf")
version("2.2.2", sha256="4a7cf2ec6e43dd5c53d5f877a941367074f4714d93c1977a719782957916169e")
version("2.2.1", sha256="14feca1d8d1ce025d3f263b85ebfbebc1a1efff704b6490e95b07603c55c1d63")
version("2.2.0", sha256="09d4a2508d903121d29813a85791eeb3a905acbe1c5664b8a88903f8eda64b8f")
version("3.6.0", sha256="9efdfe91922e37526745df2ea3fa455ff062d3ad10092459faaeb038197bc710")
version("3.5.4", sha256="ab7cbdd07a951da116cc4fe4dfa23e7ac41dda9f35c35d16c267920f267f4722")
version("3.5.3", sha256="f56066473dbd562f170f40809738076c0862321499ae7fcbd71508581f9ba7bf")
version("3.5.2", sha256="b4823db244bc68cfa2cff0b4d33140051f56925b19c411f136ce27fb8e1ed3be")
version("3.5.1", sha256="0867b74ef866033d0120f8b1040fdae8f1dc72a113ffdac6b472b2c8bf1eaf0e")
version("3.5.0", sha256="0bc43af9bdb5b6a7bc30a72d680bb5054932ecedeb6fd3f4cdd3c4be0651c251")
version("3.4.4", sha256="654590f97b2ff3ec49f800da667f24fc34c3ff42b392248b9c88104f8d3bf010")
version("3.4.3", sha256="2c40d2d688ba599d2dcfa916c0e44a5d1a79d04213a9351830aaf231e6e321fe")
version("3.4.2", sha256="251594ad864580181a26149819572631b757480ee9ce49a473d48855e55a084e")
version("3.4.1", sha256="20f9a0e99320b1d4cf477ee55a17d1d88c2aa0b019c9a714d38a27a9cc700953")
version("3.4.0", sha256="01ea63f921596f574d7eb93762724dbd45b01416bec8e3f719834ed7d2e7ed57")
version("3.3.4", sha256="f9ef0baa624e39eb4f8a4fd7533d1bdd8f61ee3764a62ac980f51238aa102e38")
version("3.3.3", sha256="8de5904656f7f83c5f5df32b0f05ec2d28c2fbb832576532f7714ea545620327")
version("3.3.2", sha256="dc3049f68efa72d4e8c3e2c34e7553dbb057242cea3fbca062d5dd484e42bc53")
version("3.3.1", sha256="29e1a78e1e370e45c5730df4a4b5ae52de74d0cf86771ca9f62dde34643f0f2d")
version("3.3.0", sha256="9979572b0a60f74e1de432afeec072e16e0994b6a8f5fd5fb9985c3ff34d7816")
version("3.2.5", sha256="8b96f9e509dedfb3cb43f802715a3ea8bde5d499a525171e314eebe6993c5897")
version("3.2.4", sha256="65a84a4a02a085c42f86d54b487bf3f1501a45f940370a8a7527c881145f78d6")
version("3.2.3", sha256="e01d2dd82ec1732499ea92a8ba48660593bc4ba4e165c1347b772561a005866d")
version("3.2.2", sha256="80c11f6e7fa0b58cd3ef61ed101e519733eed32d7ddd125d9dbccc363f33ffa0")
version("3.2.1", sha256="05389d66cb4e019764d2f1c8b51cfd445174c229629abe00dd4d31bfdc8ade08")
version("3.2.0", sha256="cf7de312f6ddf1957621d6acc198ca4aa4e20924df7b4fda69454758e4614ea4")
version("3.1.4", sha256="4aaf150d74e1c01726f012d23aa1e40e119cac9b8330ae425a29ec3b1040ef1c")
version("3.1.3", sha256="ca056628472c8959f93f78e8e4fe10e1ea51a0b3333cef0c8c841dd22f9c0d1b")
version("3.1.2", sha256="0fcebc659754deecfa912391a14ee9749c84ec45849e8b231ad9c765602826d4")
version("3.1.1", sha256="a268a28e8dce2da98260265cb8edd0a16dd4a307a5016022c5cd2598e9df93c9")
version("3.1.0", sha256="f038e20c712276c5a7c8f26ed6af6ff5d7c57110accd45882d11b1d64dee3f90")
version("3.0.5", sha256="81ff1b8f10909eeda2d888f97f615e5b92aa26c101a32f36f346f78aa7638ba9")
version("3.0.4", sha256="b01714e734b0aa5b0b52f3d7871e4bc9f6c81f25a444b1287e3f2e98a4f5d289")
version("3.0.3", sha256="a4ae83cdb2c5029f152064f163d1b66b265980793d76b79908c073027401d2fc")
version("3.0.2", sha256="b0c3aad9cac18d0ca73c78c69326031407af6a4bfcc953b3a27506c298bc59a3")
version("3.0.1", sha256="812941146c31ab53c9a7695abbca6bfb36ae55878e38f8d0f13a17f3d9c36dc0")
version("3.0.0", sha256="1c1299f53788beb2f6b6180d8484d584b6f293c81cea25f45b9632dd608ba4f9")
Comment on lines +32 to +63
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need all these versions? Or can we get by with the latest patch for each minor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed llvm's version-including strategy; patching minors is also acceptable. As a fast-releasing package, I suppose including versions directly.

version(
"2.3.5",
sha256="81c44be76c820b59a8b95f2b398c772160068a5e323f319e33704ff87dbefc5e",
deprecated=True,
)
version(
"2.3.4",
sha256="16b817311c8055cf055021d895642fbb913585f08ec96f9aff3e0ef20148ec0e",
deprecated=True,
)
version(
"2.3.3",
sha256="a1246c4a6de385826cae15d9a446e862331eb189a592622b1014c7b49504c908",
deprecated=True,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add versions that start as deprecated 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Removed by 45ce442.

version(
"2.3.2",
sha256="edcaae88e51360548bbdf1bcbd5048bec0d309b4fe11d8d11d5425afc001e9a1",
deprecated=True,
)
version(
"2.3.1",
sha256="e9522469f499bcb1c57ec05e9866403e4142c97762d7662b4b638f7493bf5122",
deprecated=True,
)
version(
"2.3.0",
sha256="c5a803a1a596983681d65aff46762f2f6b82b5f50449a53d0ec7dad368d35842",
deprecated=True,
)
version(
"2.2.4",
sha256="1f3923d32c392fd2564d137b076134aebdc461dc3148c535a00f9b10a615157a",
deprecated=True,
)
version(
"2.2.3",
sha256="88dbf6a3bdd907df3e097637ec8e51fde13e2f5e0b44f3667443195481320edf",
deprecated=True,
)
version(
"2.2.2",
sha256="4a7cf2ec6e43dd5c53d5f877a941367074f4714d93c1977a719782957916169e",
deprecated=True,
)
version(
"2.2.1",
sha256="14feca1d8d1ce025d3f263b85ebfbebc1a1efff704b6490e95b07603c55c1d63",
deprecated=True,
)
version(
"2.2.0",
sha256="09d4a2508d903121d29813a85791eeb3a905acbe1c5664b8a88903f8eda64b8f",
deprecated=True,
)

variant("mpi", default=True, description="Enable MPI support")
variant("openmp", default=True, description="Enable OpenMP support")
variant(
"lcao",
default=True,
description="Enable Linear Combinition of Atomic Orbital calculation",
when="+mpi",
)
variant("libxc", default=True, description="Support additional functionals via libxc")
variant(
"elpa",
default=True,
description="Enable optimised diagonalisation routines from ELPA",
when="+lcao",
)
variant("mathlib", default=False, description="Enable ABACUS's builtin libm")
variant(
"tests", default=False, description="Build ABACUS unit tests", when="build_system=cmake"
)
Comment on lines +101 to +103
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid the variant and use self.run_tests instead? Or is this variant installing something in the prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing installed. What is self.run_tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a variable that is set to True when the package is installed asking for build-time tests. You can grep the builtin repo to see how it's used. One example would be hdf5, for instance.

variant(
"benchmarks",
default=False,
description="Enable ABACUS's builtin benchmark tests",
when="+tests",
)
Comment on lines +104 to +109
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here.

variant("rocm", default=False, description="(Experimental)Enable rocm support")
alalazo marked this conversation as resolved.
Show resolved Hide resolved
# TODO: Add support for
# LibRI(https://github.com/abacusmodeling/LibRI),
# LibComm(https://github.com/abacusmodeling/LibComm),
# Libnpy(https://github.com/llohse/libnpy/),
# DeePKS(https://github.com/deepmodeling/deepks-kit),
# DeePMD(https://github.com/deepmodeling/deepmd-kit),
# LibPAW-interface(https://github.com/wenfei-li/libpaw_interface),
# At 2024-1-30, none of above have a spack package.

depends_on("fftw-api@3")
depends_on("blas")
depends_on("lapack")

with when("+mpi"):
depends_on("mpi", type=("build", "link", "run"))
with when("+libxc"):
depends_on("libxc", type=("build", "link"))
with when("+lcao"):
depends_on("cereal", type=("build"))
depends_on("scalapack", type=("link"))
with when("+elpa"):
depends_on("elpa", type=("build", "link"))
with when("+tests"):
depends_on("googletest", type="test")
with when("+benchmarks"):
depends_on("benchmark", type="test")
with when("+openmp"):
depends_on("fftw+openmp", when="^[virtuals=fftw-api] fftw")
depends_on("elpa+openmp", when="+elpa")
depends_on(
"openblas threads=openmp",
when="^[virtuals=blas] openblas" or "^[virtuals=lapack] openblas",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would evaluate to the first arg, so you can simply use:

Suggested change
depends_on(
"openblas threads=openmp",
when="^[virtuals=blas] openblas" or "^[virtuals=lapack] openblas",
)
depends_on(
"openblas threads=openmp",
when="^[virtuals=blas] openblas",
)

As far as I know openblas provides lapack and blas together (it cannot build on top of other blas libraries).

Copy link
Contributor Author

@yizeyi18 yizeyi18 Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some corner cases, openblas could be concretized as only a lapack provider, e. g.:

one corner case example

yizeyi18@DESKTOP-5UK5DD4:~/soft/spack$ spack spec -l abacus ^netlib-xblas
Input spec
--------------------------------
 -   abacus
 -       ^netlib-xblas

Concretized
--------------------------------
 -   q44hmr5  abacus@develop%gcc@13.2.0~cuda+elpa~ipo+lcao+libxc~mathlib+mpi+openmp~rocm~tests build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-skylake
[+]  uhgc4yl      ^cereal@1.3.2%gcc@13.2.0~ipo build_system=cmake build_type=Release generator=make patches=2dfa0bf arch=linux-ubuntu22.04-skylake
[e]  5jtet3y      ^cmake@3.22.1%gcc@13.2.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-ubuntu22.04-skylake
 -   xccstl6      ^elpa@2023.05.001%gcc@13.2.0~autotune~cuda+mpi+openmp~rocm build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  sjr3v5h          ^libtool@2.4.7%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  tdejqfr              ^m4@1.4.19%gcc@13.2.0+sigsegv build_system=autotools patches=9dc5fbd,bfdffa7 arch=linux-ubuntu22.04-skylake
[e]  nodstrc                  ^diffutils@3.8%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  wq3ghrz                  ^libsigsegv@2.14%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[e]  zg3y6s6          ^python@3.10.6%gcc@13.2.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,7d40923,f2fd060 arch=linux-ubuntu22.04-skylake
[+]  eonvvfe      ^gcc-runtime@13.2.0%gcc@13.2.0 build_system=generic arch=linux-ubuntu22.04-skylake
[e]  6cnijfi      ^gmake@4.3%gcc@13.2.0~guile build_system=autotools patches=599f134 arch=linux-ubuntu22.04-skylake
[e]  c4hwk6l      ^intel-oneapi-mkl@2023.2.0%gcc@13.2.0~cluster+envmods~ilp64+shared build_system=generic mpi_family=none threads=none arch=linux-ubuntu22.04-skylake
[e]  vkj5jcu      ^intel-oneapi-mpi@2021.10.0%gcc@13.2.0+envmods~external-libfabric~generic-names~ilp64 build_system=generic arch=linux-ubuntu22.04-skylake
[+]  xqbit2c      ^libxc@6.2.2%gcc@13.2.0~cuda~kxc~lxc+shared build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  4kvryat          ^autoconf@2.69%gcc@13.2.0 build_system=autotools patches=35c4492,7793209,a49dd5b arch=linux-ubuntu22.04-skylake
[+]  344ajhj          ^automake@1.16.5%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  x6tczzn          ^perl@5.38.0%gcc@13.2.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-ubuntu22.04-skylake
[+]  bbwnq6p              ^berkeley-db@18.1.40%gcc@13.2.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu22.04-skylake
[+]  aynbov5              ^bzip2@1.0.8%gcc@13.2.0~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-skylake
[+]  2cxlzy6              ^gdbm@1.23%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  epwc5ug                  ^readline@8.2%gcc@13.2.0 build_system=autotools patches=bbf97f1 arch=linux-ubuntu22.04-skylake
[+]  ghcbbga                      ^ncurses@6.4%gcc@13.2.0~symlinks+termlib abi=none build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  xm23fkm                          ^pkgconf@1.9.5%gcc@13.2.0 build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  saszwn4              ^zlib-ng@2.1.3%gcc@13.2.0+compat+opt build_system=autotools patches=299b958,ae9077a,b692621 arch=linux-ubuntu22.04-skylake
 -   cyx2ffx      ^netlib-scalapack@2.2.0%gcc@13.2.0~ipo~pic+shared build_system=cmake build_type=Release generator=make patches=072b006,1c9ce5f,244a9aa arch=linux-ubuntu22.04-skylake
 -   omuynna      ^netlib-xblas@1.0.248%gcc@13.2.0+fortran+plain_blas build_system=autotools arch=linux-ubuntu22.04-skylake
[+]  wgxa4ex      ^openblas@0.3.23%gcc@13.2.0~bignuma~consistent_fpcsr+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=openmp arch=linux-ubuntu22.04-skylake

In this example, netlib-xblas, openblas, netlib-scalapack and intel-oneapi-mkl serves as provider of blas, lapack, scalapack and fftw-api.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is:

>>> "foo" or "bar"
'foo'

so the argument above evaluates as the first operand

with when("~openmp"):
depends_on("elpa~openmp", when="+elpa")

requires("%clang", when="+rocm", msg="build with rocm requires rocm compiler")

conflicts(
"^blis",
when="@:3.5.4",
msg="abacus spack package supports openblas/mkl as blas/lapack provider",
)
conflicts(
"^libflame",
when="@:3.5.4",
msg="abacus spack package supports openblas/mkl as blas/lapack provider",
)
conflicts(
"^amdblis",
when="@:3.5.4",
msg="abacus spack package supports openblas/mkl as blas/lapack provider",
)
conflicts(
"^amdlibflame",
when="@:3.5.4",
msg="abacus spack package supports openblas/mkl as blas/lapack provider",
)
# netlab-lapack+external-blas do NOT contain libblas.so and not detectable
# for abacus CMake script.
conflicts(
"^[virtuals=lapack] netlib-lapack~external-blas",
when="@:3.5.4",
msg="abacus spack package supports openblas/mkl as blas/lapack provider",
)
conflicts(
"^netlib-xblas",
when="@:3.5.4",
msg="abacus spack package supports openblas/mkl as blas/lapack provider",
)

depends_on("elpa+openmp", when="+openmp")
depends_on("elpa~openmp", when="~openmp")
depends_on("cereal")
depends_on("libxc")
depends_on("fftw")
# MPI is a necessary dependency
depends_on("mpi", type=("build", "link", "run"))
depends_on("mkl")

class MakefileBuilder(makefile.MakefileBuilder):
yizeyi18 marked this conversation as resolved.
Show resolved Hide resolved
build_directory = "source"

def edit(self, spec, prefix):
def edit(self, pkg, spec, prefix):
if "+openmp" in spec:
inc_var = "_openmp-"
system_var = "ELPA_LIB = -L${ELPA_LIB_DIR} -lelpa_openmp -Wl, -rpath=${ELPA_LIB_DIR}"
Expand Down Expand Up @@ -98,3 +273,61 @@ def edit(self, spec, prefix):

def install(self, spec, prefix):
install_tree("bin", prefix.bin)


class CMakeBuilder(cmake.CMakeBuilder):
def cmake_args(self):
spec = self.spec
args = [
self.define_from_variant("ENABLE_MPI", "mpi"),
self.define_from_variant("USE_OPENMP", "openmp"),
self.define_from_variant("USE_ELPA", "elpa"),
self.define_from_variant("USE_ABACUS_LIBM", "mathlib"),
self.define_from_variant("ENABLE_LCAO", "lcao"),
self.define_from_variant("ENABLE_LIBXC", "libxc"),
self.define_from_variant("ENABLE_GOOGLEBENCH", "benchmarks"),
self.define_from_variant("BUILD_TESTING", "tests"),
self.define_from_variant("USE_ROCM", "rocm"),
self.define_from_variant("USE_CUDA", "cuda"),
]

blas = spec["blas"]
lapack = spec["lapack"]
# fftw = spec["fftw-api"]
# scalapack = spec["scalapack"] if spec.satisfies("+lcao") else ""
if blas.name in ["intel-mkl", "intel-parallel-studio", "intel-oneapi-mkl"]:
args += [self.define("MKLROOT", spec["mkl"].prefix)]
elif spec.satisfies("@:3.5.4"):
args.extend(
[
self.define("LAPACK_FOUND", True),
self.define(
"LAPACK_LIBRARY", lapack.libs
), # must be single lib with both blas&lapack routines
]
)

# avoid misdirecting to global visible elpa from apt, dnf, etc.
if spec.satisfies("+elpa"):
elpa = spec["elpa"]
elpa_include = elpa.headers.directories[0]
args += [self.define("ELPA_INCLUDE_DIRS", elpa_include)]

if spec.satisfies("+rocm"):
args += [self.define("COMMIT_INFO", False)]
args += [self.define("ROCM_PATH", spec["hip"].prefix)]
# build all c++ part with rocm compiler.
# cpu and gpu parts can be seperately build, but not done.
# args += [
# self.define(
# "CMAKE_CXX_COMPILER",
# join_path(spec["llvm-amdgpu"].prefix.bin,"clang++")
# )
# ]
# only work for dcu toolkit 23.10 environment, not sure if any other version needs
args += [
self.define(
"HIP_CXX_COMPILER", join_path(spec["llvm-amdgpu"].prefix.bin, "clang++")
)
]
return args