-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
67 lines (55 loc) · 1.61 KB
/
setup.py
File metadata and controls
67 lines (55 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import sys
import os
from lyncs_setuptools import setup, CMakeExtension, find_package
requirements = [
"lyncs-cppyy",
"lyncs-utils>=0.2.2",
"appdirs",
]
findCUDA = find_package("CUDA")
if findCUDA["found"]:
requirements.append(f"cupy-cuda{findCUDA['version'].replace('.','')}")
print("LYNCS_QUDA requirements:", *requirements, sep="\n")
QUDA_CMAKE_ARGS = {
"CMAKE_BUILD_TYPE": "RELEASE",
"QUDA_BUILD_SHAREDLIB": "ON",
"QUDA_BUILD_ALL_TESTS": "OFF",
"QUDA_GPU_ARCH": os.environ.get("QUDA_GPU_ARCH", "sm_60"),
"QUDA_MPI": os.environ.get("QUDA_MPI", "OFF"),
"QUDA_MULTIGRID": "ON",
"QUDA_CLOVER_DYNAMIC": "OFF",
"QUDA_CLOVER_RECONSTRUCT": "OFF",
}
findMPI = find_package("MPI")
if findMPI["cxx_found"] and os.environ.get("QUDA_MPI", None) in (None, "ON"):
requirements.append("lyncs_mpi")
QUDA_CMAKE_ARGS["QUDA_MPI"] = "ON"
QUDA_CMAKE_ARGS = [key + "=" + val for key, val in QUDA_CMAKE_ARGS.items()]
print("QUDA options:", *QUDA_CMAKE_ARGS, sep="\n")
def post_build(*args, **kwargs):
exec(open("post_build.py").read(), globals())
post_build(*args, **kwargs)
setup(
"lyncs_quda",
exclude=["*.config"],
ext_modules=[
CMakeExtension(
"lyncs_quda.lib",
".",
["-DQUDA_CMAKE_ARGS='-D%s'" % ";-D".join(QUDA_CMAKE_ARGS)],
post_build=post_build,
)
],
data_files=[(".", ["post_build.py"])],
install_requires=requirements,
extras_require={
"hmc": ["aim"],
},
keywords=[
"Lyncs",
"quda",
"Lattice QCD",
"python",
"interface",
],
)