You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another issue from me, though this one is a bit more basic/CMake-y than #20.
As said in #20, we are looking at maybe moving to use f2py-cmake in our code. In doing so, I encountered an issue. The circumstances are that we have two repos that would like to use it, say A and B. Repo B is standalone, but repo A includes repo B (as a submodule or whatever). Since we want both A and B to be able to build, both A and B have include(UseF2Py) calls in them. However, it seems like UseF2Py.cmake is not set up to handle that. My investigations seem to show it is due to (at least):
The _Python and _Python3 variables not being CACHE
command to add UseF2Py.cmake in both "repos" and then added "fixed" versions.
So, if you build with -DFIXED_FILE:BOOL=OFF you'll see the original error:
CMake Error at cmake/UseF2Py.cmake:43 (target_link_libraries):
Target "test_object" links to:
::NumPy
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
src/CMakeLists.txt:18 (f2py_object_library)
-- Generating done (0.0s)
But if you run with -DFIXED_FILE:BOOL=ON then it all succeeds.
Note: At this point, all I've shown is this seems to let things build. In the real case where I'm trying to use this, I have no idea how to run any of the code, so perhaps there are more issues, but this at least is something.
I'm hestitant to make a PR with my fix only because, well, I need to do more testing on our end. But this seems to be usable.
The text was updated successfully, but these errors were encountered:
Another issue from me, though this one is a bit more basic/CMake-y than #20.
As said in #20, we are looking at maybe moving to use f2py-cmake in our code. In doing so, I encountered an issue. The circumstances are that we have two repos that would like to use it, say A and B. Repo B is standalone, but repo A includes repo B (as a submodule or whatever). Since we want both A and B to be able to build, both A and B have
include(UseF2Py)
calls in them. However, it seems likeUseF2Py.cmake
is not set up to handle that. My investigations seem to show it is due to (at least):_Python
and_Python3
variables not beingCACHE
F2Py::Headers
not beingGLOBAL
I created a demonstration of this at https://github.com/mathomp4/f2py-cmake-bug which has a case of multiple calls to
include(UseF2Py.cmake)
In this repo, I used the:
command to add
UseF2Py.cmake
in both "repos" and then added "fixed" versions.So, if you build with
-DFIXED_FILE:BOOL=OFF
you'll see the original error:But if you run with
-DFIXED_FILE:BOOL=ON
then it all succeeds.Note: At this point, all I've shown is this seems to let things build. In the real case where I'm trying to use this, I have no idea how to run any of the code, so perhaps there are more issues, but this at least is something.
I'm hestitant to make a PR with my fix only because, well, I need to do more testing on our end. But this seems to be usable.
The text was updated successfully, but these errors were encountered: