Hi I face a error while runing the tutorials/autotvm/tune_simple_template.py script. as following:
No: 1 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError(‘Except caught from RPC call: TVMCall CFunc Error:\nTraceback (most recent call last):\n File “/home/dladmin/Repositoir/Pub/tvm/python/tvm/_ffi/_ctypes/function.py”, line 56, in cfun\n rv = local_pyfunc(*pyargs)\n File “/home/dladmin/Repositoir/Pub/tvm/python/tvm/rpc/server.py”, line 51, in load_module\n m = _load_module(path)\n File “/home/dladmin/Repositoir/Pub/tvm/python/tvm/module.py”, line 223, in load\n _cc.create_shared(path + “.so”, files)\n File “/home/dladmin/Repositoir/Pub/tvm/python/tvm/contrib/cc.py”, line 33, in create_shared\n _linux_shared(output, objects, options, cc)\n File “/home/dladmin/Repositoir/Pub/tvm/python/tvm/contrib/cc.py”, line 59, in _linux_shared\n raise RuntimeError(msg)\nRuntimeError: Compilation error:\n/usr/bin/ld: /tmp/tmpah3cflh5/lib.o: relocation R_X86_64_32S against `.rodata.cst16’ can not be used when making a shared object; recompile with -fPIC\n/tmp/tmpah3cflh5/lib.o: error adding symbols: Bad value\ncollect2: error: ld returned 1 exit status\n\n’,),), error_no=4, all_cost=0.3922765254974365, timestamp=1540458625.9476259) [(‘tile_y’, [64, 8]), (‘tile_x’, [32, 16])],None,43
My tvm is builld from source and with llvm manually set to llvm-7.0 (ubuntu 16.04), and also change the gcc to 7.3.0 with
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7 g+±7
it seems that /usr/bin/ld complains about relocation R_X86_64_32S against .rodata.cst16 and suggest add the -fPIC flag.
is it because g++ not compatible with object file created by llvm? or any other ideas about this situation?
(from https://github.com/dmlc/tvm/issues/1985 thread)