|
1 | 1 | project('f2py_examples', 'c', |
2 | 2 | version : '0.1', |
3 | | - default_options : ['warning_level=2']) |
| 3 | + license: 'BSD-3', |
| 4 | + meson_version: '>=0.64.0', |
| 5 | + default_options : ['warning_level=2'], |
| 6 | +) |
4 | 7 |
|
5 | 8 | add_languages('fortran') |
6 | 9 |
|
7 | 10 | py_mod = import('python') |
8 | | -py3 = py_mod.find_installation('python3') |
9 | | -py3_dep = py3.dependency() |
10 | | -message(py3.path()) |
11 | | -message(py3.get_install_dir()) |
| 11 | +py = py_mod.find_installation(pure: false) |
| 12 | +py_dep = py.dependency() |
12 | 13 |
|
13 | | -incdir_numpy = run_command(py3, |
| 14 | +incdir_numpy = run_command(py, |
14 | 15 | ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], |
15 | 16 | check : true |
16 | 17 | ).stdout().strip() |
17 | 18 |
|
18 | | -incdir_f2py = run_command(py3, |
| 19 | +incdir_f2py = run_command(py, |
19 | 20 | ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], |
20 | 21 | check : true |
21 | 22 | ).stdout().strip() |
22 | 23 |
|
23 | 24 | fibby_source = custom_target('fibbymodule.c', |
24 | | - input : ['fib1.f'], # .f so no F90 wrappers |
25 | | - output : ['fibbymodule.c', 'fibby-f2pywrappers.f'], |
26 | | - command : [ py3, '-m', 'numpy.f2py', '@INPUT@', |
27 | | - '-m', 'fibby', '--lower']) |
| 25 | + input : ['fib1.f'], # .f so no F90 wrappers |
| 26 | + output : ['fibbymodule.c', 'fibby-f2pywrappers.f'], |
| 27 | + command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'fibby', '--lower'] |
| 28 | +) |
28 | 29 |
|
29 | 30 | inc_np = include_directories(incdir_numpy, incdir_f2py) |
30 | 31 |
|
31 | | -py3.extension_module('fibby', |
32 | | - 'fib1.f', |
33 | | - fibby_source, |
34 | | - incdir_f2py+'/fortranobject.c', |
35 | | - include_directories: inc_np, |
36 | | - dependencies : py3_dep, |
37 | | - install : true) |
| 32 | +py.extension_module('fibby', |
| 33 | + ['fib1.f', fibby_source], |
| 34 | + incdir_f2py / 'fortranobject.c', |
| 35 | + include_directories: inc_np, |
| 36 | + dependencies : py_dep, |
| 37 | + install : true |
| 38 | +) |
0 commit comments