-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
BUG: f2py compile error with full path of signature file on Windows #22211
Comments
I've tracked down the origin of this to the expansion of Lines 514 to 525 in 5bc5976
If I manually specify a |
Incidentially, I see that the f2py compile process itself makes use of Line 607 in 5bc5976
Line 636 in 5bc5976
What is the numpy strategy going forward with this, with the deprecation of distutils and numpy.distutils? |
This is only for
Note that the core functionality of |
@jmrohwer I just saw the comment on gh-22225, and that reminded me of this issue. Is it still relevant? I'll note that you should not be using |
@rgommers I am happy to close this. Apologies for the delayed reply, I was travelling.
Is there any good documentation or examples on this I could use as a reference or starting point? I am not an expert in these build systems and the project (PySCeS) started out using |
Tracking in #25199, so I'll close this here 😄 . |
Describe the issue:
I am trying to port the build system for a python package (https://github.com/PySCeS/pysces) from
numpy.distutils
to usescikit-build
because of the deprecation of distutils (the package contains 2 Fortran extension modules wrapped withf2py
). To get to know the system I’ve started with a minimal example. I have been getting compile failures on Windows (on Linux and macOS everything works).I have posted this on SO and on the Fortran discourse group but have not had any replies despite quite a number of reads. Links for cross-reference:
During compilation of the module with
python setup.py build
the build fails. In tracking it down I saw that cmake expands the full path of the source files and this is where it fails. To ensure that it is not a problem with the skbuild build system I verified that the failure can be reproduced on the command line using f2py on its own as follows - save the Fortran files in the code block below to the same folder and then run in a command prompt:This works as expected and generates the
.pyd
and.dll
files. However, when specifying the full path as follows (and as it is called in skbuild), it fails:The traceback produced is appended below. The problem seems to be with the
creating C:Users
part leading to the malformed filename in the last line. Specifying only the filename forhi.pyf
but the full path forhi.f
does work strangely enough, but as soon as the full path forhi.pyf
is specified it fails. As mentioned, on Linux and macOS all works fine.Reproduce the code example:
Error message:
NumPy/Python version information:
Context for the issue:
Any project utilizing f2py to wrap Fortran code, and which includes a custom
.pyf
file, cannot be built withscikit-build
which becomes problematic oncedistutils
andnumpy.distutils
are no longer available.The text was updated successfully, but these errors were encountered: