snow-math 1.3.0pre0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/extconf.rb +50 -8
- data/ext/snow-math/snow-math.c +474 -352
- data/lib/snow-math/mat3.rb +0 -1
- data/lib/snow-math/mat4.rb +0 -1
- data/lib/snow-math/quat.rb +1 -1
- data/lib/snow-math.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d529480a1cb3aefeacfab64857c085ab0f05b80
|
4
|
+
data.tar.gz: 9e7974ca6e60e232cc50c671f9c48d0c4f734169
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30885e517d2e2cbc49203ce3fd49aa751c8af241e4fe8a448d40584482d74b4217c406b9b93e84ca21b98387f6d54994879bbf9516c66eb43f5db542f2d31ffe
|
7
|
+
data.tar.gz: dee730d74dd0a7a046d4f98359867a806db9086cba0d7b25d38c13e16d32e30068976e03b63d963e86bef5eae14763ee76d68ddf76341f68773a5f0a5e171f3c
|
data/ext/extconf.rb
CHANGED
@@ -6,21 +6,63 @@
|
|
6
6
|
require 'mkmf'
|
7
7
|
|
8
8
|
# Compile as C99
|
9
|
-
$CFLAGS += " -std=c99"
|
9
|
+
$CFLAGS += " -std=c99 -march=native"
|
10
10
|
|
11
|
-
|
11
|
+
OptKVPair = Struct.new(:key, :value)
|
12
|
+
|
13
|
+
option_mappings = {
|
14
|
+
'-F' => OptKVPair[:build_float, true],
|
15
|
+
'--use-float' => OptKVPair[:build_float, true],
|
16
|
+
'-NF' => OptKVPair[:build_float, false],
|
17
|
+
'--use-double' => OptKVPair[:build_float, false],
|
18
|
+
|
19
|
+
'-FM' => OptKVPair[:build_fast_math, true],
|
20
|
+
'--use-fast-math' => OptKVPair[:build_fast_math, true],
|
21
|
+
'-NFM' => OptKVPair[:build_fast_math, false],
|
22
|
+
'--no-fast-math' => OptKVPair[:build_fast_math, false],
|
23
|
+
|
24
|
+
'-D' => OptKVPair[:build_debug, true],
|
25
|
+
'--debug' => OptKVPair[:build_debug, true],
|
26
|
+
'-ND' => OptKVPair[:build_debug, false],
|
27
|
+
'--release' => OptKVPair[:build_debug, false]
|
28
|
+
}
|
29
|
+
|
30
|
+
options = {
|
31
|
+
:build_float => false,
|
32
|
+
:build_fast_math => false,
|
33
|
+
:build_debug => false
|
34
|
+
}
|
35
|
+
|
36
|
+
ARGV.each {
|
37
|
+
|arg|
|
38
|
+
pair = option_mappings[arg]
|
39
|
+
if pair
|
40
|
+
options[pair.key] = pair.value
|
41
|
+
else
|
42
|
+
$stderr.puts "Unrecognized install option: #{arg}"
|
43
|
+
end
|
44
|
+
}
|
45
|
+
|
46
|
+
if options[:build_debug]
|
12
47
|
$CFLAGS += " -g"
|
13
|
-
puts "Building extension
|
48
|
+
$stdout.puts "Building extension in debug mode"
|
49
|
+
else
|
50
|
+
# mfpmath is ignored on clang, FYI
|
51
|
+
$CFLAGS += " -O3 -fno-strict-aliasing -mfpmath=sse"
|
52
|
+
$stdout.puts "Building extension in release mode"
|
53
|
+
end
|
54
|
+
|
55
|
+
if options[:build_fast_math] && !options[:build_debug]
|
56
|
+
$stdout.puts "Building with -ffast-math enabled"
|
14
57
|
else
|
15
|
-
$CFLAGS += " -
|
16
|
-
puts "Building extension source in release mode"
|
58
|
+
$CFLAGS += " -fno-fast-math"
|
17
59
|
end
|
18
60
|
|
19
|
-
if
|
61
|
+
if options[:build_float]
|
20
62
|
$CFLAGS += " -DUSE_FLOAT"
|
21
|
-
puts "Using float as base type"
|
63
|
+
$stdout.puts "Using float as base type"
|
22
64
|
else
|
23
|
-
puts "Using double as base type"
|
65
|
+
$stdout.puts "Using double as base type"
|
24
66
|
end
|
25
67
|
|
26
68
|
have_library('m', 'cos')
|