-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
49 lines (44 loc) · 1.29 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
import subprocess
import sys
from setuptools import setup
from libs.pybind11.setup_helpers import Pybind11Extension
p = subprocess.Popen("cmake pyqpp",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
prefix = "Detecting Eigen3 - done (in "
eigen_path = None
print("Running cmake pyqpp")
for line in p.stdout.read().decode('ascii').split('\n'):
print(line)
pos = line.find(prefix)
if pos != -1:
eigen_path = line[pos + len(prefix):-1]
break
if eigen_path is None:
raise Exception('Eigen3 not found!')
ext_modules = [
Pybind11Extension(
"pyqpp",
["pyqpp/qpp_wrapper.cpp"],
extra_compile_args=["-Ilibs", "-Iinclude", "-Iqasmtools/include",
"-I" + eigen_path],
cxx_std=17,
include_pybind11=False,
),
]
setup(
name='pyqpp',
version='3.1',
description='Python 3 wrapper for Quantum++',
long_description=open('pyqpp/README.md').read(),
long_description_content_type='text/markdown',
author='softwareQ',
author_email='info@softwareq.ca',
url='https://github.com/softwareQinc/qpp',
license='MIT',
platforms=sys.platform,
install_requires=[
'numpy',
],
ext_modules=ext_modules)