Skip to content
Snippets Groups Projects
Commit d23e7640 authored by EXT Jean-Matthieu Etancelin's avatar EXT Jean-Matthieu Etancelin
Browse files

improve f2py options in meson configuration

parent 06dc6b0b
No related branches found
No related tags found
No related merge requests found
Pipeline #189223 passed
......@@ -17,7 +17,7 @@ endif
# -
message('Generate f2py_f2cmap file.')
conf_data = configuration_data({
'f2pymap_for_real': f2pymap_for_real,
'f2pymap_for_real': f2pymap_for_real,
})
configure_file(input : 'f2py_f2cmap.tmpl',
output : 'f2py_f2cmap',
......@@ -28,9 +28,9 @@ configure_file(input : 'f2py_f2cmap.tmpl',
# -
message('Generate precision.f90 file')
conf_data = configuration_data({
'WORKING_PRECISION': working_precision,
'MPI_PRECISION' : mpi_precision
})
'WORKING_PRECISION': working_precision,
'MPI_PRECISION' : mpi_precision
})
prec_file = configure_file(input : 'precision.f90_tmpl',
output : 'precision.f90',
configuration : conf_data)
......@@ -84,7 +84,7 @@ custom_target_command=[py, '-m', 'numpy.f2py',
# When using -DF2PY_REPORT_ATEXIT, a performance report of F2PY
# interface is printed out at exit (platforms: Linux).
#
# When using -DF2PY_REPORT_ON_ARRAY_COPY=<int>, a message is
# When using -DWITH_F2PY_REPORT_COPY=ON -DF2PY_REPORT_ON_ARRAY_COPY=<int>, a message is
# sent to stderr whenever F2PY interface makes a copy of an
# array. Integer <int> sets the threshold for array sizes when
# a message should be shown.
......@@ -223,11 +223,18 @@ f90f_source = custom_target('f2hysopmodule',
depends : libhysop_fortran # Important !
)
f2py_c_args =['-DWITH_F2PY_REPORT_COPY=OFF', '-DWITH_F2PY_REPORT_EXIT=OFF']
if debug == 'ON'
f2py_c_args =['-DWITH_F2PY_REPORT_COPY=ON', '-DF2PY_REPORT_ON_ARRAY_COPY=1',
'-DWITH_F2PY_REPORT_EXIT=ON', '-DF2PY_REPORT_ATEXIT']
endif
if profile == 'ON'
f2py_c_args =['-DWITH_F2PY_REPORT_EXIT=ON', '-DF2PY_REPORT_ATEXIT']
endif
py.extension_module('f2hysop',
[src_f90_4_f2py, f90f_source],
incdir_f2py / 'fortranobject.c',
c_args :['-DF2PY_REPORT_ON_ARRAY_COPY=1',
'-DF2PY_REPORT_ATEXIT'],
c_args :f2py_c_args,
link_with : libhysop_fortran,
include_directories: extension_incdir,
dependencies : py_dep,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment