forked from 0xbitcoin/0xbitcoin-gpuminer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbinding.gyp
94 lines (79 loc) · 2.56 KB
/
binding.gyp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
'conditions': [
[ 'OS=="win"', {'variables': {'obj': 'obj'}},
{'variables': {'obj': 'o'}}]],
"targets": [
{
"target_name": "hybridminer",
"sources": [
"cpp/hybridminer/addon.cc",
"cpp/hybridminer/hybridminer.cpp",
"cpp/hybridminer/cpusolver.cpp",
"cpp/hybridminer/cudasolver.cu",
"cpp/hybridminer/sha3.c"
],
'cflags_cc+': [ '-march=native', '-O3', '-std=c++11' ],
"include_dirs": ["<!(node -e \"require('nan')\")"],
'rules': [
{
'extension': 'cu',
'inputs': ['<(RULE_INPUT_PATH)'],
'outputs':[ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).o'],
'conditions': [
[ 'OS=="win"',
{'rule_name': 'cuda on windows',
'message': "compile cuda file on windows",
'process_outputs_as_sources': 0,
'action': ['nvcc --std=c++11 -c <(_inputs) -o <(_outputs)'],
},
{'rule_name': 'cuda on linux',
'message': "compile cuda file on linux",
'process_outputs_as_sources': 1,
'action': ['nvcc','-std=c++11','-Xcompiler','-fpic','-c',
'<@(_inputs)','-o','<@(_outputs)'],
}
]]}],
'conditions': [
[ 'OS=="mac"', {
'libraries': ['-framework CUDA'],
'include_dirs': ['/usr/local/include'],
'library_dirs': ['/usr/local/lib'],
}],
[ 'OS=="linux"', {
'libraries': ['-lcuda', '-lcudart'],
'include_dirs': ['/usr/local/include'],
'library_dirs': ['/usr/local/lib', '/usr/local/cuda/lib64', './cuda']
}],
[ 'OS=="win"', {
'conditions': [
['target_arch=="x64"',
{
'variables': { 'arch': 'x64' }
}, {
'variables': { 'arch': 'Win32' }
}
],
],
'variables': {
'cuda_root%': '$(CUDA_PATH)'
},
'libraries': [
'-lcuda',
'-lcudart',
'<(module_root_dir)/build/Release/obj/hybridminer/cudasolver.o'
],
'library_dirs': [
'<(cuda_root)/lib/<(arch)',
'/usr/local/lib',
'/usr/local/cuda/lib64'
],
"include_dirs": [
"<(cuda_root)/include",
"/usr/local/cuda/include",
"/usr/local/include"
]
}]
]
}
]
}