rb-gsl icon indicating copy to clipboard operation
rb-gsl copied to clipboard

Adapt to GSL 2.0

Open boutil opened this issue 9 years ago • 10 comments

The following modifications allows one to compile and ruby rb-gsl against GSL v2.

  • change the way jacobians of fdfsolvers are computed as they are no more accessible as members of the structure
  • some elliptic functions return error code change their name, elliptic D function dropped the unused parameter n
  • fix a compiler warning about a pointer being passed instead of the value it was pointing to.

The files build without issues and test pass with ruby2.2 and ruby2.3

Let me know if you want me to modify or correct things in this PR.

This allows at least Debian to fix the transition of this package to GSL 2, and thus fixes #24 and #25

Thanks!

boutil avatar Feb 29 '16 13:02 boutil

travis does not work, because it cannot install gsl v2 via rubygems.

boutil avatar Feb 29 '16 13:02 boutil

This is great. I'm currently working on incorporating nmatrix into rb-gsl and don't want any conflicts, so I'll merge your code with mine in 2-3 days.

v0dro avatar Feb 29 '16 18:02 v0dro

By the way, does this change break compatibility with GSL 1.15 and 1.16?

If yes, could you add guards with the macro GSL_2_LATER for whatever code that requires GSL > 2?

For example:

# ifdef GSL_2_LATER
  // some gsl 2.0 methods.
#endif

v0dro avatar Feb 29 '16 18:02 v0dro

Thanks for your feedback. I'll try to see what I can do in this direction.

boutil avatar Mar 01 '16 00:03 boutil

Hi,

Many thanks for this great patch.

I've wrote an additional patch to detect whether Jacobians are pre-calculated (fbf775955495fc31b1b0a569f0aa40033c65d773). I hope it helps.

ktns avatar Mar 01 '16 22:03 ktns

Now I wrote a similar patch for gsl_sf_mathieu (c08a4a4589fa33647fe77702d023cd57820ba3da).

I hope this also helps you.

ktns avatar Mar 01 '16 23:03 ktns

@boutil will it possible for you to include changes from @ktns into your branch?

v0dro avatar Mar 02 '16 07:03 v0dro

I'll work on that today.

boutil avatar Mar 02 '16 11:03 boutil

@boutil didn't you have to make any changes to extconf to link with GSL 2.1?

v0dro avatar Mar 04 '16 06:03 v0dro

I integrated the changes from @ktns to replace mine where needed. Thanks @ktns. I also put a gard around the change of parameters for the ellint_D function.

I didn't have to make any changes to link with GSL2.1. I just ran ruby on the extconf.rb, and make, and it just built.

boutil avatar Mar 06 '16 10:03 boutil