-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
57 lines (47 loc) · 1.41 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
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys, os
try:
from skbuild import setup
except ImportError:
print(
"Please update pip, you need pip 10 or greater,\n"
" or you need to install the PEP 518 requirements in pyproject.toml yourself",
file=sys.stderr,
)
raise
from setuptools import find_packages
from setuptools.command.install import install
"""
class InstallCommand(install):
user_options = install.user_options + [
('openmp', None, "Build package wih OpenMP."),
]
def initialize_options(self):
install.initialize_options(self)
self.openmp = None
def finalize_options(self):
install.finalize_options(self)
def run(self):
global openmp
exit()
openmp = self.openmp # will be 1 or None
install.run(self)
"""
def set_cmake_args():
openmp_arg = os.environ.get('BUILD_OPENMP', default=None)
if openmp_arg:
return ["-DBUILD_PYTHON=ON", "-DBUILD_OPENMP=" + openmp_arg]
else:
return ["-DBUILD_PYTHON=ON"]
setup(
name="QEDCascPy",
description="A package to model strong field QED interactions.",
author="Robbie Watt",
license="MIT",
packages=find_packages(where = 'Source/Python'),
package_dir={"": "Source/Python"},
cmake_args=set_cmake_args(),
cmake_install_dir="Source/Python/QEDCascPy",
include_package_data = True
)