You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
61
80
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
63
104
64
105
Apart from providing the `--target` option to `cargo build`, one also has to
65
106
specify the [cross-compilation variables of OpenBLAS][openblas-cross-compile].
66
107
They can be set as environment variables for `cargo build` using the `OPENBLAS_`
67
108
prefix as follows: `OPENBLAS_CC`, `OPENBLAS_FC`, `OPENBLAS_HOSTCC`, and
68
109
`OPENBLAS_TARGET`.
69
110
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].
73
142
74
143
## Contribution
75
144
@@ -80,9 +149,12 @@ will be licensed according to the terms given in [LICENSE.md](LICENSE.md).
0 commit comments