-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
37 lines (29 loc) · 1.2 KB
/
setup.py
File metadata and controls
37 lines (29 loc) · 1.2 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
from setuptools import setup, Extension, find_packages
import numpy
include_dirs_numpy = [numpy.get_include()]
def check_compiler():
import subprocess
output = subprocess.Popen(['gcc'], stderr=subprocess.PIPE).communicate()[1]
if b'clang' in output:
return 'clang'
if b'gcc' in output:
return 'gcc'
if check_compiler() == 'clang':
integrals = Extension('posym.integrals',
extra_compile_args=['-std=c99'],
include_dirs=include_dirs_numpy,
sources=['c/integrals.c'])
else:
print ('openmp is used')
integrals = Extension('posym.integrals',
extra_compile_args=['-std=c99', '-fopenmp'],
extra_link_args=['-lgomp'],
include_dirs=include_dirs_numpy,
sources=['c/integrals.c'])
permutations = Extension('posym.permutation.permutations',
extra_compile_args=['-std=c99'],
include_dirs=include_dirs_numpy,
sources=['c/permutations.c'])
setup(packages=find_packages(where="."),
ext_modules=[integrals, permutations]
)