Skip to content

Commit 0bf54d3

Browse files
itcarrollhenryiii
authored andcommitted
incorrect hello-f2py
1 parent 2c70c57 commit 0bf54d3

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

projects/hello-f2py/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from ._hello import hello
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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

projects/hello-f2py/pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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"

projects/hello-f2py/setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from skbuild import setup
2+
3+
setup(packages=["hello"])

0 commit comments

Comments
 (0)