blas-lapack-rs / openblas-src

Source of BLAS and LAPACK via OpenBLAS
Other
78 stars 48 forks source link

respect OPENBLAS_{{CC, FC, HOSTCC}} env vars on linux #102

Closed mike-kfed closed 10 months ago

mike-kfed commented 1 year ago

this should fix issue #101

together with PR rust-ndarray/ndarray-linalg#354 I can run this successfully on a x86_64 machine to cross compile for a Raspi 4

export OPENBLAS_CC=aarch64-linux-gnu-gcc
export OPENBLAS_FC=aarch64-linux-gnu-gfortran
export OPENBLAS_HOSTCC=gcc
export OPENBLAS_TARGET=ARMV8 # CORTEXA72
cargo build --release --target=aarch64-unknown-linux-gnu
Dirreke commented 1 year ago

As https://github.com/xianyi/OpenBLAS/issues/4011, sometimes, we also need to add RANLIB=ranlib to cross compile on some systems.

Could you help add OPENBLAS_RANLIB to the list?

mike-kfed commented 1 year ago

I added OPENBLAS_RANLIB now, but you @Dirreke will have to test it, as ranlib is not my usecase. please let me know if that works for you ^^

Dirreke commented 1 year ago

It works! Thanks!

Dirreke commented 1 year ago

I think it will be great if we add some default parameter to this. Would you like to do this? Or would you like to give me auth to edit this PR?

mike-kfed commented 1 year ago

I don't think that there is a meaningful default for cross compiling, the build script cannot read the devs mind which target to pick. And for compiling onto the host platform this crate works fine.

Dirreke commented 1 year ago

Maybe we can get the parameters by cc. On the other hand, you are right. It's enough for crossing compile

Dirreke commented 10 months ago

@mike-kfed Do you have time to rebase this PR? @termoshtt Would you like to mearge this PR? It can really solve the cross-compile issue on many platforms. Thanks