<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=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</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="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">the hdf5 project uses a custom command to generate a C file from a previously compiled exe.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">it looks like this<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">#-----------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"># Setup the H5Detect utility which generates H5Tinit with platform<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"># specific type checks inside<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">#-----------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c)<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">IF (MSVC)<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"> TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib")<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">ENDIF (MSVC)<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"><o:p> </o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">SET (CMD $<TARGET_FILE:H5detect>)<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">ADD_CUSTOM_COMMAND (<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"> OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"> COMMAND ${CMD}<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"> ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt"> DEPENDS H5detect<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:36.0pt">)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">When I build the project from completely clean using a ctest script to create a dashboard, the H5Detect is correctly built, and generates the H5Tinit.c file, but – the first time – the file generated looks like this ...<o:p></o:p></p>
<p class="MsoPlainText"><o:p></o:p></p>
<p class="MsoPlainText"><img width="535" height="57" id="Picture_x0020_1" src="cid:image001.png@01CC5367.70E674B0"><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">you can see that each eol OD/OA has been replaced by OD/OD/OA.<o:p></o:p></p>
<p class="MsoPlainText">this causes the compiler (using NMake Makefiles) to flag an error saying that
<o:p></o:p></p>
<p class="MsoPlainText" style="text-indent:36.0pt">error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format<o:p></o:p></p>
<p class="MsoPlainText" style="text-indent:36.0pt"><o:p> </o:p></p>
<p class="MsoPlainText">If I delete the H5Tinit.c file and rerun nmake from the command line, the H5Tinit.c file is regenerated and comes out correctly<o:p></o:p></p>
<p class="MsoPlainText"><img width="538" height="41" id="Picture_x0020_2" src="cid:image002.png@01CC5368.020A37B0"><o:p></o:p></p>
<p class="MsoPlainText">with a single OD/OA sequence and compiles fine without errors<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I’m not sure what’s going on. I can verify (verbose makefiles) that the command being executed to generated is the same however the job is run<o:p></o:p></p>
<p class="MsoPlainText"><span style="color:#C00000"> cd D:\Nightly\hdf5-Debug-Static\src<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="color:#C00000"> "C:/Program Files (x86)/cmake-2.8.4-win32-x86/bin/ctest.exe" --launch --target-name hdf5 --build-dir D:\Nightly\hdf5-Debug-Static\src --output ..\H5Tinit.c -- ..\bin\H5detect.exe > D:/Nightly/hdf5-Debug-Static/H5Tinit.c<o:p></o:p></span></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I don’t understand why the generated file comes out different. Is it a DOS or a CMAKE issue?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Does anyone have an explanation or suggestion of how to solve it?
<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">[adding #pragma warning( disable : 4335 ) would be one fix, but I can’t do this on the command line, what I really want to know is why there’s an extra OD byte when run from ctest initially – using cmake 2.8.4)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">thanks<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">JB<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-- <o:p></o:p></p>
<p class="MsoPlainText">John Biddiscombe, email:biddisco @ cscs.ch<o:p></o:p></p>
<p class="MsoPlainText">http://www.cscs.ch/<o:p></o:p></p>
<p class="MsoPlainText">CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07<o:p></o:p></p>
<p class="MsoPlainText">Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
</body>
</html>