multiarray 0.11.0 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/packagetask'
6
6
  require 'rbconfig'
7
7
 
8
8
  PKG_NAME = 'multiarray'
9
- PKG_VERSION = '0.11.0'
9
+ PKG_VERSION = '0.11.2'
10
10
  RB_FILES = FileList[ 'lib/**/*.rb' ]
11
11
  TC_FILES = FileList[ 'test/tc_*.rb' ]
12
12
  TS_FILES = FileList[ 'test/ts_*.rb' ]
@@ -19,13 +19,18 @@ module Hornetseye
19
19
 
20
20
  class GCCContext
21
21
 
22
- LDSHARED = Config::CONFIG[ 'LDSHARED' ] # c:\mingw\bin\gcc
23
- STRIP = Config::CONFIG[ 'STRIP' ]
24
- RUBYHDRDIR = Config::CONFIG.member?( 'rubyhdrdir' ) ?
25
- "-I#{Config::CONFIG['rubyhdrdir']} " +
26
- "-I#{Config::CONFIG['rubyhdrdir']}/#{Config::CONFIG['arch']}" :
27
- "-I#{Config::CONFIG['archdir']}"
28
- LIBRUBYARG = Config::CONFIG[ 'LIBRUBYARG' ]
22
+ CFG = RbConfig::CONFIG
23
+ if CFG[ 'rubyhdrdir' ]
24
+ CFLAGS = "-DNDEBUG #{CFG[ 'CFLAGS' ]} " +
25
+ "-I#{CFG['rubyhdrdir']} -I#{CFG['rubyhdrdir']}/#{CFG['arch']}"
26
+ else
27
+ CFLAGS = "-DNDEBUG #{CFG[ 'CFLAGS' ]} " +
28
+ "-I#{CFG['archdir']}"
29
+ end
30
+ LIBRUBYARG = "-L#{CFG[ 'libdir' ]} #{CFG[ 'LIBRUBYARG' ]} #{CFG[ 'LDFLAGS' ]} "
31
+ "#{CFG[ 'SOLIBS' ]} #{CFG[ 'DLDLIBS' ]}"
32
+ LDSHARED = CFG[ 'LDSHARED' ]
33
+ DLEXT = CFG[ 'DLEXT' ]
29
34
  DIRNAME = "#{Dir.tmpdir}/hornetseye-ruby#{RUBY_VERSION}-" +
30
35
  "#{ENV[ 'USER' ] || ENV[ 'USERNAME' ]}"
31
36
  LOCKFILE = "#{DIRNAME}/lock"
@@ -38,8 +43,8 @@ module Hornetseye
38
43
  @@lib_name = 'hornetseye_aaaaaaaa'
39
44
 
40
45
  if ENV[ 'HORNETSEYE_PRELOAD_CACHE' ]
41
- while File.exist? "#{DIRNAME}/#{@@lib_name}.so"
42
- require "#{DIRNAME}/#{@@lib_name}.so"
46
+ while File.exist? "#{DIRNAME}/#{@@lib_name}.#{DLEXT}"
47
+ require "#{DIRNAME}/#{@@lib_name}"
43
48
  @@lib_name = @@lib_name.succ
44
49
  end
45
50
  end
@@ -128,14 +133,11 @@ EOS
128
133
  File.open "#{DIRNAME}/#{@lib_name}.c", 'w', 0600 do |f|
129
134
  f << template
130
135
  end
131
- gcc = "#{LDSHARED} -fPIC #{RUBYHDRDIR} -O " +
132
- "-o #{DIRNAME}/#{@lib_name}.so " +
136
+ gcc = "#{LDSHARED} #{CFLAGS} -o #{DIRNAME}/#{@lib_name}.#{DLEXT} " +
133
137
  "#{DIRNAME}/#{@lib_name}.c #{LIBRUBYARG}"
134
- strip = "#{STRIP} #{DIRNAME}/#{@lib_name}.so"
135
138
  # puts template
136
139
  raise "Error compiling #{DIRNAME}/#{@lib_name}.c" unless system gcc
137
- raise "Error stripping #{DIRNAME}/#{@lib_name}.so" unless system strip
138
- require "#{DIRNAME}/#{@lib_name}.so"
140
+ require "#{DIRNAME}/#{@lib_name}"
139
141
  end
140
142
 
141
143
  def <<( str )
@@ -47,7 +47,7 @@ module Hornetseye
47
47
  'double'
48
48
  else
49
49
  if @typecode < Pointer_
50
- 'void *'
50
+ 'unsigned char *'
51
51
  elsif @typecode < INDEX_
52
52
  'int'
53
53
  else
@@ -30,9 +30,9 @@ module Hornetseye
30
30
  end
31
31
 
32
32
  def memory
33
- if array_type.storage_size != @stride.get * typecode.storage_size
34
- raise 'Memory is not contiguous'
35
- end
33
+ #if array_type.storage_size != @stride.get * typecode.storage_size
34
+ # raise 'Memory is not contiguous'
35
+ #end
36
36
  @p.memory
37
37
  end
38
38
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 0
9
- version: 0.11.0
8
+ - 2
9
+ version: 0.11.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jan Wedekind
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-18 00:00:00 +01:00
17
+ date: 2010-10-27 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency