jl4rb 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/jl4rb/extconf.rb +14 -28
- data/ext/jl4rb/jl4rb.c +3 -37
- data/jl4rb.gemspec +1 -1
- data/lib/jl4rb/jl2rb_init.rb +2 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c7ae193c99972539639a96d7964b652f4d778c4003566549ad28acff8d58fa1
|
4
|
+
data.tar.gz: c588912e8ad02fda35f7eb0034cdf7e5d3d220385a991824bd594ac8bf67244b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f41f2debc68026e427d292cade9b08d70f44b3702f8885728f0367ba4478a65dec3177f7b3577c6de0fbbacea83f3e9e80f8bc005303d82b8a3a7e4ef0a329
|
7
|
+
data.tar.gz: 9c496f95518a6ea625b41ae22a60743a660f8fa760fc964a8fb0862a3aa71f7de0c33916e2d38c32f1304bdd9ddb9a68665dad238947dae5a3571b1e76377685
|
data/ext/jl4rb/extconf.rb
CHANGED
@@ -1,37 +1,23 @@
|
|
1
1
|
require "mkmf"
|
2
|
-
require 'fileutils'
|
3
|
-
|
2
|
+
require 'fileutils'
|
4
3
|
|
5
4
|
$prefix_include,$prefix_lib=[],[]
|
6
|
-
|
7
|
-
# $prefix_include << "/usr/include/"+RUBY_PLATFORM+"/julia" if File.exists? "/usr/include/"+RUBY_PLATFORM+"/julia"
|
8
|
-
# $prefix_include << "/usr/include/julia" if File.exists? "/usr/include/julia"
|
9
|
-
|
10
|
-
# $prefix_lib << "/usr/lib/"+RUBY_PLATFORM+"/julia" if File.exists? "/usr/lib/"+RUBY_PLATFORM+"/julia"
|
11
|
-
# else
|
12
|
-
#$prefix=ENV["JLAPI_HOME"] || File.join(ENV["HOME"],".jlapi/julia") || ENV["JULIA_HOME"]
|
13
|
-
$prefix=ENV["JULIA_DIR"]
|
14
|
-
#p $prefix
|
15
|
-
[$prefix+"/include/julia",$prefix+"/usr/include",$prefix+"/src",$prefix+"/src/support"].each do |incl|
|
16
|
-
$prefix_include << incl if File.exists? incl
|
17
|
-
end
|
18
|
-
|
19
|
-
([$prefix+"/lib/julia",$prefix+"/usr/lib",$prefix+"/lib"]+(RUBY_PLATFORM=~/(?:mingw|msys)/ ? [$prefix+"/bin"] : [])).each do |lib|
|
20
|
-
$prefix_lib << lib if File.exists? lib
|
21
|
-
end
|
22
|
-
# end
|
5
|
+
$prefix= File.dirname(`julia -e 'print(Sys.BINDIR)'`)
|
23
6
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
# $LDFLAGS = " -Wl,-rpath,"+lib+" -L"+lib if lib
|
28
|
-
# $libs = (enable_config("julia-release") ? " -ljulia-release" : " -ljulia-api" )
|
7
|
+
[$prefix+"/include/julia",$prefix+"/usr/include",$prefix+"/src",$prefix+"/src/support"].each do |incl|
|
8
|
+
$prefix_include << incl if File.exists? incl
|
9
|
+
end
|
29
10
|
|
30
|
-
|
11
|
+
([$prefix+"/lib/julia",$prefix+"/usr/lib",$prefix+"/lib"]+(RUBY_PLATFORM=~/(?:mingw|msys)/ ? [$prefix+"/bin"] : [])).each do |lib|
|
12
|
+
$prefix_lib << lib if File.exists? lib
|
13
|
+
end
|
14
|
+
|
15
|
+
def jl4rb_makefile(incs,libs)
|
31
16
|
|
32
|
-
|
33
|
-
$
|
34
|
-
$
|
17
|
+
jl_share=`julia -e 'print(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia"))'`
|
18
|
+
$CFLAGS =`julia #{jl_share}/julia-config.jl --cflags`
|
19
|
+
$LDFLAGS =`julia #{jl_share}/julia-config.jl --ldflags`
|
20
|
+
$libs =`julia #{jl_share}/julia-config.jl --ldlibs`
|
35
21
|
|
36
22
|
|
37
23
|
header = nil
|
data/ext/jl4rb/jl4rb.c
CHANGED
@@ -9,8 +9,6 @@
|
|
9
9
|
#include <string.h>
|
10
10
|
#include <math.h>
|
11
11
|
|
12
|
-
//JULIA_DEFINE_FAST_TLS()
|
13
|
-
|
14
12
|
//#define WITH_JULIA_RELEASE
|
15
13
|
|
16
14
|
//#ifdef WITH_JULIA_RELEASE
|
@@ -29,41 +27,9 @@
|
|
29
27
|
/************* INIT *********************/
|
30
28
|
|
31
29
|
|
32
|
-
VALUE Julia_init(
|
30
|
+
VALUE Julia_init()
|
33
31
|
{
|
34
|
-
|
35
|
-
int i,argc;
|
36
|
-
VALUE tmp;
|
37
|
-
|
38
|
-
argc=RARRAY_LEN(args) + 1;
|
39
|
-
tmp=rb_ary_entry(args,0);
|
40
|
-
julia_home_dir=StringValuePtr(tmp);
|
41
|
-
//printf("First initialization with julia_home_dir=%s\n",julia_home_dir);
|
42
|
-
// printf("copy stacks ");
|
43
|
-
// #ifdef COPY_STACKS
|
44
|
-
// printf("defined \n");
|
45
|
-
// #else
|
46
|
-
// printf("undefined \n");
|
47
|
-
// #endif
|
48
|
-
// printf("JL_SET_STACK_BASE ");
|
49
|
-
// #ifdef JL_SET_STACK_BASE
|
50
|
-
// printf("defined \n");
|
51
|
-
// #else
|
52
|
-
// printf("undefined \n");
|
53
|
-
// #endif
|
54
|
-
//#ifdef WITH_JULIA_RELEASE
|
55
|
-
// if(strcmp(julia_home_dir,"")==0) {
|
56
|
-
// jl_init(); //(NULL);
|
57
|
-
// //JL_SET_STACK_BASE;
|
58
|
-
// } else {
|
59
|
-
jl_init(); //(julia_home_dir);
|
60
|
-
//julia_init(JL_IMAGE_JULIA_HOME);
|
61
|
-
// //JL_SET_STACK_BASE;
|
62
|
-
// }
|
63
|
-
//#else
|
64
|
-
// jlapi_init(julia_home_dir,mode);
|
65
|
-
//#endif
|
66
|
-
|
32
|
+
jl_init();
|
67
33
|
return Qtrue;
|
68
34
|
}
|
69
35
|
|
@@ -535,7 +501,7 @@ Init_jl4rb()
|
|
535
501
|
|
536
502
|
mJulia = rb_define_module("Julia");
|
537
503
|
|
538
|
-
rb_define_module_function(mJulia, "initJL", Julia_init,
|
504
|
+
rb_define_module_function(mJulia, "initJL", Julia_init, 0);
|
539
505
|
|
540
506
|
rb_define_module_function(mJulia, "exitJL", Julia_exit, 1);
|
541
507
|
|
data/jl4rb.gemspec
CHANGED
data/lib/jl4rb/jl2rb_init.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
module Julia
|
2
2
|
|
3
|
-
def Julia.init
|
3
|
+
def Julia.init
|
4
4
|
unless Julia.alive?
|
5
|
-
|
6
|
-
args={:img=>ENV["JULIA_IMG_DIR"]}.merge(args) if ENV["JULIA_IMG_DIR"]
|
7
|
-
#p [:julia_init,args,ENV]
|
8
|
-
@@initJL=Julia.initJL([args[:img]])
|
5
|
+
@@initJL=Julia.initJL
|
9
6
|
end
|
10
7
|
end
|
11
8
|
|