From bcc467b2b53a16713eec4517376fcd9d16d666e0 Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Wed, 2 Jan 2013 12:20:10 -0600 Subject: [PATCH] Add auto detect PTX/NVPTX support and disable them in the C-extension. --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 1fba3db..94c9f95 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,8 @@ print('LLVM version = %d.%d' % llvm_version) auto_intrinsic_gen(incdir) +macros = [('__STDC_CONSTANT_MACROS', None), + ('__STDC_LIMIT_MACROS', None)] if dynlink: libs_core = ['LLVM-%d.%d' % llvm_version] objs_core = [] @@ -89,6 +91,7 @@ else: extra_components.extend(ptx_components) else: print("No CUDA support") + macros.append(('LLVM_DISABLE_PTX', None)) libs_core, objs_core = get_libs_and_objs( ['core', 'analysis', 'scalaropts', 'executionengine', @@ -97,12 +100,10 @@ else: 'asmparser', 'linker', 'support', 'vectorize'] + extra_components) -macros = [('__STDC_CONSTANT_MACROS', None), - ('__STDC_LIMIT_MACROS', None)] if sys.platform == 'win32': # If no PTX lib got added, disable PTX in the build if 'LLVMPTXCodeGen' not in libs_core: - macros.append(('LLVM_DISABLE_PTX', None)), + macros.append(('LLVM_DISABLE_PTX', None)) else: macros.append(('_GNU_SOURCE', None))