File tree Expand file tree Collapse file tree 7 files changed +62
-0
lines changed Expand file tree Collapse file tree 7 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.5...3.22)
2+
3+ project (hello LANGUAGES C Fortran)
4+
5+ find_package (PythonExtensions REQUIRED)
6+ find_package (NumPy REQUIRED)
7+ find_package (F2PY REQUIRED)
8+
9+ add_subdirectory (hello)
Original file line number Diff line number Diff line change 1+ add_f2py_target(_hello _hello.pyf hello.f90)
2+ add_library (_hello STATIC ${_hello} )
3+ python_extension_module(_hello)
4+
5+ target_link_libraries (_hello ${F2PY_LIBRARIES} )
6+ target_include_directories (_hello PRIVATE ${F2PY_INCLUDE_DIRS} )
7+
8+ install (TARGETS _hello LIBRARY DESTINATION hello)
Original file line number Diff line number Diff line change 1+ from ._hello import hello
Original file line number Diff line number Diff line change 1+ ! -*- f90 -*-
2+ ! Note: the context of this file is case sensitive.
3+
4+ python module _hello ! in
5+ interface ! in :_hello
6+ subroutine hello(a) ! in :_hello:hello.f90
7+ character*(*) :: a
8+ end subroutine hello
9+ end interface
10+ end python module _hello
11+
12+ ! This file was auto-generated with f2py (version:1.24.2).
13+ ! See:
14+ ! https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e
Original file line number Diff line number Diff line change 1+ ! generate a signature file from this file with:
2+ ! $ python -m numpy.f2py hello.f90 -m _hello -h _hello.pyf
3+ ! and edit if helpful (see F2PY docs)
4+ subroutine hello (a )
5+ character (len=* ) :: a
6+ print * ," Hello, " // a // " !"
7+ end subroutine hello
Original file line number Diff line number Diff line change 1+ [project ]
2+ name = " hello-f2py"
3+ version = " 1.2.3"
4+ description = " a minimal example package (cython version)"
5+ authors = [
6+ {name = " The scikit-build team" },
7+ ]
8+ license = {text = " MIT" }
9+ requires-python = " >=3.7"
10+
11+ [build-system ]
12+ requires = [
13+ " setuptools>=42" ,
14+ " scikit-build>=0.13" ,
15+ " cmake>=3.18" ,
16+ " ninja" ,
17+ " cython" ,
18+ " numpy" ,
19+ ]
20+ build-backend = " setuptools.build_meta"
Original file line number Diff line number Diff line change 1+ from skbuild import setup
2+
3+ setup (packages = ["hello" ])
You can’t perform that action at this time.
0 commit comments