<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div>
<div style="font-family:Calibri,sans-serif; font-size:11pt">Thanks for the explanation. I didn't know that -C is for initial configuration only.<br>
<br>
Command line length is limited on all operating systems (although on Windows it's shorter than most *nix, so problems appear first there). A possible solution to keep the current SimpleITK configuration mechanism would be to use response files (pass command-line
 arguments through file) when running CMake. For this we would need to request this feature in CMake and then update ExternalProject_Add macro to use response file.<br>
<br>
Andras</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">From:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:blowekamp@mail.nih.gov">Bradley Lowekamp</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Sent:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt">ý2015-ý08-ý14 10:33</span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">To:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:lasso@queensu.ca">Andras Lasso</a>;
<a href="mailto:jchris.fillionr@kitware.com">Jean-Christophe Fillion-Robin</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Cc:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:ond@semanchuk.com">Philip Semanchuk</a>;
<a href="mailto:community@itk.org">community@itk.org</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Subject:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt">Re: [ITK] Win64 SimpleITK build error: NMAKE : fatal error U1095 (command line too long)</span><br>
<br>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hello Andas,<br>
<br>
The comment out was a quick suggestion to get it working for his case.<br>
<br>
Here is a commit in next to reduce the arguments passed [1].<br>
<br>
The problem with the "Cache" file is that it's only used for the initial configuration of the sub-project (still correct? It's been a while since I tested). If there is a change to the top level configuration after the initial build then the sub-projects don't
 get the update values. And I don't like having to rebuild SimpleITK from scratch.<br>
<br>
Currently we render the desired cmake variables to both the cache file and to the command line arguments [2].<br>
<br>
SimpleITK's cache generator is better than the CMAKE_CACHE_ARGS because I only need to pass the CMake variable names, and then the function uses introspection to get the variable type AND the help string. With the number of language variables passed, it's critical
 to get the help information into the sub-project to give information on what the variable is suppose to be.<br>
<br>
I would hate to give up the feature of being able to update the sub-projects' variable for a rebuild. But relaying sole on the Cache would do this. And the suggested patch just does that.<br>
<br>
Thanks for the suggestions. If there is a better way to do this I certainly like to know.<br>
<br>
Thanks,<br>
Brad<br>
<br>
<br>
[1] <a href="https://github.com/SimpleITK/SimpleITK/commit/dd3c4353773944194574473569da588d535d80f6">
https://github.com/SimpleITK/SimpleITK/commit/dd3c4353773944194574473569da588d535d80f6</a><br>
[2] <a href="https://github.com/SimpleITK/SimpleITK/blob/master/SuperBuild/SuperBuild.cmake#L333-L338">
https://github.com/SimpleITK/SimpleITK/blob/master/SuperBuild/SuperBuild.cmake#L333-L338</a><br>
<br>
<br>
On Aug 14, 2015, at 9:42 AM, Andras Lasso <lasso@queensu.ca> wrote:<br>
<br>
> Instead of commenting out the variable value passing, use CMAKE_CACHE_ARGS instead of CMAKE_ARGS.<br>
> <br>
> CMAKE_ARGS can be used for passing any command-line arguments, but it uses the command line, so length limitations apply.<br>
> <br>
> In contrast, CMAKE_CACHE_ARGS uses a file to pass variable values, so there is no limitation on the number or length of variables.<br>
> <br>
> Andras<br>
> <br>
> <br>
> -----Original Message-----<br>
> From: Community [<a href="mailto:community-bounces@itk.org">mailto:community-bounces@itk.org</a>] On Behalf Of Philip Semanchuk<br>
> Sent: August 14, 2015 8:03 AM<br>
> To: Bradley Lowekamp <blowekamp@mail.nih.gov><br>
> Cc: community@itk.org<br>
> Subject: Re: [ITK] Win64 SimpleITK build error: NMAKE : fatal error U1095 (command line too long)<br>
> <br>
>        <br>
>> On Aug 13, 2015, at 12:36 PM, Bradley Lowekamp <blowekamp@mail.nih.gov> wrote:<br>
>> <br>
>> OK,<br>
>> <br>
>> Your Visual Studio should be based on VS 2008 then.<br>
>> <br>
>> You could try commenting out this line:<br>
>> <a href="https://github.com/SimpleITK/SimpleITK/blob/1b1745da326bbb67e1752b3edbde344d15712032/SuperBuild/SuperBuild.cmake#L359">
https://github.com/SimpleITK/SimpleITK/blob/1b1745da326bbb67e1752b3edbde344d15712032/SuperBuild/SuperBuild.cmake#L359</a><br>
>> <br>
>> The will remove passing all the language variables on the command line to the SimpleITK sub-project. But they will still be in the initial CMakeCache. This will remove the ability to update the variables in the sub project from the super build.
<br>
> <br>
> That worked! Thanks very much for your help.<br>
> <br>
> Cheers<br>
> Philip<br>
> <br>
> <br>
> <br>
> <br>
>> <br>
>> I'll investigate further, to determine if there is a better long-term solution.<br>
>> <br>
>> HTH,<br>
>> Brad<br>
>> <br>
>> On Aug 13, 2015, at 12:19 PM, Philip Semanchuk <ond@semanchuk.com> wrote:<br>
>> <br>
>>> <br>
>>>> On Aug 13, 2015, at 11:53 AM, Bradley Lowekamp <blowekamp@mail.nih.gov> wrote:<br>
>>>> <br>
>>>> Hello,<br>
>>>> <br>
>>>> What version of CMake and Visual Studio are you using?<br>
>>> <br>
>>> CMake 3.3.0. I'm using Microsoft Visual C++ for Python 2.7. That's not Visual Studio - it's not an IDE. It's just a compiler, specifically a repackaged version of the compiler that came with Visual C++ 2008.
<br>
>>> <br>
>>> <br>
>>>> What is your build and source path?<br>
>>> <br>
>>> Build path is c:\Users\me\sitkb<br>
>>> Source path is C:\Users\me\SimpleITK-0.9.0<br>
>>> <br>
>>> <br>
>>>> Also know which Super build target that's causing the problem would be helpful too.<br>
>>> <br>
>>> The U1095 error comes here:<br>
>>> [ 84%] Performing configure step for 'SimpleITK'<br>
>>> <br>
>>> <br>
>>>> <br>
>>>> Try have having your build and your source in a really short paths like "C:/b/SimpleITK" and "C:/b/bld".<br>
>>> <br>
>>> Thanks for the suggestion. I'm aware that long paths can contribute to overly-long command lines (I've run into that problem earlier in this build process). I don't think they're the culprits here, though.
<br>
>>> <br>
>>> The problem IMHO is that there are 105 variables being passed on the command line via -D (e.g. MAKE COMMAND, CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO, Java_JAVAC_EXECUTABLE, CSHARP_COMPILER, etc.), a lot of them containing paths that I don't control (e.g.
 lots of references to "C:/Program Files (x86)"). <br>
>>> <br>
>>> If I paste the offending command into a text editor and search/replace my build and source paths with the shortest possible versions I can use, the command is still 5179 characters long. I think whatever buffer is getting blown out by a 5400 character command
 is still going to get blown out by a 5179 character command. <br>
>>> <br>
>>> Thanks for your willingness to help. I appreciate it!<br>
>>> <br>
>>> Philip<br>
>>> <br>
>>> <br>
>>>> <br>
>>>> On Aug 13, 2015, at 11:22 AM, Philip Semanchuk <ond@semanchuk.com> wrote:<br>
>>>> <br>
>>>>> Hi, <br>
>>>>> I'm new to CMake and SimpleITK, and I'm trying to use the former to build a 64-bit version of the latter on Windows 7 with Microsoft Visual C++ for Python 2.7. I'm using the "SuperBuild" instructions from here:<br>
>>>>> <a href="http://www.itk.org/Wiki/SimpleITK/GettingStarted#Build_It_Yourself">
http://www.itk.org/Wiki/SimpleITK/GettingStarted#Build_It_Yourself</a><br>
>>>>> <br>
>>>>> I'm running into a problem where a build.make file creates a shell command that's almost 5400 characters long. This leads to:<br>
>>>>> NMAKE : fatal error U1095: expanded command line [blah blah blah x 5400] too long<br>
>>>>> <br>
>>>>> The root cause of the problem is that all of the CMake config variables are being passed on the command line (e.g,. -DCMAKE_BUILD_TYPE:STRING=RELEASE -DCMAKE_MAKE_PROGRAM:STRING=nmake etc.).<br>
>>>>> <br>
>>>>> Since I'm new to CMake and SimpleITK, I'm a little lost as to where I should look to resolve this problem, but my hunch is that I should start with SimpleITK. If I'm in the wrong place, would someone be kind enough to guide me elsewhere?<br>
>>>>> <br>
>>>>> I can post my build config and steps if that would help. <br>
>>>>> <br>
>>>>> Thanks<br>
>>>>> Philip<br>
>>>>> _______________________________________________<br>
>>>>> Community mailing list<br>
>>>>> Community@itk.org<br>
>>>>> <a href="http://public.kitware.com/mailman/listinfo/community">http://public.kitware.com/mailman/listinfo/community</a><br>
>>>> <br>
>>> <br>
>> <br>
> <br>
> _______________________________________________<br>
> Community mailing list<br>
> Community@itk.org<br>
> <a href="http://public.kitware.com/mailman/listinfo/community">http://public.kitware.com/mailman/listinfo/community</a><br>
<br>
</div>
</span></font>
</body>
</html>