[package]
name = "mytest"
version = "0.1.0"
edition = "2018"
[dependencies]
blas = "0.19"
openblas-src = "0.5"
fn main() {
use blas::*;
let (m, n, k) = (2, 4, 3);
let a = vec![
1.0, 4.0,
2.0, 5.0,
3.0, 6.0,
];
let b = vec![
1.0, 5.0, 9.0,
2.0, 6.0, 10.0,
3.0, 7.0, 11.0,
4.0, 8.0, 12.0,
];
let mut c = vec![
2.0, 7.0,
6.0, 2.0,
0.0, 7.0,
4.0, 2.0,
];
unsafe {
dgemm(b'N', b'N', m, n, k, 1.0, &a, m, &b, k, 1.0, &mut c, m);
}
assert!(
c == vec![
40.0, 90.0,
50.0, 100.0,
50.0, 120.0,
60.0, 130.0,
]
);
}
Compiling mytest v0.1.0 (/path/to/somedir/)
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.13w5aln7qfvncvt4.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.14u0vpidl0sbmj0b.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.1c88w9g7t7n2s40l.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.1krajtmdy2yn378h.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.1qz396llvwat4zpy.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.1tad4rifk5jkfddw.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.21mgky5eb11hxae3.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.2hagi8yal5o30y1.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.2ktsn4br1k2smszs.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.2perbk8m0wb97cxo.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.2ubnhatjz686ehef.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.37xkbwbn91m8ubct.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.39ab1dod37ggxihr.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.3ahxxxsnylushd0a.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.3d4bhef1rcvdpgsb.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.3ewy9mbg9t5vffpv.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.3r6jvjkvsut4a89o.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.3toj37gza9k1y6u0.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.4182y0zotoic8e23.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.44pxkqpm25uzgq9h.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.4fmzgi3v7fq9gyoa.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.54tqyqmcztojjhq8.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.56xnjyiiiwmd666i.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.58cedehdxovh6kmo.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.awprjvw26g7l29h.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.bqyiwcm31ib37sz.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.jnn7qfowzc2ee4q.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.oo7bneinvm3yyac.rcgu.o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.w41aa5jadqop0an.rcgu.o" "-o" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1" "/path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.oulkxomifrbq6a0.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/path/to/somedir/target/debug/deps" "-L" "/path/to/somedir/target/debug/build/openblas-src-268ee3801b064ca1/out/opt/OpenBLAS/lib" "-L" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/path/to/somedir/target/debug/deps/libblas-643116a8da1a1f32.rlib" "/path/to/somedir/target/debug/deps/libnum_complex-305b1318b4d3efeb.rlib" "/path/to/somedir/target/debug/deps/libnum_traits-c14fcad4261d1c45.rlib" "/path/to/somedir/target/debug/deps/libblas_sys-51123d7b1471b1bb.rlib" "/path/to/somedir/target/debug/deps/liblibc-47d537f8e91fe919.rlib" "-Wl,--start-group" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-4a76ff35a356aedf.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e11c7b3b3225afe2.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-13217ede3d276f16.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-621a9ee22da6caa1.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-546c844e8071bbeb.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-be9569e4d599746f.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-47d8845cef2a3bc5.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-017511bce73a530c.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-be7979c57a08057b.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-d6459c4f0817c67c.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-580035dd98451925.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-aee5c24fff305dea.rlib" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-8a55a4098920125a.rlib" "-Wl,--end-group" "/home/someuser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-9fc4b5be2ba5cc19.rlib" "-Wl,-Bdynamic" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /path/to/somedir/target/debug/deps/mytest-c25cf0aa53d2d5d1.37xkbwbn91m8ubct.rcgu.o: in function `blas::dgemm':
/home/someuser/.cargo/registry/src/github.com-1ecc6299db9ec823/blas-0.19.1/src/lib.rs:2124: undefined reference to `dgemm_'
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: Could not compile `mytest`.
To learn more, run the command again with --verbose.
$ nm -a libopenblas.so | grep dgemm_
0000000000098c20 T dgemm_
00000000002f2c00 T dgemm_beta
00000000002f0210 T dgemm_incopy
00000000002f05e0 T dgemm_itcopy
00000000002e9600 T dgemm_kernel
0000000000164310 T dgemm_nn
00000000001648b0 T dgemm_nt
00000000002f0aa0 T dgemm_oncopy
00000000002f1650 T dgemm_otcopy
0000000000d19188 D dgemm_p
0000000000d19168 D dgemm_q
0000000000d19148 D dgemm_r
000000000017c160 T dgemm_thread_nn
000000000017cf80 T dgemm_thread_nt
000000000017ddc0 T dgemm_thread_tn
000000000017ec00 T dgemm_thread_tt
0000000000164e30 T dgemm_tn
00000000001653e0 T dgemm_tt