set LLVMPY_DYNLINK=1, if you want to link _core.so dynamically to libLLVM.so

This commit is contained in:
Ilan Schnell 2012-08-19 00:42:03 -05:00
commit dd59821ac5

View file

@ -37,6 +37,8 @@ from distutils.core import setup, Extension
LLVM_PY_VERSION = '0.8.2' LLVM_PY_VERSION = '0.8.2'
llvm_config = os.environ.get('LLVM_CONFIG_PATH', 'llvm-config') llvm_config = os.environ.get('LLVM_CONFIG_PATH', 'llvm-config')
# set LLVMPY_DYNLINK=1, if you want to link _core.so dynamically to libLLVM.so
dynlink = int(os.environ.get('LLVMPY_DYNLINK', 0))
def run_llvm_config(args): def run_llvm_config(args):
cmd = llvm_config + ' ' + ' '.join(args) cmd = llvm_config + ' ' + ' '.join(args)
@ -86,22 +88,25 @@ print('LLVM version = %d.%d' % llvm_version)
auto_intrinsic_gen(incdir) auto_intrinsic_gen(incdir)
if llvm_version <= (3, 1): # select between PTX & NVPTX if dynlink:
libs_core = ['LLVM-%d.%d' % llvm_version]
objs_core = []
else:
if llvm_version <= (3, 1): # select between PTX & NVPTX
print('Using PTX') print('Using PTX')
ptx_components = ['ptx', ptx_components = ['ptx',
'ptxasmprinter', 'ptxasmprinter',
'ptxcodegen', 'ptxcodegen',
'ptxdesc', 'ptxdesc',
'ptxinfo'] 'ptxinfo']
else: else:
print('Using NVPTX') print('Using NVPTX')
ptx_components = ['nvptx', ptx_components = ['nvptx',
'nvptxasmprinter', 'nvptxasmprinter',
'nvptxcodegen', 'nvptxcodegen',
'nvptxdesc', 'nvptxdesc',
'nvptxinfo'] 'nvptxinfo']
libs_core, objs_core = get_libs_and_objs(
libs_core, objs_core = get_libs_and_objs(
['core', 'analysis', 'scalaropts', 'executionengine', ['core', 'analysis', 'scalaropts', 'executionengine',
'jit', 'native', 'interpreter', 'bitreader', 'bitwriter', 'jit', 'native', 'interpreter', 'bitreader', 'bitwriter',
'instrumentation', 'ipa', 'ipo', 'transformutils', 'instrumentation', 'ipa', 'ipo', 'transformutils',