forked from 0xbitcoin/0xbitcoin-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
86 lines (80 loc) · 1.86 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
{
'conditions': [
[ 'OS=="win"', {'variables': {'obj': 'obj'}},
{'variables': {'obj': 'o'}}]],
"targets": [
{
"target_name": "gpuminer",
"sources": [
"cpp/cuda_sha256d.cu",
"cpp/gpumineralpha.cc",
],
'rules': [{
'extension': 'cu',
'inputs': ['<(RULE_INPUT_PATH)'],
'outputs':[ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).o'],
'rule_name': 'cuda on linux',
'message': "compile cuda file on linux",
'process_outputs_as_sources': 1,
'action': [
'nvcc',
'-ccbin', 'gcc',
'-Xcompiler',
'-fpic',
'-c',
'-o',
'<@(_outputs)',
'<@(_inputs)'
],
}],
'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']
}],
[ 'OS=="win"', {
'conditions': [
['target_arch=="x64"',
{
'variables': { 'arch': 'x64' }
}, {
'variables': { 'arch': 'Win32' }
}
],
],
'variables': {
'cuda_root%': '$(CUDA_PATH)'
},
'libraries': [
'-l<(cuda_root)/lib64/libcuda.lib',
'-l<(cuda_root)/lib64/libcudart.lib',
],
"include_dirs": [
"<(cuda_root)/include",
],
}, {
"include_dirs": [
"/usr/local/cuda/include"
],
}]
]
},
{
"target_name": "cpuminer",
"sources": [
"cpp/cpuminer/addon.cc",
"cpp/cpuminer/cpuminer.cpp",
"cpp/cpuminer/solver.cpp",
"cpp/cpuminer/sha3.c"
],
'cflags_cc+': [ '-march=native', '-O3', '-std=c++17' ],
"include_dirs": ["<!(node -e \"require('nan')\")"]
}
]
}