在Travis-CI中编译遇到serving_client.so链接错误
Created by: barrierye
相关环境:
- ubuntu 14.04.5
- cmake 3.9.2
- gcc 4.8.4
- python 2.7.17
- go 1.14
报错信息如下:
$ make
[ 6%] Built target extern_boost
[ 12%] Built target extern_snappy
[ 18%] Built target extern_leveldb
[ 19%] Built target boost
[ 25%] Built target extern_zlib
[ 31%] Built target extern_gflags
[ 37%] Built target extern_glog
[ 43%] Built target extern_protobuf
[ 49%] Built target extern_brpc
[ 56%] Built target extern_pybind
[ 56%] Built target general_model_config_py_proto_init
Copy generated general_model_config proto file into directory paddle_serving_client/proto.
[ 57%] Built target general_model_config_py_proto
[ 64%] Built target configure
[ 64%] Built target sdk_configure_py_proto_init
[ 65%] Built target test_configure
Copy generated python proto into directory paddle_serving_client/proto.
[ 65%] Built target sdk_configure_py_proto
[ 69%] Built target pdcodegen
[ 95%] Built target sdk-cpp
[ 97%] Built target utils
[ 98%] Linking CXX shared module serving_client.so
/usr/bin/ld: ../../../reliance/python/lib/libpython2.7.a(getbuildinfo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
../../../reliance/python/lib/libpython2.7.a(getbuildinfo.o): error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [core/general-client/serving_client.so] Error 1
make[1]: *** [core/general-client/CMakeFiles/serving_client.dir/all] Error 2
make: *** [all] Error 2
The command "make" exited with 2.
似乎要加上-fPIC
重新编译,但之前没有遇到过这种情况。