Is the f2py interface maintained?

31 views
Skip to first unread message

Johann Rohwer

unread,
Aug 26, 2022, 9:53:21 AM8/26/22
to scikit-build
Hi all,

I am trying to move the build for a project from numpy.distutils to scikit-build (because of the forthcoming deprecation of distutils), and am trying to learn the process. I see that the repo https://github.com/scikit-build/scikit-build-sample-projects has a branch add-f2py-sample-projects which has not been merged and which was last updated 5 years ago, but the build fails, so something in the configuration must have changed. Build output below.

System:
  • Manjaro linux
  • Python 3.10.5
  • cmake 3.23.3
  • scikit-build 0.15.0
  • ninja 1.10.2.3
  • gcc/gfortran 12.1.1
What should be changed to get this example to work?

Thanks, Johann


scikit-build-sample-projects/projects/hello-f2py on  add-f2py-sample-projects via skbuild  
python setup.py build


--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 12.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is GNU 12.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jr/src/git/scikit-build-sample-projects/projects/hello-f2py/_cmake_test_com
pile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - success
--------------------------------------------------------------------------------

Configuring Project
 Working directory:
   /home/jr/src/git/scikit-build-sample-projects/projects/hello-f2py/_skbuild/linux-x86_64-3.10/cmake-build
 Command:
   cmake /home/jr/src/git/scikit-build-sample-projects/projects/hello-f2py -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/home
/jr/src/git/scikit-build-sample-projects/projects/hello-f2py/_skbuild/linux-x86_64-3.10/cmake-install -DPYTHON_VERSION
_STRING:STRING=3.10.5 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/jr/.virtualenvs/skbuild/lib/python3.10/si
te-packages/skbuild/resources/cmake -DPython3_EXECUTABLE:FILEPATH=/home/jr/.virtualenvs/skbuild/bin/python -DPython3_I
NCLUDE_DIR:PATH=/usr/include/python3.10 -DPython3_LIBRARY:PATH=/usr/lib/libpython3.10.so -DPython3_NumPy_INCLUDE_DIRS:
PATH=/home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/core/include -DPython_EXECUTABLE:FILEPATH=/home/
jr/.virtualenvs/skbuild/bin/python -DPython_INCLUDE_DIR:PATH=/usr/include/python3.10 -DPython_LIBRARY:PATH=/usr/lib/li
bpython3.10.so -DPython_NumPy_INCLUDE_DIRS:PATH=/home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/core/
include -DPYTHON_EXECUTABLE:FILEPATH=/home/jr/.virtualenvs/skbuild/bin/python -DPYTHON_INCLUDE_DIR:PATH=/usr/include/p
ython3.10 -DPYTHON_LIBRARY:PATH=/usr/lib/libpython3.10.so -DPYTHON_NumPy_INCLUDE_DIRS:PATH=/home/jr/.virtualenvs/skbui
ld/lib/python3.10/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/home/jr/.virtualenvs/skbuild/lib/pyt
hon3.10/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE:STRING=Release

-- The C compiler identification is GNU 12.1.1
-- The CXX compiler identification is GNU 12.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/jr/.virtualenvs/skbuild/bin/python (found version "3.10.5")  
-- Found PythonLibs: /usr/lib/libpython3.10.so (found version "3.10.5")  
-- Found F2PY: /home/jr/.virtualenvs/skbuild/bin/f2py3 (found version "1.23.2")  
-- F2PY_INCLUDE_DIR:/home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src
-- NumPy_INCLUDE_DIR:
-- Performing Test Weak Link MODULE -> SHARED (gnu_ld_ignore) - Success
_modinit_prefix:PyInit_
-- PYTHON_EXTENSION_MODULE_SUFFIX:.cpython-310-x86_64-linux-gnu.so
-- Configuring done
-- Generating done
CMake Warning:
 Manually-specified variables were not used by the project:                                                           
                                                                                                                      
   PYTHON_NumPy_INCLUDE_DIRS                                                                                          
   Python3_EXECUTABLE                                                                                                 
   Python3_INCLUDE_DIR                                                                                                
   Python3_LIBRARY                                                                                                    
   Python3_NumPy_INCLUDE_DIRS                                                                                         
   Python_EXECUTABLE                                                                                                  
   Python_INCLUDE_DIR                                                                                                 
   Python_LIBRARY                                                                                                     
   Python_NumPy_INCLUDE_DIRS                                                                                          
   SKBUILD                                                                                                            
                                                                                                                      
                                                                                                                      
-- Build files have been written to: /home/jr/src/git/scikit-build-sample-projects/projects/hello-f2py/_skbuild/linux-
x86_64-3.10/cmake-build
[1/7] Building C object CMakeFiles/_f2py_runtime_library....python3.10/site-packages/numpy/f2py/src/fortranobject.c.o
FAILED: CMakeFiles/_f2py_runtime_library.dir/home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src/
fortranobject.c.o  
/usr/bin/cc  -I/usr/include/python3.10 -O3 -DNDEBUG -MD -MT CMakeFiles/_f2py_runtime_library.dir/home/jr/.virtualenvs/
skbuild/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.c.o -MF CMakeFiles/_f2py_runtime_library.dir/home/jr
/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.c.o.d -o CMakeFiles/_f2py_runtime_libr
ary.dir/home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.c.o -c /home/jr/.virtua
lenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.c
In file included from /home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.c:2:
/home/jr/.virtualenvs/skbuild/lib/python3.10/site-packages/numpy/f2py/src/fortranobject.h:13:10: fatal error: numpy/ar
rayobject.h: No such file or directory
  13 | #include "numpy/arrayobject.h"
     |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.




Jean-Christophe Fillion-Robin

unread,
Dec 14, 2022, 5:45:31 PM12/14/22
to scikit-build
Hi Johann,

Thanks for reaching out and providing all these details.

In the process of transitioning to GitHub Discussions, I moved your question to https://github.com/scikit-build/scikit-build/discussions/821

Thanks for understanding,
J-Christophe

Ps: For details about our transition plan to GitHub Discussions, see https://github.com/scikit-build/scikit-build/issues/800
Reply all
Reply to author
Forward
0 new messages