numo-linalg icon indicating copy to clipboard operation
numo-linalg copied to clipboard

Cannot install/use on windows 10

Open ruggieroguida opened this issue 5 years ago • 4 comments

Hi,

I am struggling to make numo-linalg (0.1.5) work in windows 10. I am using it successfully on macos. It is amazing BTW :-)

Notes:

  • I am using Msys2
  • I have installed numo-narray
  • I have installed openblas using pacman
  • I have also tried to compile it from source. Same results
  • I have installed lapack using pacman

libopenblas.a and liblapacke.a are both in C:\msys64\mingw64\lib so I install the gem with

gem install numo-linalg -- --with-openblas-dir=C:\msys64\mingw64\lib --with-lapack-lib=C:\msys64\mingw64\lib

The problem is that when I try default, level 1, 2 or 3, for example

require "numo/linalg/linalg"
Numo::Linalg::Loader.load_openblas "C:\\msys64\\mingw64\\lib"

I always get

RuntimeError: cannot find OpenBLAS library
from C:/Apps/rubies/Ruby22-x64/lib/ruby/gems/2.2.0/gems/numo-linalg-0.1.5/lib/numo/linalg/loader.rb:90:in `load_openblas' 

Any idea? Thanks

ruggieroguida avatar Jul 02 '20 06:07 ruggieroguida

@Rojj I have succeeded in using the Numo::Linalg by not specifying the OpenBLAS library path. Please try that.

numo-linalg_msys

yoshoku avatar Jul 25 '20 15:07 yoshoku

Sorry, maybe it was not clear that I am using Ruby 2.2.4 (Unfortunately I cannot upgrade)

That was my first attempt. I also just tried on my work PC (Windows 10 and Ruby Installer 2.2.4). It installs without any error, but when I execute require 'numo/linalg' i get the following error

C:/Rubies/Ruby22-x64/lib/ruby/gems/2.2.0/gems/numo-linalg-0.1.5/lib/numo/linalg/loader.rb:162:in `load_library': cannot find backend library for Numo::Linalg (RuntimeError)
        from C:/Rubies/Ruby22-x64/lib/ruby/gems/2.2.0/gems/numo-linalg-0.1.5/lib/numo/linalg.rb:3:in `<top (required)>'
        from C:/Rubies/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from C:/Rubies/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from C:/Rubies/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from linalg.rb:1:in `<main>'

Is there a minimum Ruby version?

ruggieroguida avatar Jul 30 '20 14:07 ruggieroguida

I tried to load the libraries directly with Ruby Installer 2.6.6 as follows:

require 'numo/linalg/linalg'

Numo::Linalg::Blas.dlopen 'C:\msys64\mingw64\lib\libopenblas.dll.a'
Numo::Linalg::Lapack.dlopen 'C:\msys64\mingw64\lib\liblapacke.dll.a'

However, I obtained RuntimeError (Exec format error). This error is due to the system and architecture, not to the Numo::Linalg codes. So, it is difficult for me to investigate the cause of this error further.

I think that it is difficult to load OpenBLAS on Msys2 with Ruby installed by RubyInstaller.

yoshoku avatar Aug 01 '20 06:08 yoshoku

@Rojj Could you try #42?

mrkn avatar Jul 15 '21 13:07 mrkn