forked from bastikr/pycppqed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
61 lines (51 loc) · 1.79 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
from distutils.core import setup, Extension, Command
import unittest
import numpy as np
import sys
import os
cio = Extension("pycppqed.cio", sources=["pycppqed/io.c"])
library_dirs_args = filter(lambda s:s.startswith('--library-dirs'), sys.argv)
if library_dirs_args:
library_dirs = []
for l in library_dirs_args:
library_dirs += l.split('=')[1].split(':')
sys.argv.remove(l)
else:
library_dirs = None
ciobin = Extension("pycppqed.ciobin", sources=["pycppqed/iobin.cc"], libraries=['boost_serialization','blitz'], library_dirs=library_dirs, runtime_library_dirs=library_dirs)
class test(Command):
"""
Run all available tests of pycppqed.
"""
user_options = []
initialize_options = lambda s:None
finalize_options = lambda s:None
def run(self):
from pycppqed import test_initialconditions, test_io, test_statevector
testsuits = {
"initialconditions": test_initialconditions.suite(),
"io": test_io.suite(),
"statevector": test_statevector.suite(),
}
suite = unittest.TestSuite(testsuits.values())
unittest.TextTestRunner(verbosity=2).run(suite)
ext_modules = [cio]
if '--add-iobin' in sys.argv:
ext_modules.append(ciobin)
sys.argv.remove('--add-iobin')
setup(
name = "PyCppQED",
version = "0.1.2",
author = "Sebastian Kraemer",
author_email = "[email protected]",
url = "http://github.com/bastikr/pycppqed",
license = "BSD",
packages = ('pycppqed','teazertools'),
package_data={'teazertools':['generic_submitter_defaults.conf']},
ext_modules = ext_modules,
scripts=('bin/calculate_mean','bin/cppqedjob','bin/postprocessjob','bin/submitter'),
cmdclass = {
"test": test,
},
include_dirs = [np.get_include()]
)