forked from sayerhs/exawind-sim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
79 lines (67 loc) · 1.99 KB
/
setup.py
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
68
69
70
71
72
73
74
75
76
77
78
79
# -*- coding: utf-8 -*-
"""\
ExaWind Modeling and Simulation Environment
============================================
"""
import os
from pathlib import Path
from skbuild import setup
VERSION = "0.0.1"
classifiers = [
"Development Status :: 3 -Alpha",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Physics"
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Utilities",
]
dependencies = [
"tioga",
"trilinos",
"amrex",
"nalu-wind",
"amr-wind",
]
def cmake_prefix_path():
"""Create CMake prefix path"""
def root_dir(dname):
"""Return root dir variable"""
key = dname.replace("-", "_").upper() + "_ROOT_DIR"
return os.environ.get(key, None)
paths = []
exw_dir = os.environ.get("EXAWIND_INSTALL_DIR", None)
for dep in dependencies:
pth = root_dir(dep)
if pth is not None:
paths.append(pth)
continue
if (exw_dir is not None) and (Path(exw_dir) / dep).exists():
paths.append(str(Path(exw_dir) / dep))
else:
print("Cannot find package: %s"%dep)
return "-DCMAKE_PREFIX_PATH=" + ";".join(paths) if paths else None
cmake_args = []
prefix_path = cmake_prefix_path()
if prefix_path is not None:
cmake_args = [ prefix_path ]
setup(
name="exawind-sim",
version=VERSION,
url="https://github.com/sayerhs/py-exawind",
license="Apache License, Version 2.0",
description="ExaWind Modeling and Simulation Environment",
long_description=__doc__,
author="Shreyas Ananthan",
maintainer="Shreyas Ananthan",
platforms="any",
classifiers=classifiers,
include_package_data=True,
packages=[
'exwsim',
],
cmake_args = cmake_args,
)