set LLVMPY_DYNLINK=1, if you want to link _core.so dynamically to libLLVM.so
This commit is contained in:
parent
40b9273e2d
commit
dd59821ac5
1 changed files with 25 additions and 20 deletions
7
setup.py
7
setup.py
|
|
@ -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,6 +88,10 @@ print('LLVM version = %d.%d' % llvm_version)
|
||||||
|
|
||||||
auto_intrinsic_gen(incdir)
|
auto_intrinsic_gen(incdir)
|
||||||
|
|
||||||
|
if dynlink:
|
||||||
|
libs_core = ['LLVM-%d.%d' % llvm_version]
|
||||||
|
objs_core = []
|
||||||
|
else:
|
||||||
if llvm_version <= (3, 1): # select between PTX & NVPTX
|
if llvm_version <= (3, 1): # select between PTX & NVPTX
|
||||||
print('Using PTX')
|
print('Using PTX')
|
||||||
ptx_components = ['ptx',
|
ptx_components = ['ptx',
|
||||||
|
|
@ -100,7 +106,6 @@ else:
|
||||||
'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',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue