CMake, CUDA Separable Compilation Error "relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC"
When using CUDA separable compilation in newer versions of CUDA (> 5.0) I was getting the following error. Note that I am using CMake to generate my Makefiles
Most resources I found told to add the “–compiler-options -fPIC” option to NVCC
But this did not fix the problem, it turns out that in CMake versions prior to 3.2 there is a bug in the way that separable compilation is handled with CUDA. Unfortunately the version of CentOS that we run on our cluster does not had a newer version of CMake available in the default repository. My crude fix was to compile CMake manually and install it to ~/bin/ in my home directory.
Wanted to document it here for future reference, it was not immediately apparent that it was a CMake issue.