digitalmars.D.learn - Compilation error: undefined reference to 'cblas_dgemv' / 'cblas_dger'
- p.shkadzko (40/40) Jan 11 2020 I am trying to run example code from
- dnsmt (7/11) Jan 12 2020 The Lubeck library depends on CBLAS, but the openblas package in
- p.shkadzko (4/17) Jan 13 2020 yeah, so I thought too but I have CBLAS installed as a distro
- Pavel Shkadzko (6/25) Mar 10 2020 Figured it out by using mir-blas and linking it with openBlas on
I am trying to run example code from https://tour.dlang.org/tour/en/dub/lubeck example.d: --- /+dub.sdl: dependency "lubeck" version="~>1.1" +/ import lubeck: mtimes; import mir.algorithm.iteration: each; import mir.ndslice; import std.stdio: writeln; void main() { auto n = 5; // Magic Square auto matrix = n.magic.as!double.slice; // [1 1 1 1 1] auto vec = 1.repeat(n).as!double.slice; // Uses CBLAS for multiplication matrix.mtimes(vec).writeln; "-----".writeln; matrix.mtimes(matrix).byDim!0.each!writeln; } --- I try to compile it via: --- dub build --compiler="ldc" --single example.d -v --- And get the error below: --- Linking... ldc -of.dub/build/application-debug-linux.posix-x86_64-ldc_2088-588551E77C1C779CBF3BECA 8D19211B/matrix_dot .dub/build/application-debug-linux.posix-x86_64-ldc_2088-588551E77C1C779CBF3BECA58 19211B/matrix_dot.o ../../../../../.dub/packages/lubeck-1.1.7/lubeck/.dub/build/library-debug-linux.posix-x86_64-ldc_2088-09723F6E7A90ABDEB9EDD35B DC7E7CE/liblubeck.a ../../../../../.dub/packages/mir-lapack-1.2.1/mir-lapack/.dub/build/library-debug-linux.posix-x86_64-ldc_2088-69D3CA650230A9C73F912A6D1AB4 EE1/libmir-lapack.a ../../../../../.dub/packages/mir-blas-1.1.9/mir-blas/.dub/build/library-debug-linux.posix-x86_64-ldc_2088-9B27CD5D2C27A78F627CDC352C 76E52/libmir-blas.a ../../../../../.dub/packages/mir-algorithm-3.7.13/mir-algorithm/.dub/build/default-debug-linux.posix-x86_64-ldc_2088-255337055B86988DA608A6F2BE06058 /libmir-algorithm.a ../../../../../.dub/packages/mir-core-1.0.2/mir-core/.dub/build/library-debug-linux.posix-x86_64-ldc_2088-554F8271B5559801959D678513 A5389/libmir-core.a -L--no-as-needed -L-lopenblas -g /home/tastyminerals/dev/github/mir_quickstart/source/benchmarks/../../../../../.dub/packages/mir-blas-1.1.9/mir-blas/so rce/mir/blas.d:305: error: undefined reference to 'cblas_dgemv' /home/tastyminerals/dev/github/mir_quickstart/source/benchmarks/../../../../../.dub/packages/mir-blas-1.1.9/mir-blas/so rce/mir/blas.d:210: error: undefined reference to 'cblas_dger' /home/tastyminerals/dev/github/mir_quickstart/source/benchmarks/../../../../../.dub/packages/mir-blas-1.1.9/mir-blas/so rce/mir/blas.d:385: error: undefined reference to 'cblas_dgemm' collect2: error: ld returned 1 exit status Error: /usr/bin/gcc failed with status: 1 --- This is Linux Manjaro with openblas package installed.
Jan 11 2020
On Saturday, 11 January 2020 at 16:45:22 UTC, p.shkadzko wrote:I am trying to run example code from https://tour.dlang.org/tour/en/dub/lubeck ... This is Linux Manjaro with openblas package installed.The Lubeck library depends on CBLAS, but the openblas package in the Arch repository is compiled without CBLAS. You can see that here (note the NO_CBLAS=1 parameter): https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/openblas Try installing the cblas package: https://www.archlinux.org/packages/extra/x86_64/cblas/
Jan 12 2020
On Sunday, 12 January 2020 at 13:07:33 UTC, dnsmt wrote:On Saturday, 11 January 2020 at 16:45:22 UTC, p.shkadzko wrote:yeah, so I thought too but I have CBLAS installed as a distro package. I also have OpenBLAS installed instead of BLAS because BLAS was removed since it conflicts with OpenBLAS ¯\_(ツ)_/¯I am trying to run example code from https://tour.dlang.org/tour/en/dub/lubeck ... This is Linux Manjaro with openblas package installed.The Lubeck library depends on CBLAS, but the openblas package in the Arch repository is compiled without CBLAS. You can see that here (note the NO_CBLAS=1 parameter): https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/openblas Try installing the cblas package: https://www.archlinux.org/packages/extra/x86_64/cblas/
Jan 13 2020
On Monday, 13 January 2020 at 20:47:07 UTC, p.shkadzko wrote:On Sunday, 12 January 2020 at 13:07:33 UTC, dnsmt wrote:Figured it out by using mir-blas and linking it with openBlas on Linux. You'll need openBlas and cblas installed. dub.json needs "subConfigurations": {"mir-blas": "twolib"} Then you can import blas functions like so import mir.blas : gemm;On Saturday, 11 January 2020 at 16:45:22 UTC, p.shkadzko wrote:yeah, so I thought too but I have CBLAS installed as a distro package. I also have OpenBLAS installed instead of BLAS because BLAS was removed since it conflicts with OpenBLAS ¯\_(ツ)_/¯I am trying to run example code from https://tour.dlang.org/tour/en/dub/lubeck ... This is Linux Manjaro with openblas package installed.The Lubeck library depends on CBLAS, but the openblas package in the Arch repository is compiled without CBLAS. You can see that here (note the NO_CBLAS=1 parameter): https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/openblas Try installing the cblas package: https://www.archlinux.org/packages/extra/x86_64/cblas/
Mar 10 2020