Skip to content

Commit 4397282

Browse files
committed
add get_pkg_config, work on README
1 parent 84edd9f commit 4397282

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1-
# Building OpenBLAS
1+
# OpenBLAS
22

3-
This is a repository to trigger builds of OpenBLAS on Travis-CI (for aarch64,
4-
ppc64, s390x) and github actions for all the others.
3+
We build OpenBLAS on Travis-CI (for linux aarch64, ppc64, s390x) and github actions
4+
for linux, windows, macOS x86_64 and macOS arm64.
55

6-
The OpenBLAS libraries get uploaded to
6+
Tarballs are at
77
https://anaconda.org/scientific-python-nightly-wheels/openblas-libs/files
88

9-
A project using these libraries, for Manylinux or macOS, will need the
9+
A project using the tarball, for Manylinux or macOS, will need the
1010
``gfortran-install`` submodule used here, from
1111
https://github.com/MacPython/gfortran-install
1212

13+
We also build and upload a pip-installable wheel. The wheel is self-contianed,
14+
no additional fortran support installations are needed. The wheel supplies
15+
interfaces for building and using OpenBLAS in a python project like SciPy or
16+
NumPy:
17+
18+
## Buildtime
19+
20+
- `get_include_dir()`, `get_lib_dir()` and `get_library()` for use in compiler
21+
or project arguments
22+
- `get_pkg_config()` will return a multi-line text that can be saved into a
23+
file and used with pkg-config for build systems like meson. This works around
24+
the problem of [relocatable pkg-config
25+
files](https://docs.conan.io/en/1.43/integrations/build_system/pkg_config_pc_files.html)
26+
since the windows build uses pkgconfiglite v0.28 which does not support
27+
`--define-prefix`.
28+
29+
## Runtime
30+
31+
- `open_so()` will load openblas into the executable and provide the openblas
32+
symbols linked in from the `get_include_dir()` includes (on windows linking
33+
with `get_lib_dir()`/`get_libarary()` is required).

local/openblas/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from pathlib import Path
22

33
from . import _init_openblas
4+
from textwrap import dedent
45

56

67
_HERE = Path(__file__).resolve().parent
78

9+
__all__ = ["get_include_dir", "get_lib_dir", "get_library", "get_pkg_config"]
810

911
# Use importlib.metadata to single-source the version
1012

@@ -34,3 +36,20 @@ def get_lib_dir():
3436

3537
def get_library():
3638
return "openblas_python"
39+
40+
def get_pkg_config():
41+
return f"""\
42+
libdir={_HERE}/lib
43+
includedir={_HERE}/include
44+
openblas_config= USE_64BITINT= DYNAMIC_ARCH=1 DYNAMIC_OLDER= NO_CBLAS= NO_LAPACK= NO_LAPACKE= NO_AFFINITY=1 USE_OPENMP= PRESCOTT MAX_THREADS=24
45+
version=0.3.23
46+
extralib=-lm -lpthread -lgfortran -lm -lpthread -lgfortran
47+
Name: openblas
48+
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
49+
Version: ${version}
50+
URL: https://github.com/xianyi/OpenBLAS
51+
Libs: -L${libdir} -lopenblas
52+
Libs.private: ${extralib}
53+
Cflags: -I${includedir}
54+
"""
55+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = "openblas"
11-
version = "0.3.20"
11+
version = "0.3.23"
1212
requires-python = ">=3.7"
1313
description = "Provides OpenBLAS for python packaging"
1414
readme = "README.md"

0 commit comments

Comments
 (0)