kaleidicassociates / lubeck

High level linear algebra library for Dlang
http://lubeck.libmir.org/
Boost Software License 1.0
66 stars 14 forks source link

Trying to build minimal example at https://tour.dlang.org/tour/en/dub/lubeck #7

Closed EmTee70 closed 6 years ago

EmTee70 commented 6 years ago

I installed some packages at last: sudo apt install libopenblas-dev

But now I am getting this error: when running dub -v ....

Search for versions of lapack77 (1 package suppliers)

No versions for lapack77 for registry at https://code.dlang.org/ (fallback ["registry at http://code.dlang.org/", "registry at https://code-mirror.dlang.io/", "registry at https://code-mirror2.dlang.io/", "registry at https://dub-registry.herokuapp.com/"]) Nothing found for lapack77 Search for versions of mir-blas (1 package suppliers) Return for mir-blas: [0.1.0, 0.0.4, 0.0.2, 0.0.1, ~master] Search for versions of cblas (1 package suppliers) Return for cblas: [2.0.1, 2.0.0, 1.0.0, 0.2.0, 0.1.0, 0.0.4, 0.0.3, 0.0.2, 0.0.1, 0.0.0, ~master, ~remove-unittest, ~link-1, ~link, ~John-Colvin-patch-1] Package mir-lapack contains invalid dependency lapack77 (no version candidates) (ci=10)

What ca I do? (Ubuntu 17.10. 64 Bit)

9il commented 6 years ago

lapack77 was a temporary package. Currently it is lapack package. Removing dub.selections.json, local and global dub caches should solve the problem. If not, please provide full example

EmTee70 commented 6 years ago

Ok. I removed dub.selection.json and called dub clean and dub clean-caches, was this sufficient? Probably not. Problem still there:

I took the dub.sdl from the example: and placed the example in source/app.d:

import std.stdio;
import mir.ndslice: magic, repeat, as, slice;
import lubeck: mtimes;

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;
    matrix.mtimes(matrix).writeln;
}

dub.sdl:

dependency "lubeck" version="~>0.0"
dependency "mir" version="~>0.7"
libs "lapack" "blas"
9il commented 6 years ago

Please try to remove dub.selections.json and replace dub.sdl with

name "lub"
dependency "lubeck" version="~>0.0.4"
libs "openblas"
EmTee70 commented 6 years ago

Great! It works! Now I will start to play around with it and learn to define my own matrix class with an operator overload :-)