Skip to content

Commit

Permalink
Add compile option to build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kmatsuura committed Jul 3, 2017
1 parent fdbce55 commit 06a803d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cupy_setup_build.py
Expand Up @@ -213,10 +213,10 @@ def make_extensions(options, compiler, use_cython):

if compiler.compiler_type == 'unix' and sys.platform != 'darwin':
# clang does not have this option.
args = settings.setdefault('extra_link_args', [])
args = settings.setdefault('extra_compile_args', [])
args.append('-fopenmp')
elif compiler.compiler_type == 'msvc':
args = settings.setdefault('extra_link_args', [])
args = settings.setdefault('extra_compile_args', [])
args.append('/openmp')

# This is a workaround for Anaconda.
Expand Down Expand Up @@ -278,7 +278,7 @@ def make_extensions(options, compiler, use_cython):
s['libraries'] = module['libraries']

if module['name'] == 'cusolver':
args = s.setdefault('extra_link_args', [])
args = s.setdefault('extra_compile_args', [])
# openmp is required for cusolver
if compiler.compiler_type == 'unix' and sys.platform != 'darwin':
# In mac environment, openmp is not required.
Expand Down Expand Up @@ -473,6 +473,7 @@ def _compile_cu(self, sources, output_dir=None, macros=None,
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
cuda_version = build.get_cuda_version()
postargs = _nvcc_gencode_options(cuda_version) + ['-O2']
postargs += ['-Xcompiler', '/MD']
print('NVCC options:', postargs)

for obj in objects:
Expand Down

0 comments on commit 06a803d

Please sign in to comment.