-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
80 lines (77 loc) · 3.33 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
80
import sys, setuptools
from Cython.Build import cythonize
import numpy as np
from distutils.extension import Extension
from Cython.Compiler.Options import get_directive_defaults
directive_defaults = get_directive_defaults()
# directive_defaults['linetrace'] = True
# directive_defaults['binding'] = True
# Using compiler of clang with llvm installed on mac OSX
platform = sys.platform
libraries = []
if 'darwin' in platform: # darwin == OSX
# os.environ["CC"] = "/usr/local/opt/llvm/bin/clang"
# os.environ["CXX"] = "/usr/local/opt/llvm/bin/clang++"
openMP_arg = '-lomp'
if 'linux' in platform:
openMP_arg = '-fopenmp'
libraries.append('gomp')
if 'win32' in platform:
openMP_arg = '-fopenmp'
libraries.append('gomp')
if not openMP_arg:
raise RuntimeError('Could not define System OS!.')
print(f'Platform: {platform, openMP_arg}')
# Add include/link dirs, and modify the stdlib to libc++
ext_modules = [
Extension("febid.monte_carlo.compiled.etrajectory_c", ['febid/monte_carlo/compiled/etrajectory_c.pyx'],
# include_dirs=["/usr/local/opt/llvm/include"],
# library_dirs=["/usr/local/opt/llvm/lib"],
# extra_compile_args=["-w", '-fopenmp'],
# libraries=libraries,
# extra_link_args=[openMP_arg]
),
Extension("febid.libraries.ray_traversal.traversal", ['febid/libraries/ray_traversal/traversal.pyx'],
# include_dirs=["/usr/local/opt/llvm/include"],
# library_dirs=["/usr/local/opt/llvm/lib"],
# extra_compile_args=["-w", '-fopenmp'],
# libraries=libraries,
# extra_link_args=[openMP_arg]
),
Extension("febid.libraries.rolling.roll", ['febid/libraries/rolling/roll.pyx'],
# include_dirs=["/usr/local/opt/llvm/include"],
# library_dirs=["/usr/local/opt/llvm/lib"],
# extra_compile_args=["-w", '-fopenmp'],
# libraries=libraries,
# extra_link_args=[openMP_arg]
),
Extension("febid.libraries.pde.tridiag", ['febid/libraries/pde/tridiag.pyx'],
# include_dirs=["/usr/local/opt/llvm/include"],
# library_dirs=["/usr/local/opt/llvm/lib"],
# extra_compile_args=["-w", "-fopenmp"],
# libraries=libraries,
# extra_link_args=[openMP_arg]
),
]
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setuptools.setup(
name='febid',
version='0.9.5',
author='Alexander Kuprava, Michael Huth',
author_email='sandro1742@gmail.com',
description='FEBID process simulator',
long_description='Direct-write nano- and microscale chemical vapor deposition method using a beam of accelerated electrons.',
long_description_content_type="text/markdown",
url='https://github.com/MrCheatak/FEBID_py',
project_urls = {},
license='MIT',
packages=['febid', 'febid.monte_carlo', 'febid.monte_carlo.compiled', 'febid.ui', 'febid.libraries.vtk_rendering',
'febid.libraries.rolling', 'febid.libraries.ray_traversal', 'febid.libraries.pde'],
package_data = {'': ['*.pyx', 'ui/last_session_stub.yml']},
include_package_data=True,
install_requires=requirements,
ext_modules=cythonize(ext_modules),
include_dirs=[np.get_include()],
pyhton_requires='>=3.9',
)