1
+ project (' numpy_quaddtype' , ' c' , ' cpp' , default_options : [' cpp_std=c++17' , ' b_pie=true' ])
2
+
3
+ py_mod = import (' python' )
4
+ py = py_mod.find_installation()
5
+
6
+ c = meson .get_compiler(' c' )
7
+
8
+ sleef_dep = c.find_library (' sleef' )
9
+ sleefquad_dep = c.find_library (' sleefquad' )
10
+
11
+ incdir_numpy = run_command (py,
12
+ [
13
+ ' -c' ,
14
+ ' import numpy; import os; print(os.path.relpath(numpy.get_include()))'
15
+ ],
16
+ check : true
17
+ ).stdout().strip()
18
+
19
+ includes = include_directories (
20
+ [
21
+ incdir_numpy,
22
+ ' numpy_quaddtype/src' ,
23
+ ]
24
+ )
25
+
26
+ srcs = [
27
+ ' numpy_quaddtype/src/casts.h' ,
28
+ ' numpy_quaddtype/src/casts.cpp' ,
29
+ ' numpy_quaddtype/src/scalar.h' ,
30
+ ' numpy_quaddtype/src/scalar.c' ,
31
+ ' numpy_quaddtype/src/dtype.h' ,
32
+ ' numpy_quaddtype/src/dtype.c' ,
33
+ ' numpy_quaddtype/src/quaddtype_main.c' ,
34
+ ' numpy_quaddtype/src/scalar_ops.h' ,
35
+ ' numpy_quaddtype/src/scalar_ops.cpp' ,
36
+ ' numpy_quaddtype/src/ops.hpp' ,
37
+ ' numpy_quaddtype/src/umath.h' ,
38
+ ' numpy_quaddtype/src/umath.cpp' ,
39
+ ' numpy_quaddtype/src/dragon4.h' ,
40
+ ' numpy_quaddtype/src/dragon4.c'
41
+ ]
42
+
43
+ py.install_sources(
44
+ [
45
+ ' numpy_quaddtype/__init__.py' ,
46
+ ],
47
+ subdir : ' numpy_quaddtype' ,
48
+ pure : false
49
+ )
50
+
51
+ py.extension_module(' _quaddtype_main' ,
52
+ srcs,
53
+ c_args : [' -g' , ' -O0' , ' -lsleef' , ' -lsleefquad' ],
54
+ dependencies : [sleef_dep, sleefquad_dep],
55
+ install : true ,
56
+ subdir : ' numpy_quaddtype' ,
57
+ include_directories : includes
58
+ )
0 commit comments