mirror of
https://github.com/ivabus/pantry
synced 2024-11-22 08:25:07 +03:00
+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:
parent
e21ae15b8b
commit
eab75c3bf6
3 changed files with 61 additions and 0 deletions
51
projects/numpy.org/package.yml
Normal file
51
projects/numpy.org/package.yml
Normal 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
|
6
projects/numpy.org/test.f90
Normal file
6
projects/numpy.org/test.f90
Normal 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
|
4
projects/numpy.org/test.py
Normal file
4
projects/numpy.org/test.py
Normal 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
|
Loading…
Reference in a new issue