ShaoqingRen / SPP_net

SPP_net : Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
364 stars 237 forks source link

/usr/bin/ld: ../tron.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC #58

Open PapaMadeleine2022 opened 6 years ago

PapaMadeleine2022 commented 6 years ago

hello, when I run make under the dir external/liblinear-1.93_multicore/matlab, I get this error: make -C .. tron.o make[1]: Entering directory 'xxx/SPP_net/external/liblinear-1.93_multicore' g++ -c -o tron.o tron.cpp make[1]: Leaving directory 'xxx/SPP_net/external/liblinear-1.93_multicore' make -C .. linear.o make[1]: Entering directory 'xxx/SPP_net/external/liblinear-1.93_multicore' g++ -c -o linear.o linear.cpp make[1]: Leaving directory 'xxx/SPP_net/external/liblinear-1.93_multicore' g++-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c linear_model_matlab.cpp linear_model_matlab.cpp: In function ‘const char* models_to_matlab_structure(mxArray**, std::vector<model*>&)’: linear_model_matlab.cpp:118:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] linear_model_matlab.cpp: In function ‘const char* matlab_matrix_to_models(std::vector<model*>&, const mxArray*)’: linear_model_matlab.cpp:205:48: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion] make -C ../blas OPTFLAGS='-Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I..' CC='gcc-4.7'; make[1]: Entering directory '/home/ztgong/work/image/detection-recognition/SPPNet/SPP_net/external/liblinear-1.93_multicore/blas' gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c dnrm2.c gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c daxpy.c gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c ddot.c gcc-4.7 -Wall -Wconversion -O3 -fPIC -I/usr/local/MATLAB/R2014b/extern/include -I.. -c dscal.c ar rcv blas.a dnrm2.o daxpy.o ddot.o dscal.o a - dnrm2.o a - daxpy.o a - ddot.o a - dscal.o ranlib blas.a make[1]: Leaving directory '/home/ztgong/work/image/detection-recognition/SPPNet/SPP_net/external/liblinear-1.93_multicore/blas' /usr/local/MATLAB/R2014b/bin/mex train.cpp ../tron.o ../linear.o linear_model_matlab.o ../blas/blas.a Building with 'g++'. /usr/bin/ld: ../tron.o: relocation R_X86_64_32S against.text' can not be used when making a shared object; recompile with -fPIC ../tron.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status

Makefile:33: recipe for target 'train.mexa64' failed make: *** [train.mexa64] Error 255 ` how to fix it? can you give some advises?