Code:
func = tvm.build(s, [A, W, B], target, target_host=target_host)
# save compiled module
temp = util.tempdir()
path_lib = temp.relpath("deploy_lib.so")
func.export_library(path_lib)
Error:
Traceback (most recent call last):
File “layerize_test_new.py”, line 327, in
verify_workloads(tvm.cl(), 1, tvm.target.intel_graphics(), target_host)
File “layerize_test_new.py”, line 309, in verify_workloads
target_host=target_host, remote=remote)
File “layerize_test_new.py”, line 160, in verify_conv2d_nchw
func.export_library(path_lib)
File “/home/aws_cam/workplace/tvm/python/tvm/module.py”, line 128, in export_library
fcompile(file_name, files, **kwargs)
File “/home/aws_cam/workplace/tvm/python/tvm/contrib/cc.py”, line 33, in create_shared
_linux_shared(output, objects, options, cc)
File “/home/aws_cam/workplace/tvm/python/tvm/contrib/cc.py”, line 60, in _linux_shared
raise RuntimeError(msg)
RuntimeError: Compilation error:
/usr/bin/ld: /tmp/tmpuc9l75ul/lib.o: relocation R_X86_64_32S against `.bss’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Question: where is lib.o built from? Trying to add -fPIC to the compilation