-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help needed] How to properly link gfortran to build openblas? #3662
Comments
I have no idea what commands you are running to build OpenBLAS in that rust/cargo/? environment, but you'll need |
The linked issue above is created for the maintainer of the package. In case you've got a few minutes/you are interested, here's the build command. Great thanks in advance!
|
Hm, thats the build output that you showed earlier, not the command you used ? But if you can change the "cc" used for linking here to |
Architecture mixup most likely. Do a fresh openblas checkout, or run |
@brada4 that's on a Mac, I believe this warning is quite common there (and harmless). |
Error after says something is worng with object format. Might be radically aged gfortran, or even gfortran for different arch. |
@brada4 no it does not, the symbol is specified a few lines above as gfortran_concat_string which Ykid has already identified correctly as needing to link to gfortran. As it is clang that is used here for linking, libgfortran is not included automatically. |
@martin-frbg I'm sorry. This should be the command rustc --crate-name example --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=039627de79682f6d -C extra-filename=-039627de79682f6d --out-dir /Users/user1/Desktop/code/example/target/debug/deps -C incremental=/Users/user1/Desktop/code/example/target/debug/incremental -L dependency=/Users/user1/Desktop/code/example/target/debug/deps --extern ndarray=/Users/user1/Desktop/code/example/target/debug/deps/libndarray-bee006d102fba9e8.rlib --extern ndarray_linalg=/Users/user1/Desktop/code/example/target/debug/deps/libndarray_linalg-387192749548cace.rlib --extern ndarray_stats=/Users/user1/Desktop/code/example/target/debug/deps/libndarray_stats-e53f61ffeab434f4.rlib -L /Users/user1/Desktop/code/example/target/debug/build/openblas-src-24e5b6ea9b6680a3/out/opt/OpenBLAS/lib |
You can build OpenBLAS independently from ndarray and import resulting dylib. It says it uses only BLAS functions, so NO_FORTRAN=1 build serves it sufficiently. |
blas-src "crate" is actually documented here: https://docs.rs/blas-src/latest/blas_src/ ,sorry for reinventing the wheel. @martin-frbg could it link with $FC on osx with gfortran? |
Why wouldn't OpenBLAS compile and link with gfortran on OSX, especially as this appears to be x86_64, not one of the new ARM macs ? I assume the crate provides for that if it has . (or at worst, installing gfortran from e.g. homebrew would be needed) |
And if it is a prebuilt libopenblas, getting the user code to link against libgfortran as well is probably easier than building OpenBLAS or any other replacement BLAS from source |
I was a bit confused CC is being used there, I will try to dig to the source of grief. |
Hi guys, I am running into an issue when building a rust library which uses openblas underneath. I don't know how to get compilation work, so any help/advice will be appreciated!
Related issue is here
The text was updated successfully, but these errors were encountered: