Skip to content

Commit 97f2893

Browse files
authored
Merge pull request #130 from Dirreke/update-docs
Update docs
2 parents 48ed5ff + 985c2b2 commit 97f2893

File tree

5 files changed

+151
-18
lines changed

5 files changed

+151
-18
lines changed

.github/workflows/openblas-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request: {}
7+
paths:
8+
- 'openblas-build/**'
9+
- '.github/workflows/openblas-build.yml'
10+
pull_request:
11+
paths:
12+
- 'openblas-build/**'
813
workflow_dispatch: {}
914

1015
jobs:

.github/workflows/openblas-src.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request: {}
7+
paths:
8+
- 'openblas-build/**'
9+
- 'openblas-src/**'
10+
- '.github/workflows/openblas-src.yml'
11+
- '*.toml'
12+
pull_request:
13+
paths:
14+
- 'openblas-build/**'
15+
- 'openblas-src/**'
16+
- '.github/workflows/openblas-src.yml'
17+
- '*.toml'
818
workflow_dispatch: {}
919

1020
jobs:

.github/workflows/rust.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request: {}
7+
pull_request:
8+
paths:
9+
- 'openblas-build/**'
10+
- 'openblas-src/**'
11+
- '.github/workflows/rust.yml'
12+
- '*.toml'
813
workflow_dispatch: {}
914

1015
jobs:

CHANGELOG.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,51 @@
1-
These versions are based on [semantic versioning][semver], and corresponds to the version in [openblas-src/Cargo.toml](openblas-src/Cargo.toml).
1+
# CHANGELOG
22

3-
[semver]: https://semver.org/
4-
5-
Unreleased
3+
[Unreleased](https://github.com/blas-lapack-rs/openblas-src/compare/openblas-src-v0.10.8...master)
64
-----------
75

6+
### What's Changed
7+
8+
* Take proxy environment variables into account by @xoolive in https://github.com/blas-lapack-rs/openblas-src/pull/120
9+
* rewrite CI by @gkobeaga and @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/123
10+
* Update OpenBLAS to version 0.3.28 by @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/119
11+
* Use pkg-config and fix build on doc.rs by @Fuuzetsu ,@j-baker and @HenrikJStromberg in https://github.com/blas-lapack-rs/openblas-src/pull/125
12+
* Add cache for windows CI by @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/128
13+
Refactor code, Drop LAPACKE inspection, Drop FORTRAN check by @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/127
14+
* Detect TARGET, CC, HOSTCC, FC automically when cross-compiling by @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/129
15+
* Update README and CHANGELOGS by @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/130
16+
17+
[0.10.9 - 2022-12-25](https://github.com/blas-lapack-rs/openblas-src/compare/openblas-src-v0.10.8...openblas-src-v0.10.9)
18+
--------------------
19+
20+
### What's Changed
21+
22+
* Use ubuntu 22.04 image on CI by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/110
23+
* OpenBLAS v0.3.25 & Extended Target Support & Build Fixes by @gkobeaga in https://github.com/blas-lapack-rs/openblas-src/pull/108
24+
* add rerun-if flags by @Dirreke in https://github.com/blas-lapack-rs/openblas-src/pull/105
25+
* respect OPENBLAS_{{CC, FC, HOSTCC}} env vars on linux by @mike-kfed in https://github.com/blas-lapack-rs/openblas-src/pull/102
26+
* Use macos-14 instance for CI by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/112
27+
28+
[0.10.8 - 2022-12-25](https://github.com/blas-lapack-rs/openblas-src/compare/openblas-src-v0.10.7...openblas-src-v0.10.8)
29+
--------------------
30+
31+
### What's Changed
32+
33+
* Use native-tls/native-certs features of ureq crate by @lazareviczoran in https://github.com/blas-lapack-rs/openblas-src/pull/98
34+
35+
[0.10.7 - 2022-12-25](https://github.com/blas-lapack-rs/openblas-src/compare/openblas-src-v0.10.5...openblas-src-v0.10.7)
36+
--------------------
37+
38+
0.10.6 has been yanked
39+
40+
### What's Changed
41+
42+
* homebrew directory depends on architecture. Include libomp libs by @maparent in https://github.com/blas-lapack-rs/openblas-src/pull/89
43+
* Use `brew --prefix` command to get library path by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/93
44+
* Upgrade OpenBLAS to 0.3.21 by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/92
45+
* Use tar.gz image of OpenBLAS by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/95
46+
* Expand tar.gz on `OUT_DIR` by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/96
47+
* Download OpenBLAS source code from GitHub Release in build.rs by @termoshtt in https://github.com/blas-lapack-rs/openblas-src/pull/97
48+
849
0.10.5 - 2022-08-27
950
--------------------
1051

@@ -15,7 +56,7 @@ From this release, `openblas-build` crate will have same version as `openblas-sr
1556

1657
### Changed
1758
- OpenBLAS 0.3.20 https://github.com/blas-lapack-rs/openblas-src/pull/85
18-
- OpenBLAS 0.3.17 https://github.com/blas-lapack-rs/openblas-src/pull/76
59+
- OpenBLAS 0.3.17 https://github.com/blas-lapack-rs/openblas-src/pull/76
1960
- Use dynamic CRT link for vcpkg https://github.com/blas-lapack-rs/openblas-src/pull/69 https://github.com/blas-lapack-rs/openblas-src/pull/71
2061

2162
### Internal

README.md

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,25 @@ The following Cargo features are supported:
1111
* `cache` to build in a shared directory instead of `target` (see below),
1212
* `cblas` to build CBLAS (enabled by default),
1313
* `lapacke` to build LAPACKE (enabled by default),
14-
* `static` to link to OpenBLAS statically, and
14+
* `static` to link to OpenBLAS statically,
1515
* `system` to skip building the bundled OpenBLAS.
1616

17+
Note: On Windows, OpenBLAS can not be built from source. The `system` feature is
18+
supposed to be used.
19+
20+
## Dependencies
21+
22+
If you want to build OpenBLAS from source, you need to have the following dependencies
23+
installed:
24+
25+
* HOSTCC compiler (e.g., `gcc`, `clang`, or `icc`),
26+
* `make`,
27+
* CC compiler of the target architecture (e.g., `aarch64-linux-gnu-gcc` for `aarch64`),
28+
* Fortran compiler of the target architecture(e.g., `gfortran`, `flang`, or `ifort`),
29+
if there is no Fortran compiler detected, the flag `NOFORTRAN` should be set to `1`
30+
and `OpenBLAS` will only compile BLAS and f2c-converted LAPACK. For more information,
31+
please refer to the [Use f2c translations of LAPACK when no Fortran compiler is available][f2c-translations].
32+
1733
## Caching
1834

1935
The `cache` feature allows the OpenBLAS build products to be reused between
@@ -45,31 +61,84 @@ To link OpenBLAS statically, install `openblas` for the `x64-windows-static-md`
4561
vcpkg install openblas --triplet x64-windows-static-md
4662
```
4763

48-
To link OpenBLAS and C Runtime (CRT) statically, install `openblas` for the `x64-windows-static` triplet:
64+
To link OpenBLAS and C Runtime (CRT) statically, install `openblas` for the
65+
`x64-windows-static` triplet:
4966

5067
```sh
5168
vcpkg install openblas --triplet x64-windows-static
5269
```
5370

5471
and build with `+crt-static` option
5572

56-
```
73+
```sh
5774
RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-pc-windows-msvc
5875
```
5976

60-
Please see the ["Static and dynamic C runtimes" in The Rust reference](https://doc.rust-lang.org/reference/linkage.html#static-and-dynamic-c-runtimes) for detail.
77+
Please see the ["Static and dynamic C runtimes" in The Rust reference][crt-static] for detail.
78+
79+
## ENV variables
6180

62-
## Cross Compilation
81+
### Proxy
82+
83+
The `openblas-src` crate will detect and use proxy settings from your environment
84+
variables, such as `http_proxy` and `https_proxy` to download necessary dependencies.
85+
86+
### Build System through OpenBLAS
87+
88+
According to the [OpenbLAS build system], the variables used by OpenBLAS could be
89+
passed through environment, such as `DYNAMIC_LIST`, `NUM_THREADS`.
90+
91+
**HOWEVER**, for some of the variables, the `openblas-src` crate rename them to
92+
others to avoid conflicts with the existing envs. The following is the list of
93+
the variables that are renamed:
94+
95+
| OpenBLAS variable | openblas-src variable |
96+
| ----------------- | --------------------- |
97+
| TARGET | OPENBLAS_TARGET |
98+
| CC | OPENBLAS_CC |
99+
| FC | OPENBLAS_FC |
100+
| HOSTCC | OPENBLAS_HOSTCC |
101+
| RANLIB | OPENBLAS_RANLIB |
102+
103+
## Cross-compile
63104

64105
Apart from providing the `--target` option to `cargo build`, one also has to
65106
specify the [cross-compilation variables of OpenBLAS][openblas-cross-compile].
66107
They can be set as environment variables for `cargo build` using the `OPENBLAS_`
67108
prefix as follows: `OPENBLAS_CC`, `OPENBLAS_FC`, `OPENBLAS_HOSTCC`, and
68109
`OPENBLAS_TARGET`.
69110

70-
## Proxy issues
71-
72-
The `openblas-src` crate will detect and use proxy settings from your environment variables, such as `http_proxy` and `https_proxy` to download necessary dependencies.
111+
If you do not set these variables, the `openblas-build` will try to detect them.
112+
113+
For `OPENBLAS_TARGET`, the basic target that corresponds to the arch of `--target`
114+
will be used.
115+
116+
| Rust target | OpenBLAS target |
117+
| ----------- | --------------- |
118+
| aarch64 | ARMV8 |
119+
| arm | ARMV6 |
120+
| armv5te | ARMV5 |
121+
| armv6 | ARMV6 |
122+
| armv7 | ARMV7 |
123+
| loongarch64 | LOONGSONGENERIC |
124+
| mips64 | MIPS64_GENERIC |
125+
| mips64el | MIPS64_GENERIC |
126+
| riscv64 | RISCV64_GENERIC |
127+
| csky | CK860FV |
128+
| sparc | SPARCV7 |
129+
130+
For `OPENBLAS_CC` and `OPENBLAS_HOSTCC`, the `cc` crate will be used to detect
131+
the compiler. Please refer to the [cc documentation](https://docs.rs/cc/latest/cc/)
132+
for more information.
133+
134+
For `OPENBLAS_FC`, `openblas-build` will try to detect the compiler through the
135+
`OPENBLAS_CC` set above. It will replace the `gcc` with `gfortran`, `clang` with
136+
`flang`, and `icc` with `ifort` and then test if the Fortran compiler exists.
137+
138+
Note: If there is no Fortran compiler detected, the build flag `NOFORTRAN` will
139+
be set to `1` and `OpenBLAS` will only compile BLAS and f2c-converted LAPACK.
140+
For more information, please refer to the
141+
[Use f2c translations of LAPACK when no Fortran compiler is available][f2c-translations].
73142

74143
## Contribution
75144

@@ -80,9 +149,12 @@ will be licensed according to the terms given in [LICENSE.md](LICENSE.md).
80149
[architecture]: https://blas-lapack-rs.github.io/architecture
81150
[blas]: https://en.wikipedia.org/wiki/BLAS
82151
[lapack]: https://en.wikipedia.org/wiki/LAPACK
83-
[openblas]: http://www.openblas.net/
84-
[openblas-cross-compile]: https://github.com/xianyi/OpenBLAS#cross-compile
152+
[OpenBLAS]: http://www.openmathlib.org/OpenBLAS/
153+
[openblas-cross-compile]: http://www.openmathlib.org/OpenBLAS/docs/user_manual/#cross-compile
154+
[OpenbLAS build system]: http://www.openmathlib.org/OpenBLAS/docs/build_system/
85155
[vcpkg]: https://github.com/Microsoft/vcpkg
156+
[f2c-translations]: https://github.com/OpenMathLib/OpenBLAS/pull/3539
157+
[crt-static]: https://doc.rust-lang.org/reference/linkage.html#static-and-dynamic-c-runtimes
86158

87159
[build-img]: https://github.com/blas-lapack-rs/openblas-src/workflows/Rust/badge.svg
88160
[build-url]: https://github.com/blas-lapack-rs/openblas-src/actions?query=workflow%3ARust

0 commit comments

Comments
 (0)