<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 6, 2015 at 8:54 AM, Irwin Zaid <span dir="ltr"><<a href="mailto:irwin.zaid@physics.ox.ac.uk" target="_blank">irwin.zaid@physics.ox.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Okay, an update on this.<br>
<br>2) This is trickier and, unfortunately, still not working. We are already adding -fPIC to CMAKE_CXX_FLAGS, should that not be enough? I also tried adding it to both CMAKE_CXX_FLAGS_DEBUG and CMAKE_CXX_FLAGS_RELEASE, with no effect.<br>
<br>
Looking into FindCUDA.CMake at CUDA_LINK_SEPARABLE_<u></u>COMPILATION_OBJECTS, I find code very similar to what you are describing. Are you saying that in addition to what is below, we need to add what you proposed? This is what I see.<br>
<br>
--<br>
<br></blockquote><div><br></div><div>It can be put here (before this foreach).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
foreach(config ${CUDA_configuration_types})<br>
string(TOUPPER ${config} config_upper)<br>
# Add config specific flags<br>
foreach(f ${CUDA_NVCC_FLAGS_${config_<u></u>upper}})<br>
list(APPEND config_specific_flags $<$<CONFIG:${config}>:${f}>)<br>
endforeach()<br>
set(important_host_flags)<br>
_cuda_get_important_host_<u></u>flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_<u></u>FLAGS_${config_upper}})<br>
foreach(f ${important_host_flags})<br>
list(APPEND flags $<$<CONFIG:${config}>:-<u></u>Xcompiler> $<$<CONFIG:${config}>:${f}>)<br>
endforeach()<br>
endforeach()<br>
<br></blockquote><div><br></div><div>Or it can be put here (or after the foreach).</div><div><br></div><div>I'm concerned that the flag didn't show up after adding it to the _DEBUG or _RELEASE variants.  If you could add a few message commands around that might help see what is going on.  The flag needs to be propagated.</div><div><br></div><div>You could sprinkle a few commands like this:</div><div>message("going to run COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file}</div><div>        ${flags}")</div><div><br></div><div><br></div></div></div></div>