Skip to content

Instantly share code, notes, and snippets.

@retsyo
Last active September 11, 2017 06:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retsyo/54e6838d65bee85604adc3717dd4f8ce to your computer and use it in GitHub Desktop.
Save retsyo/54e6838d65bee85604adc3717dd4f8ce to your computer and use it in GitHub Desktop.
nim: could not import: cblas_sscal
I could not run compiled nim app if it uses openblas in msys2+mingw64 on win64.
I have update nim to the new `git cloned` one, openblas to the latest one too
for example, as for https://github.com/mratsim/Arraymancer
```bash
$ nim
Nim Compiler Version 0.17.1 (2017-07-17) [Windows: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf
$ pacman -S mingw64/mingw-w64-x86_64-openblas
warning: mingw-w64-x86_64-openblas-0.2.17-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (1) mingw-w64-x86_64-openblas-0.2.17-1
Total Installed Size:  90.29 MiB
Net Upgrade Size:       0.00 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                          [############################] 100%
(1/1) checking package integrity                        [############################] 100%
(1/1) loading package files                             [############################] 100%
(1/1) checking for file conflicts                       [############################] 100%
(1/1) checking available disk space                     [############################] 100%
:: Processing package changes...
(1/1) reinstalling mingw-w64-x86_64-openblas            [############################] 100%
$ pacman -Ss openblas
mingw64/mingw-w64-x86_64-openblas 0.2.17-1 [installed]
    An optimized BLAS library based on GotoBLAS2 1.13 BSD, providing optimized blas, lapack,
    and cblas (mingw-w64)
$ cd /r
$ git clone --depth 1 https://github.com/mratsim/Arraymancer
Cloning into 'Arraymancer'...
remote: Counting objects: 56, done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 56 (delta 9), reused 15 (delta 2), pack-reused 0
Unpacking objects: 100% (56/56), done.
$ cd ./Arraymancer
$ mkdir bin
$ cp /mingw64/bin/libblas.dll ./bin/blas.dll
$ nimble refresh
Downloading Official package list
    Success Package list downloaded.
$ nimble test
  Executing task test in R:\Arraymancer\arraymancer.nimble
  Verifying dependencies for arraymancer@0.1.0
      Info: Dependency on nimblas@>= 0.1.3 already satisfied
  Verifying dependencies for nimblas@0.1.4
  Compiling tests/all_tests.nim (from package arraymancer) using c backend
Hint: used config file 'E:\msys64\home\LOVLJIDY\_nim\nim\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: all_tests [Processing]
Hint: arraymancer [Processing]
Hint: sequtils [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: algorithm [Processing]
Hint: future [Processing]
Hint: macros [Processing]
Hint: nimblas [Processing]
--USING DEFAULT BLAS--
Hint: typetraits [Processing]
Hint: random [Processing]
Hint: times [Processing]
Hint: winlean [Processing]
Hint: dynlib [Processing]
Consider adding BLIS from "https://github.com/flame/blis" and compile Arraymancer with "-d:blis" for operations on array slices without copy. OSX users can install it through Homebrew.
Hint: test_init [Processing]
Hint: unittest [Processing]
Hint: streams [Processing]
Hint: os [Processing]
Hint: ospaths [Processing]
Hint: terminal [Processing]
Hint: test_comparison [Processing]
R:\Arraymancer\src\arraymancer\display.nim(90, 52) Hint: rewriteToTensorReshape(repeat(sep, t0.shape[1]), Cpu, t.shape[1], 1) --> '
  toTensorReshape(repeat(sep, t0.shape[1]), Cpu, [t.shape[1], 1])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(112, 53) Hint: rewriteToTensorReshape(repeat(sep, t.shape[2]), Cpu, t.shape[2], 1) --> '
  toTensorReshape(repeat(sep, t.shape[2]), Cpu, [t.shape[2], 1])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(119, 64) Hint: rewriteToTensorReshape(repeat(empty, hbuffer[0].shape[1]), Cpu,
                       0, hbuffer[0].shape[1]) --> '
  toTensorReshape(repeat(empty, hbuffer[0].shape[1]), Cpu, [0, hbuffer[0].shape[1]])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(123, 61) Hint: rewriteToTensorReshape(repeat(sepv, hbuffer[0].shape[1]), Cpu,
                       1, hbuffer[0].shape[1]) --> '
  toTensorReshape(repeat(sepv, hbuffer[0].shape[1]), Cpu, [1, hbuffer[0].shape[1]])' [Pattern]
Hint: test_accessors [Processing]
Hint: test_accessors_slicer [Processing]
Hint: test_display [Processing]
Hint: test_operators_blas [Processing]
R:\Arraymancer\src\arraymancer\display.nim(90, 52) Hint: rewriteToTensorReshape(repeat(sep, t0.shape[1]), Cpu, t.shape[1], 1) --> '
  toTensorReshape(repeat(sep, t0.shape[1]), Cpu, [t.shape[1], 1])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(112, 53) Hint: rewriteToTensorReshape(repeat(sep, t.shape[2]), Cpu, t.shape[2], 1) --> '
  toTensorReshape(repeat(sep, t.shape[2]), Cpu, [t.shape[2], 1])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(119, 64) Hint: rewriteToTensorReshape(repeat(empty, hbuffer[0].shape[1]), Cpu,
                       0, hbuffer[0].shape[1]) --> '
  toTensorReshape(repeat(empty, hbuffer[0].shape[1]), Cpu, [0, hbuffer[0].shape[1]])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(123, 61) Hint: rewriteToTensorReshape(repeat(sepv, hbuffer[0].shape[1]), Cpu,
                       1, hbuffer[0].shape[1]) --> '
  toTensorReshape(repeat(sepv, hbuffer[0].shape[1]), Cpu, [1, hbuffer[0].shape[1]])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(90, 52) Hint: rewriteToTensorReshape(repeat(sep, t0.shape[1]), Cpu, t.shape[1], 1) --> '
  toTensorReshape(repeat(sep, t0.shape[1]), Cpu, [t.shape[1], 1])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(112, 53) Hint: rewriteToTensorReshape(repeat(sep, t.shape[2]), Cpu, t.shape[2], 1) --> '
  toTensorReshape(repeat(sep, t.shape[2]), Cpu, [t.shape[2], 1])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(119, 64) Hint: rewriteToTensorReshape(repeat(empty, hbuffer[0].shape[1]), Cpu,
                       0, hbuffer[0].shape[1]) --> '
  toTensorReshape(repeat(empty, hbuffer[0].shape[1]), Cpu, [0, hbuffer[0].shape[1]])' [Pattern]
R:\Arraymancer\src\arraymancer\display.nim(123, 61) Hint: rewriteToTensorReshape(repeat(sepv, hbuffer[0].shape[1]), Cpu,
                       1, hbuffer[0].shape[1]) --> '
  toTensorReshape(repeat(sepv, hbuffer[0].shape[1]), Cpu, [1, hbuffer[0].shape[1]])' [Pattern]
test_operators_blas.nim(114, 9) Hint: 'te_int' is declared but not used [XDeclaredButNotUsed]
test_operators_blas.nim(113, 9) Hint: 'td_int' is declared but not used [XDeclaredButNotUsed]
Please note that integer matrix multiplication do not have optimized operations like how research has done for floats. If your integers are smaller than 2^31, you can convert them to float64 without losing precision before Matrix-Matrix or Matrix-Vector operations to benefit from accelerated routines.
Hint: test_aggregate [Processing]
Hint: test_shapeshifting [Processing]
test_shapeshifting.nim(20, 38) Hint: rewriteToTensorReshape(
  var i1289602 = 0
  var result1289665 = newSeq(len(1 .. 4))
  for x1289676 in 1 .. 4:
    result1289665[i1289602] = x1289676
    inc i1289602, 1
  result1289665,
                       Cpu, 2, 2) --> '
  toTensorReshape(
    var i1289602 = 0
    var result1289665 = newSeq(len(1 .. 4))
    for x1289676 in 1 .. 4:
      result1289665[i1289602] = x1289676
      inc i1289602, 1
    result1289665,
                  Cpu, [2, 2])' [Pattern]
CC: arraymancer_all_tests
CC: stdlib_system
CC: arraymancer_arraymancer
CC: arraymancer_test_init
CC: arraymancer_test_comparison
CC: arraymancer_test_accessors
CC: arraymancer_test_accessors_slicer
CC: arraymancer_test_display
CC: arraymancer_test_operators_blas
CC: arraymancer_test_aggregate
CC: arraymancer_test_shapeshifting
CC: stdlib_sequtils
CC: stdlib_strutils
CC: stdlib_future
CC: stdlib_algorithm
CC: nimblas_nimblas
CC: stdlib_math
CC: stdlib_typetraits
CC: stdlib_macros
CC: stdlib_random
CC: stdlib_parseutils
CC: stdlib_times
CC: stdlib_winlean
CC: stdlib_dynlib
CC: stdlib_unittest
CC: stdlib_streams
CC: stdlib_os
CC: stdlib_ospaths
CC: stdlib_terminal
Hint:  [Link]
Hint: operation successful (29209 lines compiled; 13.978 sec total; 407.949MiB peakmem; Debug Build) [SuccessX]
Hint: ./bin/all_tests  [Exec]
could not import: cblas_sscal
Error: execution of an external program failed: './bin/all_tests '
       Tip: 2 messages have been suppressed, use --verbose to show them.
     Error: Execution failed with exit code 1
        ... Command: "E:\msys64\home\LOVLJIDY\_nim\nim\bin\nim.exe" c --noNimblePath --path:"C:\Users\LOVLJIDY\.nimble\pkgs\nimblas-0.1.4" --out:./bin/all_tests --run --nimcache:"nimcache"  "tests/all_tests.nim"
$ ./bin/all_tests.exe
could not import: cblas_sscal
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment