[ITK] Win64 SimpleITK build error: NMAKE : fatal error U1095 (command line too long)

Philip Semanchuk ond at semanchuk.com
Thu Aug 13 12:19:07 EDT 2015


> On Aug 13, 2015, at 11:53 AM, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
> 
> Hello,
> 
> What version of CMake and Visual Studio are you using?

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. 


> What is your build and source path?

Build path is c:\Users\me\sitkb
Source path is C:\Users\me\SimpleITK-0.9.0


> Also know which Super build target that's causing the problem would be helpful too.

The U1095 error comes here:
[ 84%] Performing configure step for 'SimpleITK'


> 
> Try have having your build and your source in a really short paths like "C:/b/SimpleITK" and "C:/b/bld”.

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. 

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)”). 

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. 

Thanks for your willingness to help. I appreciate it!

Philip


> 
> On Aug 13, 2015, at 11:22 AM, Philip Semanchuk <ond at semanchuk.com> wrote:
> 
>> Hi, 
>> 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:
>> http://www.itk.org/Wiki/SimpleITK/GettingStarted#Build_It_Yourself
>> 
>> I’m running into a problem where a build.make file creates a shell command that’s almost 5400 characters long. This leads to:
>> NMAKE : fatal error U1095: expanded command line [blah blah blah x 5400] too long
>> 
>> 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.).
>> 
>> 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?
>> 
>> I can post my build config and steps if that would help. 
>> 
>> Thanks
>> Philip
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/mailman/listinfo/community
> 



More information about the Community mailing list