+numpy.org (#4526)

* new file:   projects/numpy.org/package.yml
	new file:   projects/numpy.org/test.f90
	new file:   projects/numpy.org/test.py

* remove PYTHONPATH from test
This commit is contained in:
Andrew 2023-12-21 22:39:14 +02:00 committed by GitHub
parent e21ae15b8b
commit eab75c3bf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,51 @@
distributable:
url: https://github.com/numpy/numpy/releases/download/v{{version}}/numpy-{{version}}.tar.gz
strip-components: 1
versions:
github: numpy/numpy
dependencies:
openblas.net: ^0.3
python.org: ^3.11
gnu.org/gcc: ^13 #gfortran (no Fortran compiler found)
runtime:
env:
PYTHONPATH: $PYTHONPATH:{{prefix}}/lib/python{{deps.python.org.version.major}}/site-packages
build:
dependencies:
cython.org/libcython: '*'
llvm.org: '*' # fails with gcc
script:
- run: |
cat <<EOF > site.cfg
[openblas]
libraries = openblas
library_dirs = {{deps.openblas.net.prefix}}/lib
include_dirs = {{deps.openblas.net.prefix}}/include
EOF
- python -m pip install --prefix={{prefix}} .
- run: ln -s python{{deps.python.org.version.marketing}} python{{deps.python.org.version.major}}
working-directory: ${{prefix}}/lib
- run: |
sed -i.bak "s|{{deps.python.org.prefix}}/bin/python|/usr/bin/env python|g" f2py
rm f2py.bak
working-directory: ${{prefix}}/bin
env:
# ld unrecognized option '--version'
CC: clang
CXX: clang++
LD: clang
ATLAS: None
darwin:
BLAS: ${{deps.openblas.net.prefix}}/lib/libopenblas.dylib
LAPACK: ${{deps.openblas.net.prefix}}/lib/libopenblas.dylib
linux:
BLAS: ${{deps.openblas.net.prefix}}/lib/libopenblas.so
LAPACK: ${{deps.openblas.net.prefix}}/lib/libopenblas.so
provides:
- bin/f2py
test:
script:
- python test.py
- f2py -v | grep {{version}}
- f2py -c -m test test.f90
- ls | grep test.cpython

View file

@ -0,0 +1,6 @@
! example.f90
subroutine add_numbers(a, b, c)
real, intent(in) :: a, b
real, intent(out) :: c
c = a + b
end subroutine add_numbers

View file

@ -0,0 +1,4 @@
import numpy as np
t = np.ones((3,3), int)
assert t.sum() == 9
assert np.dot(t, t).sum() == 27