Giter Club home page Giter Club logo

openblas-src's People

Contributors

alexbool avatar bluss avatar braincore avatar danburkert avatar dirreke avatar emberian avatar ethanhs avatar gkobeaga avatar ivanukhov avatar jturner314 avatar lazareviczoran avatar maoe avatar maparent avatar mike-kfed avatar nemosupremo avatar ntucker avatar scharris avatar superfluffy avatar termoshtt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

openblas-src's Issues

vcpkg uses ilp64 on Windows

When debugging rust-ndarray/ndarray#1110, I found out that openblas provided by vcpkg is compiled with ilp64.

I think the solution to this is to either add ilp64 support to cblas-sys, or better, build openblas from source using cmake, flang, and msvc.

GEMM returning zeroes on macos with static linking

Hey, I noticed then the GEMM functions were not working on macOS with static linking. I have extended travis configuration to build more combinaisons, and added a GEMM testcase here.

https://github.com/snipsco/openblas-src/tree/1db4cfce5e671fedba9b19f8e156bd9dbb7cdaf9

Travis picks the error here:

https://travis-ci.org/snipsco/openblas-src/builds/355009003

But I am not too sure how to debug that... No problem with static on linux, no problem with dyn on mac...

Cross compilation problems

When compiling from my Linux (debian stretch 64 bits) to my raspberry pi (version 1A, with raspbian jessy), I can compile my project depending on several external libraries with:

cargo build --target=arm-unknown-linux-gnueabihf

(and the ARM versions of all the libraries in a path that "ld for ARM" can find)

However, the only rust crate that doesn't compile is OpenBLAS, which insists in using my system's libraries (x86_64) instead of the ARM versions:

note: /path/to/my_project/target/arm-unknown-linux-gnueabihf/debug/build/openblas-provider-601a7b1eda73c46c/out/opt/OpenBLAS/lib/libopenblas.so: file not recognized: File format not recognized

Make openblas-build work on macOS

Split from #44 (comment) and merges #49 issue because it is resolved by introducing of openblas-build crate on Linux.

macOS support of openblas-build crate looks have several problems.

Link error in test

Surely I described that

[dependencies]
blas = "0.20"
lapack = "0.16"
openblas-src = "0.9"
extern crate blas;
extern crate lapack;
extern crate openblas_src;

Then I could

cargo build

successfully.

However,

cargo test

always fail.

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.13loqdvuea4h2eo4.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.199zxjab49i955l4.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1c0p2lgclcb9ycj1.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1edad6bkh8oecdqi.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1hvae5dtbhnmg7y1.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1il5vs7acai2t2ok.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1j0nnnna49i577u2.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1krfmhvewnc1supb.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1ltvv6brgjeqm44z.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1oj1tiijf17wgc1h.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1qcvehjokotdtfwx.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1rup4xypb939dt8t.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.1vm6x1ywnewstu92.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.208zcgj6e7ergpq6.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2225bzmkg8twyptb.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.23tcqik0fugdd8em.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.24p9r2ccxusun5zm.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.24x0f0fx3krg91ue.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.26rr86w1jfbsooxc.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.27s2jiv5pnugxqe1.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.27xyfq7kxie136vf.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2c3ogwn750nrrpt4.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2d86chjkszencf1l.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2dx5uxnjrolk7oe8.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2gihaek4qjewrf3s.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2guedjmexea5du36.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2h7sya0stx8xt735.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2huzhjyjo1qi1l1r.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2pr2bz4zy1hgytrm.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2rfjwsnlo894doyz.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2sp051oud2hpgjx6.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2tsr44wfjjebitps.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2un89qwddttukxv0.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2ve7gsrif8iyz0gd.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2vpxutjgc1cti0ew.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2vv337q3ldbv0mpk.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2wnyikr70x6umik8.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2xgmgcpzdy9qucaw.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2xozh10euntk3nhi.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2y4gmsfkntwztl9w.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.355eoah3oavoahe8.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.38g4hcx0b0u2pl79.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3atv4qr9j0twlklj.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3fvo1jg7vt998djh.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3mw0kuv8we1cry9i.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3ocrca5x8i93nojy.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3oym7lvn619v6t0l.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3qgyq2dpmwonuzc2.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3qoix6m2g6njxq07.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3qt12fnc61woytkd.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3ry5i1gljd6g1a36.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3s3i1ip4hoxgwrah.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.3versiw9sa9slchy.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.40n8liuhwsr2cqpk.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.41xa12oun9kn3rr5.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.41zv3tmvgbls87ye.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.43iwn1hwydc0bk5w.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.44nm50tnjmzonj2x.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.464bvzmae93o1r5r.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.477q55gnc8h6n6l9.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4a4g8anx02pv1xq2.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4bi5xul3xz8qig4y.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4c54124568onn25.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4cr3wgd7mkuiu2ou.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4d9rrv0a7o71adjc.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4duvqg0ev8dvj24c.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4dxiw231b0h0h0ut.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4gj0s4mrxuejspil.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4mop821xaruzyu25.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4pfpehjxrksh36wh.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4qyz89r0bkg29vo4.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4rk1py7waii0gh8h.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4ro7wfaha0hof18r.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4rw3rilo1m1px8oh.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4z0qp346y0ir2kiw.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4z9iamqm9d23osko.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.4zvcr2av80ep7rlz.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.535eozqrziqqqrdt.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.53hp0xmmm0ibu24f.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.53icxrcyslfbve4h.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.55fxyluspisjv8h3.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.56bjzwqp13ihob2m.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.56e14v7pdu4ivp8w.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.5a2t9u067fzzlkf8.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.5f8w5ah1f9wn9f2k.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.5fesyip9t5n7mg8o.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.6cgvc72eubu9nlw.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.764331n1aldpyb2.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.9h9n8urcjnzkybv.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.acy2pl8frhxnevl.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.akiokbpjxg9ivg4.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.beiskkte05n9vt3.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.cet3dmf2ri61exm.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.dyuezkk6saandvj.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.eo46ysrfmofl4kz.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.hx643e8evljgdbh.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.ku1sapvmqjvmrtg.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.l9adobuaoq6wrzd.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.lxiuy00gpinwu6l.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.qjp6d5trt0yfubv.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.qxvgnyd6hjpudqo.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.rb3o8cim8pdypsg.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.sr1dxnxps1slukj.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.x9pqcn5m2ti7c3c.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.xk5fafi3eydz7tk.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.y3let9ot7i8dgv5.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.yzdjjg81uioyynj.rcgu.o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.zlxpld6cb599dae.rcgu.o" "-o" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.30hm0ad6dpmr7bhb.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps" "-L" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/build/openblas-src-9e9cc4a2803cd6ea/out/opt/OpenBLAS/lib" "-L" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-219fc620be977b79.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm-f5064c1d87ea3eaf.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-6bc0764cb7f4dd96.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-72042f7f9ab0950a.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-7a49e61f83b63f93.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/librayon-81697127c5339eb4.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/librayon_core-4898c8c6e3a5a3fb.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libnum_cpus-e56f6a37558f5148.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libcrossbeam_deque-48eef9cc011f78b4.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libcrossbeam_epoch-2c499fe78bf37f3e.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libscopeguard-5ad4270d09bfce92.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libmemoffset-aebce936eb4eb10d.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libcrossbeam_queue-bd8df718a3333cee.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libcrossbeam_utils-8ed8d280867c6832.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/liblazy_static-807f2c476a0e6b86.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libmaybe_uninit-a414d050938f7fed.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libcfg_if-c207894dabf2ad2d.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libeither-61fbb0a110e3d219.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libopenblas_src-3b0ebb2d52958785.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libnum_complex-da53e50e22c32f68.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/liblapack-d88bec8182be41fa.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/liblapack_sys-6a4a00f97a1e6474.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libblas-ab56248cd7e75aac.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libnum_complex-a1f6c4c375fe0f21.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libnum_traits-aa0aa50b29623e44.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/libblas_sys-4be45a5c252ab4e2.rlib" "/home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/liblibc-e4dfce483ea4fe1d.rlib" "-Wl,--start-group" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-205127404fcba336.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a657948fb7763780.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-4af901391177f653.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-9bdd51edf637d1e0.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-df9a9630b2ea2e1e.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-fddbfe63d5cc9339.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-dc1fcc6e43806791.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e2f4bff19e00107e.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a152d13c1d7ed405.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-d92b841792fc008d.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-a64c249515c023f5.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-57654524b3e40c00.rlib" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-72180f1527a726a2.rlib" "-Wl,--end-group" "/home/yu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-990cc8f4a91a3ab4.rlib" "-Wl,-Bdynamic" "-lgfortran" "-lopenblas" "-lutil" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil"
  = note: /usr/bin/ld: /home/yu/src/github.com/OpenSRDK/linear-algebra-rs/target/debug/deps/opensrdk_linear_algebra-4eb37d63d04e2311.2tsr44wfjjebitps.rcgu.o: in function `lapack::dgesv':
          /home/yu/.cargo/registry/src/github.com-1ecc6299db9ec823/lapack-0.16.0/src/lib.rs:8152: undefined reference to `dgesv_'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error; 1 warning emitted

I would appreciate if you help me.

Syntax error near unexpected token

Hi, I am trying to build a package that depend on openblas-src on an Archlinux i7-1165G7.
It builds it with: features = ["cblas", "static"]
When building I get:

/bin/sh: -c: line 1: syntax error near unexpected token (' /bin/sh: -c: line 1: ar -ru ../libopenblas_(null)p-r0.3.14.a

I check the Makefile.conf generated and it has LIBCORE=(null)
What can I do?

Crate features need to be positive

Cargo unions crate features automatically, so exclude-cblas would need to be turned into a default include-cblas to work with that scheme.

Cannot build ndarray-linalg on M1 Macbook

Hi, thanks to you for your wonderful repository.
I tried to run the repository with arm64 on my m1 chip macbook. However, I could not compile the code with the following error.

error: failed to run custom build command for `openblas-src v0.9.0`

Caused by:
  process didn't exit successfully: `/Users/~~/Code/rust_machine_learn/target/debug/build/openblas-src-27bd595c66c91fee/build-script-build` (exit code: 101)
  --- stdout
  Running: `"make" "libs" "netlib" "shared" "BINARY=64" "YES_CBLAS=1" "YES_LAPACKE=1" "-j8"`

  --- stderr
  Makefile:139: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
  thread 'main' panicked at 'Failed: `"make" "libs" "netlib" "shared" "BINARY=64" "YES_CBLAS=1" "YES_LAPACKE=1" "-j8"` (exit code: 2)', /Users/~~/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.9.0/build.rs:72:17
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

My Cargo.toml is shown below.

[dependencies]
ndarray = "0.13.0"
ndarray-rand = "0.12.0"
ndarray-linalg = { version = "0.12.1", features = ["openblas"] }
num-traits = "0.2.14"
approx = "0.3.0"

Is there something wrong with my installation method that is causing this problem? Or is it a problem specific to the M1 chip?

Can't build on Ubuntu 18.04

I added openblas-src as a dependency to my Cargo.toml as recommended by this issue: rust-ndarray/ndarray-linalg#171

The output I got is:

$ cargo build
   Compiling openblas-src v0.7.0
error: failed to run custom build command for `openblas-src v0.7.0`

Caused by:
  process didn't exit successfully: `/home/rspeer/code/skipgram-engine/target/debug/build/openblas-src-1acb45e3d7ad0634/build-script-build` (exit code: 101)
--- stdout
Running: `"make" "libs" "netlib" "shared" "BINARY=64" "YES_CBLAS=1" "YES_LAPACKE=1" "-j12"`

--- stderr
Makefile.system:47: Makefile.rule: No such file or directory
make: Makefile.prebuild: No such file or directory
make: *** No rule to make target 'Makefile.prebuild'.  Stop.
Makefile.system:195: Makefile.conf: No such file or directory
Makefile.system:1063: Makefile.: No such file or directory
make: *** No rule to make target 'Makefile.'.  Stop.
thread 'main' panicked at 'Failed: `"make" "libs" "netlib" "shared" "BINARY=64" "YES_CBLAS=1" "YES_LAPACKE=1" "-j12"` (exit code: 2)', /home/rspeer/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/build.rs:68:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Enable Travis CI

@cmr, please activate both openblas-provider and netlib-provider in your Travis CI account. I want to be able to test these two crates independently of the higher-level ones. Thank you!

The static feature doesn't static link to the in-tree openblas on Debian Bullseye when libopenblas-dev is installed

The static feature is (I think) supposed to build the openblas source in the submodule and link it statically but it appears that on Debian Bullseye it links to the system library (libopenblas-dev) instead. On Ubuntu Bionic it seems to work fine.

Steps to reproduce:

  1. checkout my repro branch:
git clone https://github.com/maoe/openblas-src.git
cd openblas-src
git checkout print-config
  1. build docker images
docker build -f Dockerfile.debian-bullseye -t openblas-src-bullseye .
docker build -f Dockerfile.ubuntu-bionic -t openblas-src-bionic .
  1. run the containers
% docker run -it --rm openblas-src-bullseye
OpenBLAS 0.3.13 NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=64
% docker run -it --rm openblas-src-bionic   
NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell

FWIW OpenBLAS 0.3.13 is installed via apt-get install in both containers.

Cannot compile

When trying to compile blas/lapack crates, dependency openblas-provider is not compiling. I'm on Ubuntu 14.04. I've installed most dependencies that I can think of: liblapack-dev, libblas-dev, libopenblas-dev, gfortran. I've installed openblas from source. Compilation of openblas-provider keeps failing with the following stderr:

make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(c_abs.o):2: Unexpected character `\016' in S-record file

BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(c_abs.o):2: Unexpected character `\016' in S-record file

make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: warning: -jN forced in submake: disabling jobserver mode.
BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(c_abs.o):2: Unexpected character `\016' in S-record file

BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../libopenblas_haswellp-r0.2.14.a(c_abs.o):2: Unexpected character `\016' in S-record file

BFD: ../../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../../libopenblas_haswellp-r0.2.14.a(c_abs.o):2: Unexpected character `\016' in S-record file

BFD: ../../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../../libopenblas_haswellp-r0.2.14.a(ctbsv_CUN.o): Recognised but unhandled machine type (0x0) in Import Library Format archive
BFD: ../../../libopenblas_haswellp-r0.2.14.a(c_abs.o):2: Unexpected character `\016' in S-record file

make[1]: warning: -jN forced in submake: disabling jobserver mode.
../libopenblas_haswellp-r0.2.14.a: member ../libopenblas_haswellp-r0.2.14.a(saxpy.o) in archive is not an object
collect2: error: ld returned 1 exit status
make[1]: *** [../libopenblas_haswellp-r0.2.14.so] Error 1
make: *** [shared] Error 2
thread '<main>' panicked at '`"make" "libs" "netlib" "shared" "YES_CBLAS=1" "-j4"` failed: exit code: 2', ~/.cargo/registry/src/github.com-0a35038f75765ae4/openblas-provider-0.1.6/build.rs:57

Undefined symbols for architecture x86_64, _cblas_sgemv etc (0.6.1 on macOS)

I'm trying to get started with OpenBLAS to accelerate my usage of array operations (via finalfusion -> ndarray). Because the latest version of finalfusion currently depends on ndarray 0.13, I'm stuck with openblas-src 0.6.1. When building on macOS, I get:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-arch" "x86_64" "-L" "/Users/djc/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/djc/src/bolt/rust/target/release/deps/build_index.build_index.cf635v6f-cgu.15.rcgu.o" "-o" "/Users/djc/src/bolt/rust/target/release/deps/build_index" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/djc/src/bolt/rust/target/release/deps" "-L" "/Users/djc/src/bolt/rust/target/release/build/openblas-src-57d3bf449cdc1065/out/opt/OpenBLAS/lib" "-L" "/Users/djc/src/bolt/rust/target/release/build/ring-015462dd844548f8/out" "-L" "/Users/djc/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/var/folders/wl/fgp_zytx50v_4hm8k0y14hc00000gn/T/rustc6ka0Jl/libring-30f30c99e7601756.rlib" "/Users/djc/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-57851e98e05f8123.rlib" "-framework" "Security" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: Undefined symbols for architecture x86_64:
            "_cblas_sgemv", referenced from:
                _$LT$reductive..pq..pq..PQ$LT$A$GT$$u20$as$u20$reductive..pq..traits..ReconstructVector$LT$A$GT$$GT$::reconstruct_vector::h963f4e0087d77df0 in build_index.build_index.cf635v6f-cgu.15.rcgu.o
            "_cblas_sgemm", referenced from:
                _$LT$reductive..pq..pq..PQ$LT$A$GT$$u20$as$u20$reductive..pq..traits..ReconstructVector$LT$A$GT$$GT$::reconstruct_batch::hd383f227951ccfe9 in build_index.build_index.cf635v6f-cgu.15.rcgu.o
            "_cblas_sdot", referenced from:
                ndarray::linalg::impl_linalg::_$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$::dot::h9a777dcdffcb9e0c in build_index.build_index.cf635v6f-cgu.15.rcgu.o
                ndarray::linalg::impl_linalg::_$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$::dot::ha0a3d4f9fca62f0b in build_index.build_index.cf635v6f-cgu.15.rcgu.o
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

These are the only changes I made:

diff --git a/rust/vectors/Cargo.toml b/rust/vectors/Cargo.toml
index da407bf0..ba00d0f9 100644
--- a/rust/vectors/Cargo.toml
+++ b/rust/vectors/Cargo.toml
@@ -10,6 +10,7 @@
+blas-src = { version = "0.6", features = ["openblas"] }
@@ -17,7 +18,7 @@
-ndarray = { version = "0.13.1", features = ["serde"] }
+ndarray = { version = "0.13.1", features = ["blas", "serde"] }

Is there anything else I need to do?

Link against libgfortran statically when static feature is enabled

I use openblas for a Python package, so I statically link most of the C dependencies I have. However, when I activate the static feature it failed the manylinux check because it is dynamically linking to libgfortran.so.5

This seems to happen when the lapacke feature is activated, but not otherwise.

Move to a dedicated organization

@cmr, what do you think about collecting and maintaining all BLAS- and LAPACK-related crates under a separate organization dedicated to this particular purpose?

I’ve already created an organization called BLAS and LAPACK for Rust and moved all relevant crates from Stainless Steel to that organization. @astraw has also moved accelerate-src there.

Thanks!

unwrap call in `windows_msvc_system` results in unclear error message.

When attempting to compile a crate that depends on openblas-src with static and system features enabled and when using a Windows host, a confusing error message is raised when necessary vcpkg packages are not yet installed:

➜ cargo build
   Compiling openblas-src v0.10.4
error: failed to run custom build command for `openblas-src v0.10.4`

Caused by:
  process didn't exit successfully: `<path-to-project>\target\debug\build\openblas-src-ee3a2010492c76c2\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: VcpkgInstallation("could not read status file updates dir: The system cannot find the path specified. (os error 3)")', C:\Users\<username>\.cargo\registry\src\github.com-1ecc6299db9ec823\openblas-src-0.10.4\build.rs:40:37
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The root cause seems to be an unwrap call at build.rs:40:

/// Use vcpkg for msvc "system" feature
fn windows_msvc_system() {
    if feature_enabled("static") {
        env::set_var("CARGO_CFG_TARGET_FEATURE", "crt-static");
    } else {
        env::set_var("VCPKGRS_DYNAMIC", "1");
    }
    #[cfg(target_env = "msvc")]
    vcpkg::find_package("openblas").unwrap();  // ← this unwrap fails when openblas pkg is missing
    if !cfg!(target_env = "msvc") {
        unreachable!();
    }
}

Documentation is unclear for Cross Compile on Windows

Hello,
I am trying to get openblas to work on windows 10. The vcpkg section is fairly well written, but at the end there is a cross compiler section which is very unclear.

Is this necessary for using openblas on windows (I assume so, because its not working after the vcpkg steps).
If so, could you provide an example on how to use this with cargo/rustc?

Thank you!

Specifying OpenBLAS directory

I have an OpenBLAS installation in a folder that the installation is not finding. I have solved this locally by adding the following lines in build.rs to use_system:

if let Ok(v) = var("CARGO_FEATURE_OPENBLAS_DIR") {
    println!("cargo:rustc-libdir={}", v);
    println!("cargo:rustc-link-search=native={}", v);
}

I was wondering if there is another solution that doesn't require a custom modification, or would something like this make an appropriate PR?

Setting OPENBLAS_NUM_THREADS at runtime: openblas_set_num_threads

In some parts of my program I want to rely on openblas' built-in parallelization support, while in other parts of my program I want to invoke an openblas routine in parallel using rayon, but there I have to set openblas itself to only use one thread for thread safety reasons.

Openblas provides the function openblas_set_num_threads to set the number of threads at runtime.

Is it possible to expose this function in this library?

It seems like an ancient precursor of this crate actually exposed this and related functions:

https://docs.rs/openblas-blas-provider/0.0.5/openblas_blas_provider/index.html

Looks like those functions got removed in commit 8e549d0.

Can't build on Windows 10

When trying to build the crate with cargo, I get the following error messsage :

error: failed to run custom build command for `openblas-src v0.7.0`
process didn't exit successfully: `C:\Users\(...)\target\debug\build\openblas-src-ea19b54cda88a9a7\build-script-build` (exit code: 101)
--- stdout
Running: `"cp" "-R" "source" "source_x86_64-pc-windows-msvc_tmp"`

--- stderr
thread 'main' panicked at 'Failed: `"cp" "-R" "source" "source_x86_64-pc-windows-msvc_tmp"` (The file can't be found. (os error 2))', C:\Users\(...)\.cargo\registry\src\github.com-1ecc6299db9ec823\openblas-src-0.7.0\build.rs:72:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

I am using the latest stable version of rust (1.34.0) on Windows 10.

Change *-provider to *-src

@cmr, what do you say if we change the naming scheme from *-provider to *-src? It doesn’t change the essence, of course, but it’s much shorter, goes along with the *-sys convention, and conveys well what the crates do. One can also think of src as source in general, not necessarily source code. I personally like clean, concise, consistent, and logical naming conventions, and you probably too.

If you support this, please rename both repos, and I’ll do the rest.

OpenBLAS v0.2.19 cannot detect correct CPU

When trying to build openblas-src, cargo throws the error below:

Makefile:123: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.
thread 'main' panicked at 'Failed: `"make" "libs" "netlib" "shared" "BINARY=64" "YES_CBLAS=1" "YES_LAPACKE=1" "-j8"` (exit code: 2)', /home/janis/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.5.3/build.rs:39
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This is fixed in OpenBlas release v0.2.20.

Investigate the situation with thread safety

I recently came across this issue in the OpenBLAS repository. It seems that the way we currently compile OpenBLAS results in something that is not entirely thread safe. There is also this suspicious comment in one of the Makefiles. This should be investigating. If anybody has any information on this, please share.

Disable OpenBLAS threading by default

Rust code assumes that threads can be used without restriction. So, by default, we should disable OpenBLAS threading and enable locking with USE_THREAD=0 USE_LOCKING=1, since the docs indicate that threading by the application conflicts with threading by OpenBLAS. We can allow the user to enable OpenBLAS threading if desired with an environment variable. (An environment variable is more appropriate than a feature flag, because only the user building the final binary has enough information to know whether enabling OpenBLAS threading is safe for their application.)

cblas_dgemm returns incorrect results when the static feature of openblas-src is enabled on macOS

https://github.com/maoe/ndarray-dot-repro is a reproducer. It was minimized from code which used argmin + ndarrayl feature.

This reproducer uses the patched version of openblas-src from #65 so that static build works both on Linux and macOS Big Sur.

The expected output of the main is [1.0, 1.0, 1.0, 1.0] but it returns the zero matrix on macOS when the static feature of openblas-src is enabled.

% cargo run
   Compiling ndarray-dot-repro v0.1.0 (/Users/maoe/src/github.com/maoe/ndarray-dot-repro)
    Finished dev [unoptimized + debuginfo] target(s) in 0.49s
     Running `target/debug/ndarray-dot-repro`
[
    1.0,
    1.0,
    1.0,
    1.0,
]
% cargo run --features openblas-src/static
   Compiling ndarray-dot-repro v0.1.0 (/Users/maoe/src/github.com/maoe/ndarray-dot-repro)
    Finished dev [unoptimized + debuginfo] target(s) in 0.52s
     Running `target/debug/ndarray-dot-repro`
[
    0.0,
    0.0,
    0.0,
    0.0,
]

FWIW, I haven't been able to reproduce the issue in C on macOS:

% git clone https://github.com/xianyi/OpenBLAS.git
% cd OpenBLAS
% git checkout v0.3.14 # This is the commit #65 uses
% make
% wget -q https://gist.githubusercontent.com/maoe/953c4e863703be915928b0f8997fcc46/raw/e827d61ae2944a72a37d0784c0aab0026e1b6cdb/repro.c # See https://gist.github.com/maoe/953c4e863703be915928b0f8997fcc46
% cc -o repro repro.c libopenblas.a
% ./repro
1.000000
1.000000
1.000000
1.000000

Compiling several packages simultaneously

When simultaneously compiling two packages that depend on openblas-provider, one of them usually fails as the first of the two make invocations in build.rs fails. On a Mac, I get the following:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: ../../libopenblas_nehalemp-r0.2.13.a(shgeqz.o) size too large (archive member extends past the end of the file)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: internal ranlib command failed
make[1]: *** [libs] Error 1
make: *** [libs] Error 1

However, if I wait for the first package to finish, the second one compiles just fine.

Cargo build fails when netlib-src is statically linked

When I build my project with cargo build, I get "duplicate symbols" error:

Running `rustc --crate-name rustjblas src/lib.rs --crate-type dylib --emit=dep-info,link -C debuginfo=2 -C metadata=3dbcfb506238a51d --out-dir /Users/sadikovi/Developer/rustjblas/rust/target/debug/deps -L dependency=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps --extern libc=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps/liblibc-a6f64bd4a4376502.rlib --extern rand=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps/librand-40c4aa0a849563f5.rlib --extern openblas_src=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps/libopenblas_src-f1bbbf37c13f62f6.rlib --extern netlib_src=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps/libnetlib_src-252b138f73605245.rlib --extern blas=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps/libblas-4a941e39e868bf58.rlib --extern lapack=/Users/sadikovi/Developer/rustjblas/rust/target/debug/deps/liblapack-4fadec68ff0837ec.rlib -C target-cpu=native -L native=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7 -L native=/usr/local/Cellar/gcc/7.2.0/lib/gcc/7/i386 -L native=/Users/sadikovi/Developer/rustjblas/rust/target/debug/build/rustjblas-097eb7606d7fd374/out -l static=format -l 'c++' -L /Users/sadikovi/Developer/rustjblas/rust/target/debug/build/netlib-src-312bf0985e1ef971/out/lib -L /Users/sadikovi/Developer/rustjblas/rust/target/debug/build/openblas-src-3b5583e3d1ec01ce/out/opt/OpenBLAS/lib`
error: linking with `cc` failed: exit code: 1
  ...
  = note: duplicate symbol _lsame_ in:
              /var/folders/jc/4qttj6rs79dgmns030x1tf0r0000gn/T/rustc.uwqWErHScOkK/libnetlib_src-252b138f73605245.rlib(lsame.f.o)
          duplicate symbol _xerbla_ in:
              /var/folders/jc/4qttj6rs79dgmns030x1tf0r0000gn/T/rustc.uwqWErHScOkK/libnetlib_src-252b138f73605245.rlib(xerbla.f.o)
          duplicate symbol _xerbla_array_ in:
              /var/folders/jc/4qttj6rs79dgmns030x1tf0r0000gn/T/rustc.uwqWErHScOkK/libnetlib_src-252b138f73605245.rlib(xerbla_array.f.o)
          ld: 3 duplicate symbols for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

I guess this is because rustc is trying to link both libblas-netlib.a and liblapack-netlib.a, and they happen to have both those object files defined.

Build on OS X, Cargo.toml dependencies:

[dependencies]
libc = "0.2"
rand = "0.3"
blas = "0.19"
lapack = "0.15"
netlib-src = { version = "0.7", default-features = false, features = ["static"] }

static flag does not works on 0.10.0 release

error: could not find native static library `openblas`, perhaps an -L flag is missing?

rust-ndarray/ndarray-linalg#253

openblas-src 0.10.0 does not work with static flag when using as dependencies. It works if using path, e.g.

[dependencies.openblas-src]
version = "0.10.0"
path = "/path/to/my/local/repo"
optional = true
default-features = false
features = ["cblas"]

dynamic link c lib openblas error

Problem

First, i install openblas and lapack by brew

brew install openblas
brew install lapack


when i use openblas-src with features ["cblas", "system"], i set RUSTFLAGS in project/.cargo/config.toml


case 1

  • set env in ~/.bash_profile
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openblas/lib"
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/opt/openblas/lib"
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/lapack/lib"
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/opt/lapack/lib"

run cargo test
i get error of libBLAS (with env of library openblas)

dyld: Library not loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
Referenced from: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
Reason: Incompatible library version: vecLib requires version 1.0.0 or later, but libBLAS.dylib provides version 0.0.0


or error of libvDSP (with env of library of lapack)

dyld: Symbol not found: _cblas_dgemm
Referenced from: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
Expected in: /usr/local/opt/lapack/lib/libBLAS.dylib
in /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib

case 2

  • comment out env of both openblas and lapack in ~/.bash_profile
# export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openblas/lib"
# export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/opt/openblas/lib"
# export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/lapack/lib"
# export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/opt/lapack/lib"

run cargo test
i got error compile error

= note: ld: warning: directory not found for option '-L /usr/local/opt/openblas/lib'
ld: warning: directory not found for option '-L /usr/local/opt/lapack/lib'
ld: library not found for -llapacke
clang: error: linker command failed with exit code 1 (use -v to see invocation)

warning: preprocessing_contrib (lib test) generated 6 warnings (6 duplicates)
error: could not compile preprocessing_contrib due to previous error; 6 warnings emitted

Caused by:
process didn't exit successfully: rustc --crate-name preprocessing_contrib --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --test -C metadata=afa4a0be7d6ff698 -C extra-filename=-afa4a0be7d6ff698 --out-dir /Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps -C incremental=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/incremental -L dependency=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps --extern blas_src=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/libblas_src-9d74ad231a46e048.rlib --extern linfa=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/liblinfa-cb3ffd43d6b8eaa2.rlib --extern linfa_preprocessing=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/liblinfa_preprocessing-0a776c26ed2cfa7f.rlib --extern ndarray=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/libndarray-556145df8dd460d1.rlib --extern openblas_src=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/libopenblas_src-fc8092715b5adcea.rlib '-L /usr/local/opt/openblas/lib' '-L /usr/local/opt/lapack/lib' -L /usr/local/opt/openblas/lib (exit status: 1)


case 3

  • clear RUSTFLAGS in project/.cargo/config.toml
    run cargo test
    i got compile error

= note: ld: library not found for -llapacke
clang: error: linker command failed with exit code 1 (use -v to see invocation)

warning: preprocessing_contrib (lib test) generated 6 warnings (6 duplicates)
error: could not compile preprocessing_contrib due to previous error; 6 warnings emitted

Caused by:
process didn't exit successfully: `rustc --crate-name preprocessing_contrib --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --test -C metadata=afa4a0be7d6ff698 -C extra-filename=-afa4a0be7d6ff698 --out-dir /Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps -C incremental=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/incremental -L dependency=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps --extern blas_src=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/libblas_src-9d74ad231a46e048.rlib --extern linfa=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/liblinfa-cb3ffd43d6b8eaa2.rlib --extern linfa_preprocessing=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/liblinfa_preprocessing-0a776c26ed2cfa7f.rlib --extern ndarray=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/libndarray-556145df8dd460d1.rlib --extern openblas_src=/Users/frankguo/workspace/rust/preprocessing_contrib/target/debug/deps/libopenblas_src-fc8092715b5adcea.rlib


more information

  • toolchains

stable-x86_64-apple-darwin (default)
rustc 1.55.0 (c8dfcfe04 2021-09-06)
cargo 1.55.0 (32da73ab1 2021-08-23)

  • config.toml
[target.x86_64-apple-darwin]
rustflags = ["-L /usr/local/opt/openblas/lib", "-L /usr/local/opt/lapack/lib"]  # custom flags for `rustc`

project file Cargo.toml

[package]
name = "preprocessing_contrib"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ndarray = { version = "0.14",default-features = false, features = ["blas"] }
ndarray-linalg = { version = "0.13", optional = true }
blas-src = { version = "0.8", features = ["openblas"] }
openblas-src = { version = "0.10", features = ["cblas", "system"] }
linfa = {version = "0.4.0", features = ["openblas-system"]}
linfa-preprocessing = {version = "0.4.0"}
  • source code lib.rs
mod encoders{
    use linfa::dataset::{AsTargets, DatasetBase, Float, WithLapack, WithoutLapack};
    use linfa::traits::Transformer;
    use linfa_preprocessing::norm_scaling::NormScaler;
    use ndarray::{Array2, ArrayBase, Data, Ix2};

    pub struct Binarizer<T>{
        threshold: T,
    }

    impl<T: Float> Binarizer<T> {
        fn new(threshold: T) -> Self{
            Self{
                threshold
            }
        }
    }

    impl <T: Float> Default for Binarizer<T> {
        fn default() -> Self {
            Self{
                threshold: T::from_f64(0.0).unwrap()
            }
        }
    }

    impl<F: Float> Transformer<Array2<F>, Array2<F>> for Binarizer<F> {
        fn transform(&self, x: Array2<F>) -> Array2<F> {
            todo!()
        }
    }

    impl<F: Float, D: Data<Elem = F>, T: AsTargets>
        Transformer<DatasetBase<ArrayBase<D, Ix2>, T>, DatasetBase<Array2<F>, T>> for Binarizer<F>{
        fn transform(&self, x: DatasetBase<ArrayBase<D, Ix2>, T>) -> DatasetBase<Array2<F>, T> {
            todo!()
        }
    }
}

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }
}

How can I solve this problem ?
How to use crate openblas-src link system's openblas dynamic library in rust ?

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

  • toolchains

stable-x86_64-apple-darwin (default)
rustc 1.55.0 (c8dfcfe04 2021-09-06)
cargo 1.55.0 (32da73ab1 2021-08-23)

static link c lib openblas error on windows 10

os: windows 10 professional 19042.1288
vcpkg version: 2021-11-02-af04ebf6274fd6f7a941bff4662b3955c64f6f42 (newest from github)
openblas-src version: 0.10 (vcpkg: openblas_x64-windows-static-md)
dependencies of project:
ndarray = { version = "0.15.0", features = ["blas"] } blas-src = { version = "0.8", features = ["openblas"] } openblas-src = { version = "0.10", features = ["system","static"] }

=============================================================
Hello... I think I met a link problem when I tried to link the openblas to my rust project on windows.
I am wondering whether I use the improper version of MSVC tools.

The error message is:

**error: linking with link.exe failed: exit code: 1120
|
= note: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\bin\HostX64\x64\link.exe" "/NOLOGO" "E:\code\rust\classgameground\target\release\deps\classgameground.classgamegr
ound.a04f6f11-cgu.0.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.1.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04
f6f11-cgu.10.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.11.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-
cgu.12.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.13.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.14
.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.15.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.2.rcgu.o
" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.3.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.4.rcgu.o" "E:\c
ode\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.5.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.6.rcgu.o" "E:\code\rus
t\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.7.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.8.rcgu.o" "E:\code\rust\class
gameground\target\release\deps\classgameground.classgameground.a04f6f11-cgu.9.rcgu.o" "E:\code\rust\classgameground\target\release\deps\classgameground.10f8x2h4m3hb46jx.rcgu.o" "/LIBPATH:E:\code\rust\classgameground\t
arget\release\deps" "/LIBPATH:C:\vcpkg\vcpkg\installed\x64-windows-static\lib" "/LIBPATH:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "E:\code\rust\classga
meground\target\release\deps\libndarray-c486250c6ce0ed21.rlib" "E:\code\rust\classgameground\target\release\deps\libmatrixmultiply-1d3116217c223bb8.rlib" "E:\code\rust\classgameground\target\release\deps\libnum_com
plex-44a028268c07187d.rlib" "E:\code\rust\classgameground\target\release\deps\libnum_integer-a6c20d79817f2641.rlib" "E:\code\rust\classgameground\target\release\deps\libnum_traits-e11902e9df7507af.rlib" "E:\code\rust
\classgameground\target\release\deps\librawpointer-06a9340878966269.rlib" "E:\code\rust\classgameground\target\release\deps\libcblas_sys-21536f50fb239890.rlib" "E:\code\rust\classgameground\target\release\deps\lib
libc-3fc6a63652eea851.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-ac1aca38635ef0b8.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windo
ws-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libpanic_unwind-c3aa48ffdde66347.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd_detect-e191adc26f6fc9
3a.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_demangle-cd2025f252bca17e.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc
\lib\rustlib\x86_64-pc-windows-msvc\lib\libhashbrown-a1b8bc9fb8cfdc18.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_alloc-32dec5d0d5
e8f2c4.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libunwind-dd20fc17f8fe4af1.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib
\rustlib\x86_64-pc-windows-msvc\lib\libcfg_if-bb4c152a3ade13b7.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liblibc-ed0b50a02b1f754a.rlib" "C:\Users\l1z
3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc-e1d125b3a421e009.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-
msvc\lib\librustc_std_workspace_core-2abf9a74f22d740a.rlib" "C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-f309332ab230c371.rlib" "C:\Users\l1z3\.rustup
\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-55394bc732b75eeb.rlib" "kernel32.lib" "ws2_32.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LI
BPATH:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "/OUT:E:\code\rust\classgameground\target\release\deps\classgameground.exe" "/OPT:REF,ICF" "/DEBUG" "/NATVI
S:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C
:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\l1z3\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis"
= note: classgameground.classgameground.a04f6f11-cgu.0.rcgu.o : error LNK2019: unresolved external symbol cblas_dgemm referenced in function _ZN7ndarray6linalg11impl_linalg12mat_mul_impl17hf56d101a94a3760aE
E:\code\rust\classgameground\target\release\deps\classgameground.exe : fatal error LNK1120: 1 unresolved externals

warning: classgameground (bin "classgameground") generated 2 warnings
error: could not compile classgameground due to previous error; 2 warnings emitted**

===============================================================
Thanks for you help.

Unable to set TARGET when building OpenBlas

Hi,

I'm running into an issue where I am unable to compile my project (which depends on ndarray, which in turn depends on open-blas v0.10.4) due to the cpu not being detected properly (Intel(R) Xeon(R) Silver 4310 CPU). I have already tried setting the OPENBLAS_TARGET environment variable with no success:

$ OPENBLAS_TARGET=SANDYBRIDGE cargo build --features cuda,rayon --release
   Compiling openblas-src v0.10.4
error: failed to run custom build command for `openblas-src v0.10.4`

Caused by:
  process didn't exit successfully: `/home/ubuntu/project/target/release/build/openblas-src-932ce4274540924a/build-script-build` (exit status: 101)
  --- stderr
  getarch_2nd.c: In function ‘main’:
  getarch_2nd.c:14:35: error: ‘SGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_UNROLL_M’?
     14 |     printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   SBGEMM_DEFAULT_UNROLL_M
  getarch_2nd.c:14:35: note: each undeclared identifier is reported only once for each function it appears in
  getarch_2nd.c:15:35: error: ‘SGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_UNROLL_N’?
     15 |     printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   SBGEMM_DEFAULT_UNROLL_N
  getarch_2nd.c:16:35: error: ‘DGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_M’?
     16 |     printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   XGEMM_DEFAULT_UNROLL_M
  getarch_2nd.c:17:35: error: ‘DGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_N’?
     17 |     printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   XGEMM_DEFAULT_UNROLL_N
  getarch_2nd.c:21:35: error: ‘CGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_M’?
     21 |     printf("CGEMM_UNROLL_M=%d\n", CGEMM_DEFAULT_UNROLL_M);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   XGEMM_DEFAULT_UNROLL_M
  getarch_2nd.c:22:35: error: ‘CGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_N’?
     22 |     printf("CGEMM_UNROLL_N=%d\n", CGEMM_DEFAULT_UNROLL_N);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   XGEMM_DEFAULT_UNROLL_N
  getarch_2nd.c:23:35: error: ‘ZGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_M’?
     23 |     printf("ZGEMM_UNROLL_M=%d\n", ZGEMM_DEFAULT_UNROLL_M);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   XGEMM_DEFAULT_UNROLL_M
  getarch_2nd.c:24:35: error: ‘ZGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_N’?
     24 |     printf("ZGEMM_UNROLL_N=%d\n", ZGEMM_DEFAULT_UNROLL_N);
        |                                   ^~~~~~~~~~~~~~~~~~~~~~
        |                                   XGEMM_DEFAULT_UNROLL_N
  getarch_2nd.c:71:50: error: ‘SGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_Q’?
     71 |     printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 *  sizeof(float)));
        |                                                  ^~~~~~~~~~~~~~~
        |                                                  SBGEMM_DEFAULT_Q
  getarch_2nd.c:72:50: error: ‘DGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘GEMM_DEFAULT_Q’?
     72 |     printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 *  sizeof(double)));
        |                                                  ^~~~~~~~~~~~~~~
        |                                                  GEMM_DEFAULT_Q
  getarch_2nd.c:73:50: error: ‘CGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘CGEMM_DEFAULT_R’?
     73 |     printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 *  sizeof(float)));
        |                                                  ^~~~~~~~~~~~~~~
        |                                                  CGEMM_DEFAULT_R
  getarch_2nd.c:74:50: error: ‘ZGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘ZGEMM_DEFAULT_R’?
     74 |     printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 *  sizeof(double)));
        |                                                  ^~~~~~~~~~~~~~~
        |                                                  ZGEMM_DEFAULT_R
  make: *** [Makefile.prebuild:74: getarch_2nd] Error 1
  Makefile:160: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail..  Stop.

  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NonZeroExitStatus { status: 2 }', /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.10.4/build.rs:150:45
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it possible to set the target variable or am I running into a separate build issue?

Remove the explicit linking to gfortran

It’s been suggested to remove the link to gfortran; see blas/#28.

However, a few questions have to be answered first. How would it work in this case? Who would do the linking instead? The claim is that “the libopenblas.dylib built by the Makefile is correctly linked to gfortran.” How will it work on platforms other than macOS?

Set custom TARGET (linux)

The openblas-build crate offers an interface to select the TARGET make variable, however the openblas-src crate offers no way to set this option. Furthermore, the openblas-build crate clears the TARGET environment variable before calling make, leaving no way to set the TARGET of the openblas build.

What is the best way of solving this ?

In general, what is the supported way to customize the OpenBLAS build ? Environment variables seem to work fine, except for TARGET.

The name

Hi,

I’m wondering if blas in the middle is really needed. openblas-provider and netlib-provider sound good. Besides, apart from BLAS, they provide LAPACK as well.

Regards,
Ivan

Add support for the 64-bit integer interface (ilp64)

Hi!

It's quite common in high-performance computing to reach sizes where 32-bit integers no longer cut it. As such, most people usually compile everything they can with ilp64 interface instead of lp64. I wonder what would be needed to get this support into blas-lapack-rs?

Usually the real PITA with C/C++ and Fortran is if ilp64/lp64 get mixed between the application and libraries, or between different libraries. The fact that you seem to offer the very neat -src packages as well could be a fantastic way to avoid incompatibilities. I'm no cargo expert by any length, but it seems it would be possible to make sure to match up features between dependencies?

There is an issue on the ndarray crate that has been open for about 4 years now, it would be nice to get that supported: rust-ndarray/ndarray#133.
I forked both openblas-src and cblas-sys to take a quick look at what would be needed, but I'm lacking the skills to get most out of the cargo features (and how to enforce compatibility).

Cannot compile on x86

It seems the BINARY=32 argument should be passed explicitly to make in order to compile OpenBLAS on a 32-bit platform. Without it, it ends up complaining about missing object files:

...
ar: strmm_kernel_LN.o: No such file or directory
make[1]: *** [libs] Error 1
make: *** [libs] Error 1
thread 'main' panicked at '`"make" "libs" "netlib" "shared" "YES_CBLAS=1" "YES_LAPACKE=1" "-j1"` failed: exit code: 2', build.rs:53
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Regards,
Ivan

[Help needed] Make a release

Hi,

Thank you for writing this repo. I am using an M1 Mac for development in rust but I am running into compilation issues.
OpenMathLib/OpenBLAS#3222

It seems the above issue is addressed in 0.3.16 where existing codebase was already using 0.3.17 but the main branch is not released to crates.io so I cannot pull the latest version. Wondering if any of you can help update the release?

Thanks!

Failed to run custom build command for `openblas-src v0.7.0`

Hi everyone,

I am using ndarray-linalg and therefore need link to a backend crate, so I'm using openblas.

What I did are:

  1. Install gfortran and libopenblas-dev via sudo apt-get .
  2. Add following dependencies to my Cargo.toml file:
ndarray = "0.12"
ndarray-linalg = "0.11.0"
openblas-src="0.7"
  1. Add:
extern crate openblas_src;

to my lib.rs

But when I did cargo run, the following error message showed up:

ranlib ../../../libopenblas_nehalemp-r0.3.4.a
make[3]: Leaving directory '/home/tori/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/source_x86_64-unknown-linux-gnu/lapack-netlib/LAPACKE/utils'
make[2]: Leaving directory '/home/tori/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/source_x86_64-unknown-linux-gnu/lapack-netlib/LAPACKE'
make[1]: Leaving directory '/home/tori/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/source_x86_64-unknown-linux-gnu/lapack-netlib'
make[1]: Entering directory '/home/tori/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/source_x86_64-unknown-linux-gnu/exports'
cc -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.4\" -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I..  -shared -o ../libopenblas_nehalemp-r0.3.4.so \
-Wl,--whole-archive ../libopenblas_nehalemp-r0.3.4.a -Wl,--no-whole-archive \
-Wl,-soname,libopenblas.so.0 -lm -lpthread -lgfortran -lm -lpthread -lgfortran
cc -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=4 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.4\" -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I..  -w -o linktest linktest.c ../libopenblas_nehalemp-r0.3.4.so -L/home/tori/miniconda3/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L. -L/home/tori/miniconda3/lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../..  -lgfortran -lm -lquadmath -lm -lc   && echo OK.

Makefile:145: recipe for target '../libopenblas_nehalemp-r0.3.4.so' failed
make[1]: Leaving directory '/home/tori/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/source_x86_64-unknown-linux-gnu/exports'
Makefile:101: recipe for target 'shared' failed

--- stderr
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
make[1]: warning: -jN forced in submake: disabling jobserver mode.
../libopenblas_nehalemp-r0.3.4.so: undefined reference to `xerbla'
collect2: error: ld returned 1 exit status
make[1]: *** [../libopenblas_nehalemp-r0.3.4.so] Error 1
make: *** [shared] Error 2
thread 'main' panicked at 'Failed: `"make" "libs" "netlib" "shared" "BINARY=64" "YES_CBLAS=1" "YES_LAPACKE=1" "-j4"` (exit code: 2)', /home/tori/.cargo/registry/src/github.com-1ecc6299db9ec823/openblas-src-0.7.0/build.rs:68:17
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   6: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:336
   7: build_script_build::run
             at ./build.rs:68
   8: build_script_build::main
             at ./build.rs:49
   9: std::rt::lang_start::{{closure}}
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/rt.rs:64
  10: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:293
  11: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  12: std::rt::lang_start_internal
             at src/libstd/panicking.rs:272
             at src/libstd/panic.rs:394
             at src/libstd/rt.rs:48
  13: std::rt::lang_start
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/rt.rs:64
  14: main
  15: __libc_start_main
  16: _start

I'm totally confused.... Please help me!

Thanks,
Tori

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.