8000 Merge pull request #25073 from HaoZeke/winF2PYquadmath · numpy/numpy@58cbbe0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 58cbbe0

Browse files
authored
Merge pull request #25073 from HaoZeke/winF2PYquadmath
BLD,BUG: quadmath required where available [f2py]
2 parents fc8292d + 929f239 commit 58cbbe0

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

doc/source/f2py/windows/index.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,30 @@ F2PY and Windows
66

77
.. warning::
88

9-
F2PY support for Windows is not at par with Linux support, and
10-
OS specific flags can be seen via ``python -m numpy.f2py``
9+
F2PY support for Windows is not always at par with Linux support
10+
11+
.. note::
12+
`ScPy's documentation`_ has some information on system-level dependencies
13+
which are well tested for Fortran as well.
1114

1215
Broadly speaking, there are two issues working with F2PY on Windows:
1316

1417
- the lack of actively developed FOSS Fortran compilers, and,
1518
- the linking issues related to the C runtime library for building Python-C extensions.
1619

1720
The focus of this section is to establish a guideline for developing and
18-
extending Fortran modules for Python natively, via F2PY on Windows.
21+
extending Fortran modules for Python natively, via F2PY on Windows.
22+
23+
Currently supported toolchains are:
24+
25+
- Mingw-w64 C/C++/Fortran compilers
26+
- Intel compilers
27+
- Clang-cl + Flang
28+
- MSVC + Flang
1929

2030
Overview
2131
========
32+
2233
From a user perspective, the most UNIX compatible Windows
2334
development environment is through emulation, either via the Windows Subsystem
2435
on Linux, or facilitated by Docker. In a similar vein, traditional
@@ -206,3 +217,4 @@ path using a hash. This needs to be added to the ``PATH`` variable.
206217
.. _are outdated: https://g DCA2 ithub.com/conda-forge/conda-forge.github.io/issues/1044
207218
.. _now deprecated: https://github.com/numpy/numpy/pull/20875
208219
.. _LLVM Flang: https://releases.llvm.org/11.0.0/tools/flang/docs/ReleaseNotes.html
220+
.. _ScPy's documentation: http://scipy.github.io/devdocs/building/index.html#system-level-dependencies

numpy/f2py/_backends/meson.build.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ project('${modulename}',
66
'warning_level=1',
77
'buildtype=${buildtype}'
88
])
9+
fc = meson.get_compiler('fortran')
910

1011
py = import('python').find_installation(pure: false)
1112
py_dep = py.dependency()
@@ -28,6 +29,8 @@ inc_f2py = include_directories(incdir_f2py)
2829
fortranobject_c = incdir_f2py / 'fortranobject.c'
2930

3031
inc_np = include_directories(incdir_numpy, incdir_f2py)
32+
# gh-25000
33+
quadmath_dep = fc.find_library('quadmath', required: false)
3134

3235
py.extension_module('${modulename}',
3336
[
@@ -37,6 +40,7 @@ ${source_list},
3740
include_directories: [inc_np],
3841
dependencies : [
3942
py_dep,
43+
quadmath_dep,
4044
${dep_list}
4145
],
4246
install : true)

0 commit comments

Comments
 (0)
0