我应该如何在 Ubuntu 20.10 上使用 libjulia-openblas64 包运行我的 Julia 代码?

我应该如何在 Ubuntu 20.10 上使用 libjulia-openblas64 包运行我的 Julia 代码?

我安装了 Ubuntu 20.10。此外,我还用 Julia 语言编写了一个简单程序:

using LinearAlgebra
println(LinearAlgebra.BLAS.vendor())

M = 500;
c = [ sin(a + b.^2) for a in 1:M, b in 1:M]
t0 = time();
g = LinearAlgebra.eigvals(c);
t = time() - t0
println("t=", t)
m = maximum(real(g))
println("m=", m)
if M == 500
    @assert isapprox(m, 16.914886, rtol=1e-6)
end

我在存储库中看到了有趣的包 -libjulia-openblas64.其文件列表仅包含.so 库。我期望运行 Julia 代码时性能得到优化。
但是当我安装这个包时,我找不到julia可执行文件。所以问题就在标题里。


$ dpkg -l | grep julia
ii  libjulia-openblas64:amd64                0.3.10+ds-3ubuntu1                  amd64        Optimized BLAS (linear algebra) library (julia version)
$ julia
bash: julia: command not found
$ sudo apt-get install julia
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libjulia-openblas64 : Conflicts: libjulia1 (< 1.4.1+dfsg-2) but 1.4.1+dfsg-1 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
$ sudo aptitude install julia
The following NEW packages will be installed:
  git{a} git-man{a} julia julia-common{a} less{a} libdsfmt-19937-1{a} liberror-perl{a} libgit2-28{a} libhttp-parser2.9{a} 
  libjulia1{a} libllvm8{a} libmbedcrypto3{a} libmbedtls12{a} libmbedx509-0{a} libopenlibm3{a} libutf8proc2{a} 
0 packages upgraded, 16 newly installed, 0 to remove and 4 not upgraded.
Need to get 54.0 MB of archives. After unpacking 345 MB will be used.
The following packages have unmet dependencies:
 libjulia-openblas64 : Conflicts: libjulia1 (< 1.4.1+dfsg-2) but 1.4.1+dfsg-1 is to be installed
The following actions will resolve these dependencies:

     Remove the following packages:                          
1)     libjulia-openblas64 [0.3.10+ds-3ubuntu1 (groovy, now)]

Accept this solution? [Y/n/q/?] q

答案1

实际上,我们不应该尝试直接使用libjulia-openblas64包,而应该使用julia已经包含 OpenBLAS 库并使用它的默认包。

相关内容