|
7 | 7 | import torch |
8 | 8 | from torch.utils.cpp_extension import CppExtension, CUDAExtension, CUDA_HOME |
9 | 9 |
|
| 10 | + |
| 11 | +# Windows users: Edit both of these to contain your Visual Studio include path, i.e. |
| 12 | +# cxx_extra_compile_args = ['-I{VISUAL_STUDIO_DIR}\\include'] |
| 13 | +# nvcc_extra_compile_args = ['-arch=sm_35', '--expt-relaxed-constexpr', '-I{VISUAL_STUDIO_DIR}\\include'] |
10 | 14 | cxx_extra_compile_args = [] |
11 | 15 | nvcc_extra_compile_args = ['-arch=sm_35', '--expt-relaxed-constexpr'] |
| 16 | + |
| 17 | +# Windows users: Edit both of these to contain your Visual Studio library path, i.e. |
| 18 | +# cxx_extra_link_args = ['/LIBPATH:{VISUAL_STUDIO_DIR}\\lib\\{x86|x64}'] |
| 19 | +# nvcc_extra_link_args = ['/LIBPATH:{VISUAL_STUDIO_DIR}\\lib\\{x86|x64}'] |
| 20 | +cxx_extra_link_args = [] |
| 21 | +nvcc_extra_link_args = [] |
| 22 | + |
12 | 23 | if platform.system() != 'Windows': |
13 | 24 | cxx_extra_compile_args += ['-Wno-unused-variable'] |
14 | 25 | TORCH_MAJOR = int(torch.__version__.split('.')[0]) |
|
23 | 34 | ext_modules += [ |
24 | 35 | CppExtension( |
25 | 36 | f'torch_scatter.{ext}_cpu', [f'cpu/{ext}.cpp'], |
26 | | - extra_compile_args=cxx_extra_compile_args) for ext in exts |
| 37 | + extra_compile_args=cxx_extra_compile_args, |
| 38 | + extra_link_args=cxx_extra_link_args) for ext in exts |
27 | 39 | ] |
28 | 40 |
|
29 | 41 | if CUDA_HOME is not None and '--cpu' not in argv: |
|
35 | 47 | extra_compile_args={ |
36 | 48 | 'cxx': cxx_extra_compile_args, |
37 | 49 | 'nvcc': nvcc_extra_compile_args, |
38 | | - }) for ext in exts |
| 50 | + }, |
| 51 | + extra_link_args=nvcc_extra_link_args) for ext in exts |
39 | 52 | ] |
40 | 53 |
|
41 | 54 | __version__ = '1.5.0' |
|
0 commit comments