<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.gmail-p1, li.gmail-p1, div.gmail-p1
        {mso-style-name:gmail-p1;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.gmail-s1
        {mso-style-name:gmail-s1;}
p.m4624768089518785155msolistparagraph, li.m4624768089518785155msolistparagraph, div.m4624768089518785155msolistparagraph
        {mso-style-name:m_4624768089518785155msolistparagraph;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If the comment is wrt 3., the result is the same no matter if I use a space or an equals sign, if I double escape the
 quotes (e.g., use the value as you wrote it in the cmake-gui for CMAKE_CUDA_FLAGS), the value in VS becomes compute_20,"sm_20,compute_20" instead of compute_20,sm_20,compute_20, which is equally illegal and will cause the same error message, also double escaping
 should not be necessary for a subset of flags (Xcompiler works fine without it, even if the default values are pointless).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If the comment is wrt 2., this is the line automatically generated by CMake/VS when not passing in any gencode flags explicitly.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Or am I misunderstanding what you mean?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Fraunhofer-Institut für Graphische Datenverarbeitung IGD<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Tel +49 6151 155-606  |  Fax +49 6151 155-139<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><a href="mailto:johannes.mueller-roemer@igd.fraunhofer.de">johannes.mueller-roemer@igd.fraunhofer.de</a> |
<a href="http://www.igd.fraunhofer.de">www.igd.fraunhofer.de</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Robert Maynard [mailto:robert.maynard@kitware.com]
<br>
<b>Sent:</b> Wednesday, September 6, 2017 15:38<br>
<b>To:</b> Mueller-Roemer, Johannes Sebastian <Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de><br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] CMake 3.9.x Visual Studio CUDA PDB/compiler flags issues<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">As far as <span style="font-size:11.0pt;font-family:"Calibri",sans-serif">gencode goes, your line has errors. With CUDA 8 it should look like:</span><o:p></o:p></p>
<div>
<p class="gmail-p1"><span class="gmail-s1">-gencode arch=compute_20,code=\"sm_20,compute_20\" </span><o:p></o:p></p>
<p class="gmail-p1"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Sep 4, 2017 at 4:06 AM, Mueller-Roemer, Johannes Sebastian <<a href="mailto:Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de" target="_blank">Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">I’m having two issues with debug symbols for CUDA libraries on a project:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="m4624768089518785155msolistparagraph"><span lang="EN-US">1.</span><span lang="EN-US" style="font-size:7.0pt">      
</span><span lang="EN-US">The PDBs are not placed where the linker later expects to find them (haven’t been able to replicate this in a minimal project yet)</span><o:p></o:p></p>
<p class="m4624768089518785155msolistparagraph"><span lang="EN-US">2.</span><span lang="EN-US" style="font-size:7.0pt">      
</span><span lang="EN-US">Trying to circumnavigate this issue by using “/Z7” instead of “/Zi” does not work, Zi is always used (replicable in any project with CUDA)<br>
<br>
Replication steps: Replace -Zi or /Zi in CMAKE_*_FLAGS* (CUDA, CXX, C) by -Z7 or /Z7. Build and see several warnings like “cl : Command line warning D9025: overriding '/Z7' with '/Zi'” in the output window.<br>
And do the flags in the –Xcompiler make sense at all in VS? The CUDA build tools seem to determine these automatically anyways… for example I get the following call in the above scenario:<br>
<br>
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64"  -I"C:\Program Files\NVIDIA
 GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"  -G   --keep-dir x64\Debug -maxrregcount=0  --machine 64 --compile -cudart static -Xcompiler="/EHsc -Z7 -Ob0" -g   -D_WINDOWS -Xcompiler "/EHsc /W3
 /nologo /Od /FS /Zi /RTC1 /MDd /GR" -o A.dir\Debug\a.cu.obj "D:\jsroemer\projects\cuda-pdb-test\a\<a href="http://a.cu" target="_blank">a.cu</a>"</span><o:p></o:p></p>
<p class="m4624768089518785155msolistparagraph"><span lang="EN-US">3.</span><span lang="EN-US" style="font-size:7.0pt">      
</span><span lang="EN-US">Also, -gencode flags do not behave as expected when given in the form -gencode=arch=compute_20,code="sm_20,compute_20", as this causes the VS build system to error out:<br>
<br>
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(216,9): error : Item '..\..\a\<a href="http://a.cu" target="_blank">a.cu</a>' Code Generation value is not in the expected format '[Arch],[Code]'.<br>
<br>
The code generation value in this example is set to compute_20,sm_20,compute_20 by CMake.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Fraunhofer-Institut für Graphische Datenverarbeitung IGD<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Tel
<a href="tel:+49%206151%20155606" target="_blank">+49 6151 155-606</a>  |  Fax <a href="tel:+49%206151%20155139" target="_blank">
+49 6151 155-139</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="mailto:johannes.mueller-roemer@igd.fraunhofer.de" target="_blank">johannes.mueller-roemer@igd.fraunhofer.de</a> |
<a href="http://www.igd.fraunhofer.de" target="_blank">www.igd.fraunhofer.de</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">
http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">
http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">
http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">
http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>