SciRuby / nmatrix

Dense and sparse linear algebra library for Ruby via SciRuby
Other
469 stars 133 forks source link

Jruby master #545

Closed prasunanand closed 7 years ago

prasunanand commented 8 years ago

Updated rake tasks for jruby build and modified Readme.

translunar commented 8 years ago

This is still not working for me. It's attempting to run extconf.rb through JRuby, which is not correct. Have you tested this?

prasunanand commented 8 years ago

Please run rake javac rake jar

prasunanand commented 8 years ago

And there may be an issue with Gemfile or json version.

translunar commented 8 years ago

Nope. Paths are wrong. "javac: directory not found: ../build/classes."

Please work on getting this to the point where the interfaces for MRI and JRuby are as identical as possible.

prasunanand commented 8 years ago

Solved that.

Now, working on making the interfaces identical.

prasunanand commented 8 years ago

@mohawkjohn : I have tried to make interfaces identical. rake jruby will compile and package the classes into a jar. Also, rake spec runs the test only when BLAS_spec is removed. I am not sure whether I should make other changes to rakefile as it may break tasks for different extensions. I think @wlevine can help.

translunar commented 8 years ago

Okay, getting closer. This is much better.

Now I'm getting:

$ bundle exec rake spec
/Users/jwoods/.rbenv/versions/jruby-9.1.5.0/bin/jruby -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
NameError: BLAS not found in packages org.apache.commons.math3.analysis.function; last error: cannot load Java class org.apache.commons.math3.analysis.function.BLAS
    const_missing at uri:classloader:/jruby/java/core_ext/module.rb:45
           <main> at /Users/jwoods/Projects/nmatrix/spec/blas_spec.rb:30
             load at org/jruby/RubyKernel.java:974
  block in (root) at /Users/jwoods/.rbenv/versions/jruby-9.1.5.0/lib/ruby/gems/shared/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1
             each at org/jruby/RubyArray.java:1734
  load_spec_files at /Users/jwoods/.rbenv/versions/jruby-9.1.5.0/lib/ruby/gems/shared/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065
  load_spec_files at /Users/jwoods/.rbenv/versions/jruby-9.1.5.0/lib/ruby/gems/shared/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065
              run at /Users/jwoods/.rbenv/versions/jruby-9.1.5.0/lib/ruby/gems/shared/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18
     block in run at /Users/jwoods/.rbenv/versions/jruby-9.1.5.0/lib/ruby/gems/shared/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103
/Users/jwoods/.rbenv/versions/jruby-9.1.5.0/bin/jruby -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 failed

What am I missing?

Also, can you please look into adding Travis tests for JRuby? It's not too hard. Just have a look at travis.yml, and Google a bit. This will be the final requirement for merging.

prasunanand commented 8 years ago

@mohawkjohn : I had to comment out blas_spec.rb to make "bundle exec rake spec" working. I will correct this and may need some help from @wlevine ; as this may affect "gem build nmatrix-....gemspec". I expect to correct this soon.

abinashmeher999 commented 8 years ago

Try splitting the commit and then revert. https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Splitting-a-Commit

On Thu, Oct 13, 2016, 11:26 PM Prasun Anand notifications@github.com wrote:

@prasunanand commented on this pull request.

In spec/spec_helper.rb https://github.com/SciRuby/nmatrix/pull/545:

@@ -27,17 +27,17 @@ require "rspec/longrun"

require "narray/narray"

-require "../lib/nmatrix" -require "../lib/nmatrix/rspec" +require "./lib/nmatrix" +require "./lib/nmatrix/rspec"

I found the commit prasunanand@6d50c1f https://github.com/prasunanand/nmatrix/commit/6d50c1f53d734009f5d3bf571e920aa17c50504e. More than 1 file is changed. If I revert all changes are lost. What should I do?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SciRuby/nmatrix/pull/545, or mute the thread https://github.com/notifications/unsubscribe-auth/AGmQ6_Gwv5A3XqRXvgHLvsXxLCFsaXooks5qznDDgaJpZM4KINOQ .

Regards, Abinash Meher

translunar commented 8 years ago

Can you please rebase against master, @prasunanand? I think we've sorted out the Travis problems for MRI NMatrix.

prasunanand commented 8 years ago

Yeah, I will do it.

translunar commented 8 years ago

@prasunanand I decided to give you a boost and modified the lines in .travis.yml to allow for testing of JRuby versions. See #554.

You'll still need to make one change to the Travis config: for this pull request, you need to remove JRuby from allowed failures. Once you get it working with JRuby-head, you'll also want to add the appropriate lines for other versions of JRuby (I'd start with 9.0.0.0 and head).

prasunanand commented 8 years ago

Thanks @mohawkjohn

translunar commented 8 years ago

Any progress on this? I just merged #554.

prasunanand commented 7 years ago

@mohawkjohn I have started working on travis-tasks for JRuby. I have been busy with school work. I would update soon.

prasunanand commented 7 years ago

Moved to https://github.com/SciRuby/nmatrix/pull/558