Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added script to make nmatrix-fftw gem compile on Windows (ruby -v: ru… #616

Closed
wants to merge 1 commit into from
Closed

Added script to make nmatrix-fftw gem compile on Windows (ruby -v: ru… #616

wants to merge 1 commit into from

Conversation

preetpalS
Copy link

@preetpalS preetpalS commented Apr 1, 2018

…by 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]) using MSYS2 MINGW64 for testing purposes.

This pull request is to mainly get feedback (related to #600). It contains a manual fix (you have to run a shell script sh manual_fftw_compilation.sh in the root of the directory and it only works for the mingw64 ruby version installed using msys2 (pacman -S mingw-w64-x86_64-ruby) from the mingw64 command line) for the nmatrix-fftw gem to compile (all tests pass by the way). It is based on the second part of the feedback given in #600 (comment) by @larskanis.

The fix applied to nmatrix-fftw should work for nmatrix-lapacke and nmatrix-atlas (but I encountered installing the C/C++/Fortran dependencies for these on Windows) as they are affected by the same dynamic loading issues. These issues could be resolved if the C extension components of the nmatrix-fftw, nmatrix-lapacke and nmatrix-atlas gems did not rely on dynamically linking with the C extension component of nmatrix at runtime (is dynamic linking used for performance reasons?). I'm not aware of any other gem that relies on its C extension component dynamically linking with another gem's C extension's during runtime (an example of a gem that relies on this behaviour and works on Windows would be useful).

Also

if /cygwin|mingw/ =~ RUBY_PLATFORM
CONFIG["DLDFLAGS"] << " --output-lib libnmatrix.a"
end
doesn't seem to do anything (it was changed in #530). Was the nmatrix-fftw gem once tested on Windows (@mrkn)?

Also note that I had installed fftw with the command pacman -S mingw-w64-x86_64-fftw.

Proof that the test suite passes for nmatrix-fftw passes on Windows:

$ bundle exec rake spec nmatrix_plugins="fftw"
... Skip many lines....
If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
`config.raise_errors_for_deprecations!`, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

60 deprecation warnings total

Finished in 32.7 seconds
1620 examples, 0 failures, 139 pending
C:/msys64/mingw64/bin/ruby.exe -S rspec spec/00_nmatrix_spec.rb spec/01_enum_spec.rb spec/02_slice_spec.rb spec/03_nmatrix_monkeys_spec.rb spec/blas_spec.rb spec/elementwise_spec.rb spec/homogeneous_spec.rb spec/io/fortran_format_spec.rb spec/io/harwell_boeing_spec.rb spec/io_spec.rb spec/lapack_core_spec.rb spec/math_spec.rb spec/nmatrix_yale_spec.rb spec/rspec_spec.rb spec/shortcuts_spec.rb spec/slice_set_spec.rb spec/stat_spec.rb
C:/msys64/mingw64/bin/ruby.exe -S rspec spec/00_nmatrix_spec.rb spec/01_enum_spec.rb spec/02_slice_spec.rb spec/03_nmatrix_monkeys_spec.rb spec/blas_spec.rb spec/elementwise_spec.rb spec/homogeneous_spec.rb spec/io/fortran_format_spec.rb spec/io/harwell_boeing_spec.rb spec/io_spec.rb spec/lapack_core_spec.rb spec/math_spec.rb spec/nmatrix_yale_spec.rb spec/plugins/fftw/fftw_spec.rb spec/rspec_spec.rb spec/shortcuts_spec.rb spec/slice_set_spec.rb spec/stat_spec.rb

$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]

…by 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]) using MSYS2 MINGW64 for testing purposes.
@translunar
Copy link
Member

You may need to find someone who actually uses Windows to give you some feedback on this. :/

@preetpalS preetpalS closed this May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants