8000 BLD,BUG: quadmath required where available [f2py] by HaoZeke · Pull Request #25073 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BLD,BUG: quadmath required where available [f2py] #25073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions doc/source/f2py/windows/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,30 @@ F2PY and Windows

.. warning::

F2PY support for Windows is not at par with Linux support, and
OS specific flags can be seen via ``python -m numpy.f2py``
F2PY support for Windows is not always at par with Linux support

.. note::
`ScPy's documentation`_ has some information on system-level dependencies
which are well tested for Fortran as well.

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

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

The focus of this section is to establish a guideline for developing and
extending Fortran modules for Python natively, via F2PY on Windows.
extending Fortran modules for Python natively, via F2PY on Windows.

Currently supported toolchains are:

- Mingw-w64 C/C++/Fortran compilers
- Intel compilers
- Clang-cl + Flang
- MSVC + Flang

Overview
========

From a user perspective, the most UNIX compatible Windows
development environment is through emulation, either via the Windows Subsystem
on Linux, or 8000 facilitated by Docker. In a similar vein, traditional
Expand Down Expand Up @@ -206,3 +217,4 @@ path using a hash. This needs to be added to the ``PATH`` variable.
.. _are outdated: https://github.com/conda-forge/conda-forge.github.io/issues/1044
.. _now deprecated: https://github.com/numpy/numpy/pull/20875
.. _LLVM Flang: https://releases.llvm.org/11.0.0/tools/flang/docs/ReleaseNotes.html
.. _ScPy's documentation: http://scipy.github.io/devdocs/building/index.html#system-level-dependencies
4 changes: 4 additions & 0 deletions numpy/f2py/_backends/meson.build.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project('${modulename}',
'warning_level=1',
'buildtype=${buildtype}'
])
fc = meson.get_compiler('fortran')

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

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

py.extension_module('${modulename}',
[
Expand All @@ -37,6 +40,7 @@ ${source_list},
include_directories: [inc_np],
dependencies : [
py_dep,
quadmath_dep,
${dep_list}
],
install : true)
0