Use relative path to find librdc_bootstrap.so

The python script will search list of the installation folders to
find the librdc_bootstrap.so.

Change-Id: I52e444e6d153c318c731c4b2cd0d8e39b0fd31ca
This commit is contained in:
Bill(Shuzhou) Liu
2020-11-30 13:42:59 -05:00
والد b278cd379b
کامیت 4b3dbc4697
@@ -4,9 +4,29 @@ from ctypes import *
from enum import Enum
librdc = "librdc_bootstrap.so"
# The python ctypes wrapper for "librdc_bootstrap.so"
rdc = CDLL(librdc)
# Search librdc_bootstrap.so paths
current_folder = os.path.dirname(os.path.realpath(__file__))
rdc_paths = [ "", # without path
current_folder+"/../lib/", # package installation
current_folder+"/../lib64/", # package installation
current_folder+"/../build/rdc_libs/" # build from source code
]
rdc = None
for r in rdc_paths:
try:
rdc = CDLL(r+librdc)
break
except:
pass
if rdc == None:
print("Unable to load the librdc_bootstrap.so. Set LD_LIBRARY_PATH to the folder containing librdc_bootstrap.so.")
exit(1)
GPU_ID_INVALID = -1
RDC_GROUP_ALL_GPUS = -1000