libcaffe-nv.so.0.16.4 build error

LD -o .build_release/lib/libcaffe-nv.so.0.16.4
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data’ can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/x86_64-linux-gnu/libturbojpeg.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:605: recipe for target ‘.build_release/lib/libcaffe-nv.so.0.16.4’ failed
make: *** [.build_release/lib/libcaffe-nv.so.0.16.4] Error 1

Hi, I’m seeking my mistake. The libturbojpeg.a has some problems…
I already added the -fPIC option, but same error is still exist.
I’m waiting for answers. Thank you.

Hi,

It looks like you try to compile nvCaffe-0.16 on an x86 machine.
Is this correct?

Here is a tutorial for compiling nvCaffe-0.15 on Jetson (similar to nvCaffe-0.16) for your reference:
https://devtalk.nvidia.com/default/topic/1021931/jetson-tx2/nvcaffe-support-on-tx2/post/5200686/#5200686

Thanks.