Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rb-gsl intall without gem command
gem install bundler
# gem env | grep "EXECUTABLE DIRECTORY" の結果を受けて
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
git clone --depth 1 https://github.com/SciRuby/rb-gsl.git
cd rb-gsl
bundler install
# ソースコードの修正、例えば
patch -p0 << __PATCH_LINE__
--- ext/gsl_native/sf_legendre.c.orig 2017-07-28 23:28:56.944690200 +0900
+++ ext/gsl_native/sf_legendre.c 2017-07-28 23:44:56.284917800 +0900
@@ -110,7 +110,7 @@ static VALUE rb_gsl_sf_legendre_Plm_e(VA
return rb_ary_new3(2, v, INT2FIX(status));
}
-static VALUE rb_gsl_sf_legendre_Plm_array(VALUE obj, VALUE lmax, VALUE m, VALUE x)
+/*static VALUE rb_gsl_sf_legendre_Plm_array(VALUE obj, VALUE lmax, VALUE m, VALUE x)
{
gsl_vector *v = NULL;
int size;
@@ -123,7 +123,7 @@ static VALUE rb_gsl_sf_legendre_Plm_arra
v = gsl_vector_alloc(size);
gsl_sf_legendre_Plm_array(ll, mm, NUM2DBL(x), v->data);
return Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v);
-}
+}*/
static VALUE rb_gsl_sf_legendre_sphPlm(VALUE obj, VALUE l, VALUE m, VALUE x)
{
@@ -142,7 +142,7 @@ static VALUE rb_gsl_sf_legendre_sphPlm_e
return rb_ary_new3(2, v, INT2FIX(status));
}
-static VALUE rb_gsl_sf_legendre_sphPlm_array(VALUE obj, VALUE lmax, VALUE m, VALUE x)
+/*static VALUE rb_gsl_sf_legendre_sphPlm_array(VALUE obj, VALUE lmax, VALUE m, VALUE x)
{
gsl_vector *v = NULL;
int size;
@@ -155,13 +155,13 @@ static VALUE rb_gsl_sf_legendre_sphPlm_a
v = gsl_vector_alloc(size);
gsl_sf_legendre_sphPlm_array(ll, mm, NUM2DBL(x), v->data);
return Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v);
-}
+}*/
-static VALUE rb_gsl_sf_legendre_array_size(VALUE obj, VALUE lmax, VALUE m)
+/*static VALUE rb_gsl_sf_legendre_array_size(VALUE obj, VALUE lmax, VALUE m)
{
CHECK_FIXNUM(lmax); CHECK_FIXNUM(m);
return INT2FIX(gsl_sf_legendre_array_size(FIX2INT(lmax), FIX2INT(m)));
-}
+}*/
static VALUE rb_gsl_sf_conicalP_half(VALUE obj, VALUE lambda, VALUE x)
{
@@ -297,11 +297,11 @@ void Init_gsl_sf_legendre(VALUE module)
rb_define_module_function(module, "legendre_Ql_e", rb_gsl_sf_legendre_Ql_e, 2);
rb_define_module_function(module, "legendre_Plm", rb_gsl_sf_legendre_Plm, 3);
rb_define_module_function(module, "legendre_Plm_e", rb_gsl_sf_legendre_Plm_e, 3);
- rb_define_module_function(module, "legendre_Plm_array", rb_gsl_sf_legendre_Plm_array, 3);
+ //rb_define_module_function(module, "legendre_Plm_array", rb_gsl_sf_legendre_Plm_array, 3);
rb_define_module_function(module, "legendre_sphPlm", rb_gsl_sf_legendre_sphPlm, 3);
rb_define_module_function(module, "legendre_sphPlm_e", rb_gsl_sf_legendre_sphPlm_e, 3);
- rb_define_module_function(module, "legendre_sphPlm_array", rb_gsl_sf_legendre_sphPlm_array, 3);
- rb_define_module_function(module, "legendre_array_size", rb_gsl_sf_legendre_array_size, 2);
+ //rb_define_module_function(module, "legendre_sphPlm_array", rb_gsl_sf_legendre_sphPlm_array, 3);
+ //rb_define_module_function(module, "legendre_array_size", rb_gsl_sf_legendre_array_size, 2);
rb_define_module_function(module, "conicalP_half", rb_gsl_sf_conicalP_half, 2);
rb_define_module_function(module, "conicalP_half_e", rb_gsl_sf_conicalP_half_e, 2);
rb_define_module_function(module, "conicalP_mhalf", rb_gsl_sf_conicalP_mhalf, 2);
@@ -340,11 +340,11 @@ void Init_gsl_sf_legendre(VALUE module)
rb_define_module_function(mgsl_sf_leg, "Q1_e", rb_gsl_sf_legendre_Q1_e, 1);
rb_define_module_function(mgsl_sf_leg, "Plm", rb_gsl_sf_legendre_Plm, 3);
rb_define_module_function(mgsl_sf_leg, "Plm_e", rb_gsl_sf_legendre_Plm_e, 3);
- rb_define_module_function(mgsl_sf_leg, "Plm_array", rb_gsl_sf_legendre_Plm_array, 3);
+ //rb_define_module_function(mgsl_sf_leg, "Plm_array", rb_gsl_sf_legendre_Plm_array, 3);
rb_define_module_function(mgsl_sf_leg, "sphPlm", rb_gsl_sf_legendre_sphPlm, 3);
rb_define_module_function(mgsl_sf_leg, "sphPlm_e", rb_gsl_sf_legendre_sphPlm_e, 3);
- rb_define_module_function(mgsl_sf_leg, "sphPlm_array", rb_gsl_sf_legendre_sphPlm_array, 3);
- rb_define_module_function(mgsl_sf_leg, "array_size", rb_gsl_sf_legendre_array_size, 2);
+ //rb_define_module_function(mgsl_sf_leg, "sphPlm_array", rb_gsl_sf_legendre_sphPlm_array, 3);
+ //rb_define_module_function(mgsl_sf_leg, "array_size", rb_gsl_sf_legendre_array_size, 2);
rb_define_module_function(mgsl_sf_leg, "conicalP_half", rb_gsl_sf_conicalP_half, 2);
rb_define_module_function(mgsl_sf_leg, "conicalP_half_e", rb_gsl_sf_conicalP_half_e, 2);
rb_define_module_function(mgsl_sf_leg, "conicalP_mhalf", rb_gsl_sf_conicalP_mhalf, 2);
__PATCH_LINE__
# .gem/ruby/2.3.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/shell/basic.rb の io/console を無効にしたり?
rake install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.