-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwscript
49 lines (39 loc) · 1.48 KB
/
wscript
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
#!/usr/bin/env python
#-*- coding:utf-8 -*-
top = "."
out = "build"
def options(opt):
opt.load("compiler_c")
opt.load("python")
opt.load("cython")
def configure(conf):
conf.load("python")
conf.check_python_version((2, 7))
conf.check_python_module("numpy")
conf.check_python_module("scipy")
#conf.check_python_module("skimage")
try:
conf.check_python_module('matplotlib')
except conf.errors.ConfigurationError:
print('could not find matplotlib (ignored)')
try:
conf.check_python_module('pyfftw')
except conf.errors.ConfigurationError:
print('could not find pyfftw (ignored)')
conf.load("compiler_c")
conf.load("cython")
conf.check_python_headers()
# make sure the NumPy headers are in the include path:
import numpy as np
numpy_header_path = np.get_include()
conf.env.append_value("INCLUDES", numpy_header_path)
print("Using NumPy headers in %s"%numpy_header_path) # TODO: use waf logging instead
conf.env.CFLAGS = ["-O2", "-fPIC", "-fopenmp", "-march=native", "-ftree-vectorizer-verbose=1"]
conf.env.LINKFLAGS = ["-fopenmp"]
conf.env.CYTHONFLAGS = ["--directive", "profile=False",
"--directive", "cdivision=True",
#"--directive", "boundscheck=False",
"--directive", "wraparound=False",
"--directive", "nonecheck=False"]
def build(bld):
bld.recurse("pyoptics")