View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003157 | Slicer4 | Core: Building (CMake, Superbuild) | public | 2013-06-11 13:41 | 2018-03-02 11:01 |
Reporter | lassoan | Assigned To | jcfr | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Product Version | |||||
Target Version | Slicer 4.7.0 | Fixed in Version | |||
Summary | 0003157: SimpleITK build error on Windows for certain build path length | ||||
Description | When trying to build slicer in a build directory with 6 characters long (F:/S4R) then SimpleITK build fails with the error: 21>15>swig error : Unrecognized option -F:/S4R/ITKv4/Modules/IO/ImageBase/include | ||||
Additional Information | The error is 100% reproducible, regardless of SimpleITK shared libraries enabled or not. The problem may be linked to the maximum command-line length. The maximum command-line length is 8191 characters (http://support.microsoft.com/kb/830473) and the generated command (see below) is 9923 character long. Interestingly, the command is not truncated after 8191 characters, only one single character is deleted from the command line at the 8192nd position in the command parameters, which in my case is the ‘I’ character in -IF:/S4R/ITKv4... This character loss only results in a build error if it hits the '-' or the 'I' character, otherwise it’ll lead to just an incorrect additional include directory, which doesn’t cause a build error most of the time. So there is a 3-4% chance that a build error happens and the outcome only depends on the path names. The problem is the same with swigwin-2.0.10. Note that the issue happens if you just run the command below from the command prompt, so it’s not related to Visual Studio or CMake, but probably caused by a bug in swig. F:\S4R\swigwin-2.0.9\swig.exe -python -features autodoc=1 -keyword -outdir F:/S4R/SimpleITK-build/Wrapping -c++ -IF:/S4R/SimpleITK-build/Wrapping/ITKIOFactoryRegistration -IF:/S4R/ITKv4/Modules/Video/IO/include -IF:/S4R/ITKv4/Modules/Video/Filtering/include -IF:/S4R/ITKv4/Modules/Video/Core/include -IF:/S4R/ITKv4/Modules/Nonunit/Review/include -IF:/S4R/ITKv4/Modules/Registration/RegistrationMethodsv4/include -IF:/S4R/ITKv4/Modules/Registration/Metricsv4/include -IF:/S4R/ITKv4/Modules/Numerics/Optimizersv4/include -IF:/S4R/ITKv4/Modules/Segmentation/LevelSetsv4/include -IF:/S4R/ITKv4/Modules/Filtering/ImageFusion/include -IF:/S4R/ITKv4/Modules/IO/Mesh/include -IF:/S4R/ITKv4/Modules/IO/HDF5/include -IF:/S4R/ITKv4/Modules/IO/DCMTK/include -IF:/S4R/ITKv4/Modules/IO/CSV/include -IF:/S4R/ITKv4/Modules/Filtering/GPUThresholding/include -IF:/S4R/ITKv4/Modules/Filtering/GPUSmoothing/include -IF:/S4R/ITKv4/Modules/Registration/GPUPDEDeformable/include -IF:/S4R/ITKv4/Modules/Registration/GPUCommon/include -IF:/S4R/ITKv4/Modules/Filtering/GPUImageFilterBase/include -IF:/S4R/ITKv4/Modules/Filtering/GPUAnisotropicSmoothing/include -IF:/S4R/ITKv4/Modules/Core/GPUFiniteDifference/include -IF:/S4R/ITKv4/Modules/Core/GPUCommon/include -IF:/S4R/ITKv4/Modules/ThirdParty/GIFTI/src/gifticlib -IF:/S4R/ITKv4/Modules/Compatibility/Deprecated/include -IF:/S4R/ITKv4/Modules/Segmentation/Watersheds/include -IF:/S4R/ITKv4/Modules/Segmentation/Voronoi/include -IF:/S4R/ITKv4/Modules/Bridge/VTK/include -IF:/S4R/ITKv4/Modules/Compatibility/V3Compatibility/include -IF:/S4R/ITKv4/Modules/Core/TestKernel/include -IF:/S4R/ITKv4/Modules/IO/LSM/include -IF:/S4R/ITKv4/Modules/Filtering/SpatialFunction/include -IF:/S4R/ITKv4/Modules/Segmentation/RegionGrowing/include -IF:/S4R/ITKv4/Modules/Filtering/QuadEdgeMeshFiltering/include -IF:/S4R/ITKv4/Modules/Numerics/NeuralNetworks/include -IF:/S4R/ITKv4/Modules/Segmentation/MarkovRandomFieldsClassifiers/include -IF:/S4R/ITKv4/Modules/Segmentation/LabelVoting/include -IF:/S4R/ITKv4/Modules/Segmentation/KLMRegionGrowing/include -IF:/S4R/ITKv4/Modules/IO/VTK/include -IF:/S4R/ITKv4/Modules/IO/TransformMatlab/include -IF:/S4R/ITKv4/Modules/IO/TransformInsightLegacy/include -IF:/S4R/ITKv4/Modules/IO/TransformHDF5/include -IF:/S4R/ITKv4-build/Modules/ThirdParty/HDF5/src -IF:/S4R/ITKv4/Modules/ThirdParty/HDF5/src -IF:/S4R/ITKv4/Modules/IO/TransformBase/include -IF:/S4R/ITKv4/Modules/IO/TIFF/include -IF:/S4R/ITKv4/Modules/ThirdParty/TIFF/src -IF:/S4R/ITKv4-build/Modules/ThirdParty/TIFF/src/itktiff -IF:/S4R/ITKv4-build/Modules/ThirdParty/TIFF/src -IF:/S4R/ITKv4/Modules/IO/Stimulate/include -IF:/S4R/ITKv4/Modules/IO/Siemens/include -IF:/S4R/ITKv4/Modules/IO/RAW/include -IF:/S4R/ITKv4/Modules/IO/PNG/include -IF:/S4R/ITKv4/Modules/ThirdParty/PNG/src -IF:/S4R/ITKv4-build/Modules/ThirdParty/PNG/src -IF:/S4R/ITKv4/Modules/IO/NRRD/include -IF:/S4R/ITKv4/Modules/ThirdParty/NrrdIO/src/NrrdIO -IF:/S4R/ITKv4-build/Modules/ThirdParty/NrrdIO/src/NrrdIO -IF:/S4R/ITKv4/Modules/IO/NIFTI/include -IF:/S4R/ITKv4/Modules/ThirdParty/NIFTI/src/nifti/znzlib -IF:/S4R/ITKv4/Modules/ThirdParty/NIFTI/src/nifti/niftilib -IF:/S4R/ITKv4/Modules/IO/Meta/include -IF:/S4R/ITKv4/Modules/IO/JPEG/include -IF:/S4R/ITKv4/Modules/ThirdParty/JPEG/src -IF:/S4R/ITKv4-build/Modules/ThirdParty/JPEG/src -IF:/S4R/ITKv4/Modules/IO/GIPL/include -IF:/S4R/ITKv4/Modules/IO/GE/include -IF:/S4R/ITKv4/Modules/IO/IPL/include -IF:/S4R/ITKv4/Modules/IO/GDCM/include -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Utilities/C99 -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Source/DataStructureAndEncodingDefinition -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Source/MessageExchangeDefinition -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Source/InformationObjectDefinition -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Source/Common -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Source/DataDictionary -IF:/S4R/ITKv4/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat -IF:/S4R/ITKv4-build/Modules/ThirdParty/GDCM/src/gdcm/Source/Common -IF:/S4R/ITKv4-build/Modules/ThirdParty/GDCM -IF:/S4R/ITKv4/Modules/ThirdParty/OpenJPEG/src/openjpeg -IF:/S4R/ITKv4-build/Modules/ThirdParty/OpenJPEG/src/openjpeg -IF:/S4R/ITKv4/Modules/IO/BioRad/include -IF:/S4R/ITKv4/Modules/IO/BMP/include -IF:/S4R/ITKv4/Modules/Registration/FEM/include -IF:/S4R/ITKv4/Modules/Registration/PDEDeformable/include -IF:/S4R/ITKv4/Modules/Numerics/FEM/include -IF:/S4R/ITKv4/Modules/Registration/Common/include -IF:/S4R/ITKv4/Modules/IO/SpatialObjects/include -IF:/S4R/ITKv4/Modules/IO/XML/include -IF:/S4R/ITKv4/Modules/ThirdParty/Expat/src/expat -IF:/S4R/ITKv4-build/Modules/ThirdParty/Expat/src/expat -IF:/S4R/ITKv4/Modules/Numerics/Eigen/include -IF:/S4R/ITKv4/Modules/Filtering/DisplacementField/include -IF:/S4R/ITKv4/Modules/Filtering/DiffusionTensorImage/include -IF:/S4R/ITKv4/Modules/Filtering/Denoising/include -IF:/S4R/ITKv4/Modules/Segmentation/DeformableMesh/include -IF:/S4R/ITKv4/Modules/Filtering/Deconvolution/include -IF:/S4R/ITKv4/Modules/ThirdParty/DICOMParser/src/DICOMParser -IF:/S4R/ITKv4-build/Modules/ThirdParty/DICOMParser/src/DICOMParser -IF:/S4R/DCMTK/dcmrt/include -IF:/S4R/DCMTK/dcmpstat/include -IF:/S4R/DCMTK/dcmqrdb/include -IF:/S4R/DCMTK/dcmwlm/include -IF:/S4R/DCMTK/dcmsign/include -IF:/S4R/DCMTK/dcmsr/include -IF:/S4R/DCMTK/dcmnet/include -IF:/S4R/DCMTK/dcmtls/include -IF:/S4R/DCMTK/dcmjpls/include -IF:/S4R/DCMTK/dcmjpeg/include -IF:/S4R/DCMTK/dcmimage/include -IF:/S4R/DCMTK/dcmimgle/include -IF:/S4R/DCMTK/dcmdata/include -IF:/S4R/DCMTK/oflog/include -IF:/S4R/DCMTK/ofstd/include -IF:/S4R/DCMTK-build/config/include -IF:/S4R/DCMTK/dcmrt/include/dcmtk/dcmrt -IF:/S4R/DCMTK/dcmpstat/include/dcmtk/dcmpstat -IF:/S4R/DCMTK/dcmqrdb/include/dcmtk/dcmqrdb -IF:/S4R/DCMTK/dcmwlm/include/dcmtk/dcmwlm -IF:/S4R/DCMTK/dcmsign/include/dcmtk/dcmsign -IF:/S4R/DCMTK/dcmsr/include/dcmtk/dcmsr -IF:/S4R/DCMTK/dcmnet/include/dcmtk/dcmnet -IF:/S4R/DCMTK/dcmtls/include/dcmtk/dcmtls -IF:/S4R/DCMTK/dcmjpls/include/dcmtk/dcmjpls -IF:/S4R/DCMTK/dcmjpeg/include/dcmtk/dcmjpeg -IF:/S4R/DCMTK/dcmimage/include/dcmtk/dcmimage -IF:/S4R/DCMTK/dcmimgle/include/dcmtk/dcmimgle -IF:/S4R/DCMTK/dcmdata/include/dcmtk/dcmdata -IF:/S4R/DCMTK/oflog/include/dcmtk/oflog -IF:/S4R/DCMTK/ofstd/include/dcmtk/ofstd -IF:/S4R/DCMTK-build/config/include/dcmtk/config -IF:/S4R/ITKv4/Modules/Filtering/Convolution/include -IF:/S4R/ITKv4/Modules/Filtering/FFT/include -IF:/S4R/ITKv4/Modules/Filtering/Colormap/include -IF:/S4R/ITKv4/Modules/Segmentation/Classifiers/include -IF:/S4R/ITKv4/Modules/Segmentation/BioCell/include -IF:/S4R/ITKv4/Modules/Filtering/BiasCorrection/include -IF:/S4R/ITKv4/Modules/Numerics/Polynomials/include -IF:/S4R/ITKv4/Modules/Filtering/AntiAlias/include -IF:/S4R/ITKv4/Modules/Segmentation/LevelSets/include -IF:/S4R/ITKv4/Modules/Segmentation/SignedDistanceFunction/include -IF:/S4R/ITKv4/Modules/Numerics/Optimizers/include -IF:/S4R/ITKv4/Modules/Filtering/ImageFeature/include -IF:/S4R/ITKv4/Modules/Filtering/ImageSources/include -IF:/S4R/ITKv4/Modules/Filtering/ImageGradient/include -IF:/S4R/ITKv4/Modules/Filtering/Smoothing/include -IF:/S4R/ITKv4/Modules/Filtering/ImageCompare/include -IF:/S4R/ITKv4/Modules/Filtering/FastMarching/include -IF:/S4R/ITKv4/Modules/Core/QuadEdgeMesh/include -IF:/S4R/ITKv4/Modules/Filtering/DistanceMap/include -IF:/S4R/ITKv4/Modules/Numerics/NarrowBand/include -IF:/S4R/ITKv4/Modules/Filtering/BinaryMathematicalMorphology/include -IF:/S4R/ITKv4/Modules/Filtering/LabelMap/include -IF:/S4R/ITKv4/Modules/Filtering/MathematicalMorphology/include -IF:/S4R/ITKv4/Modules/Segmentation/ConnectedComponents/include -IF:/S4R/ITKv4/Modules/Filtering/Thresholding/include -IF:/S4R/ITKv4/Modules/Filtering/ImageLabel/include -IF:/S4R/ITKv4/Modules/Filtering/ImageIntensity/include -IF:/S4R/ITKv4/Modules/Filtering/Path/include -IF:/S4R/ITKv4/Modules/Filtering/ImageStatistics/include -IF:/S4R/ITKv4/Modules/Core/SpatialObjects/include -IF:/S4R/ITKv4/Modules/ThirdParty/MetaIO/src/MetaIO -IF:/S4R/ITKv4-build/Modules/ThirdParty/MetaIO/src/MetaIO -IF:/S4R/zlib-install/include -IF:/S4R/ITKv4-build/Modules/ThirdParty/ZLIB/src -IF:/S4R/ITKv4/Modules/Core/Mesh/include -IF:/S4R/ITKv4/Modules/IO/ImageBase/include -IF:/S4R/ITKv4-build/Modules/IO/ImageBase -IF:/S4R/ITKv4/Modules/Filtering/ImageCompose/include -IF:/S4R/ITKv4/Modules/Filtering/AnisotropicSmoothing/include -IF:/S4R/ITKv4/Modules/Filtering/ImageGrid/include -IF:/S4R/ITKv4/Modules/Core/ImageFunction/include -IF:/S4R/ITKv4/Modules/Core/Transform/include -IF:/S4R/ITKv4/Modules/Numerics/Statistics/include -IF:/S4R/ITKv4-build/Modules/ThirdParty/Netlib -IF:/S4R/ITKv4/Modules/Core/ImageAdaptors/include -IF:/S4R/ITKv4/Modules/Filtering/CurvatureFlow/include -IF:/S4R/ITKv4/Modules/Filtering/ImageFilterBase/include -IF:/S4R/ITKv4/Modules/Core/FiniteDifference/include -IF:/S4R/ITKv4/Modules/Core/Common/include -IF:/S4R/ITKv4-build/Modules/Core/Common -IF:/S4R/ITKv4/Modules/ThirdParty/VNLInstantiation/include -IF:/S4R/ITKv4-build/Modules/ThirdParty/VNL/src/vxl/core -IF:/S4R/ITKv4-build/Modules/ThirdParty/VNL/src/vxl/vcl -IF:/S4R/ITKv4-build/Modules/ThirdParty/VNL/src/vxl/v3p/netlib -IF:/S4R/ITKv4/Modules/ThirdParty/VNL/src/vxl/core -IF:/S4R/ITKv4/Modules/ThirdParty/VNL/src/vxl/vcl -IF:/S4R/ITKv4/Modules/ThirdParty/VNL/src/vxl/v3p/netlib -IF:/S4R/ITKv4-build/Modules/ThirdParty/KWSys/src -IF:/S4R/ITKv4/Modules/ThirdParty/DoubleConversion/src/double-conversion -IF:/S4R/SimpleITK/Code/Common/include -IF:/S4R/SimpleITK/Code/Registration -IF:/S4R/SimpleITK/Code/BasicFilters/include -IF:/S4R/SimpleITK/Code/IO/include -IF:/S4R/SimpleITK-build/Code/BasicFilters/include -IF:/S4R/SimpleITK-build/Code/Common/include -IF:/S4R/SimpleITK/Utilities/C99 -IF:/S4R/python-install/include -IF:/S4R/SimpleITK/Wrapping -o F:/S4R/SimpleITK-build/Wrapping/SimpleITKPYTHON_wrap.cxx F:/S4R/SimpleITK/Wrapping/SimpleITK.i | ||||
Tags | No tags attached. | ||||
2013-06-11 13:42
|
test.bat (9,925 bytes) |
To reproduce the problem there is no need to build Slicer or SimpleITK or anything, just edit the attached test.bat with the correct swig.exe path on your computer then run it. It will give the error: |
|
The problem is reproducible without on VS2008 with a simple console application: int main(int argc, char **argv) Run this app with the attached batch file. The output is: Note the missing 'I' character in the ...IO/ImageBase/include line. So, it seems to be a Windows issue. One solution is to shorten the command line path so that it doesn't reach the 8k limit. |
|
From: Sharp, Gregory C. [mailto:GCSHARP@partners.org] We encountered this problem using ITK4 with nvcc. There are several workarounds one can imagine
We chose the last option. As you know, cmake can't set |
|
from: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> Hi Folks, The latest version of CMake now include a feature allowing to specify target usage requirements. It means it is now possible to associate a list of include directories for each targets. Moving forward, this is something I would like to setup within Slicer. See http://www.kitware.com/blog/home/post/462 and http://community.kde.org/Frameworks/Epics/CMake_target_usage_requirements |
|
This particular issue can be resolved in SimpleITK by the removal of "include(${ITK_USE_FILE})" in SimpleITK/Wrapping/CMakeLists.txt. Here is the issue in the SimpleITK bug tracker: https://issues.itk.org/jira/browse/SIMPLEITK-408 As another possible long term solution to this problem. ITK's modular structure could be take advantage of , each library/module could find and include the ITK project, and specify the components needed. This would only added the required include paths to the compilation lines. |
|
A topic has been merged into SimpleITK's next brach to address this issue: it will be merged into the release and master branch after successful nightly testing. |
|
thanks! |
|
This patch should address this issue: |
|
The version of SimpleITK in Slicer has been updated to address this bug. It'd be great if the original reporter could confirm. |
|
Closing resolved issues that have not been updated in more than 3 months |
|
The changes might have reduced the probability of the issue occurring, but unfortunately, the problem still has not been resolved, see an error report below. From: slicer-devel-bounces@bwh.harvard.edu [mailto:slicer-devel-bounces@bwh.harvard.edu] On Behalf Of yao2049@gmail.com hello PythonQt Wrapping - Generating generated_cpp/org_commontk_CTKWidgets/org_commontk_CTKWidgets_init.cpp i was wonder why it will be automatically cut a letter… and i never write it by hand the project is automatical constructed by cmake. and how can i build successfully? many thanks YAO JIALIANG |
|
ITK continues to grow and add more modules. When build against ITK's build tree this adds more path to the include and linker paths. However when ITK is installed it's a flat tree with significantly fewer number of required paths. |
|
It seems that the issue is not specific to SWIG, for example: |
|
I have good news! I had a look at this path length issue again, and it seems that there may be a clean and definitive solution. => Problem Maximum command line length on Windows for cmd.exe is 8192 (32767 for CreateProcess). If you pass longer than 8192 then the behavior is undefined (actually, 8192th character is removed and the rest of the string is passed). CMake passes parameters to the compiler or linker using a parameter file (instead of command-line arguments) when it finds that the command-line would be too long. However, CMake cannot implement this mechanism for custom commands, that's up to the developer who adds a custom command! => Example The particular issue that caused build error for Jim is due to a custom command defined in ctkMacroWrapPythonQt.cmake:add_custom_command(
|
|
This is no longer a SimpleITK issue. I believe the original issue was resolved and closed. The original title and description are not longer accurate. The latest report on an issue (2014-05-19 04:18) with CTK issues should be separate ticket. |
|
I agree that the remaining is not specific to SimpleITK and there is already a ticket in CTK's bugtracker (https://github.com/commontk/CTK/issues/525), so this issue can be closed. The current workaround is to reduce build path length to a few characters. At some point, as more and more code is added, it will not possible to have a build path short enough to be able to build Slicer. At that point, either it has to be made sure that no include directory list is attempted to passed through command line (modify ctkWrapPythonQt and similar CMake scripts) or VTK/ITK should be fixed to not require hundreds of include directories (this would be much nicer). |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2013-06-11 13:41 | lassoan | New Issue | |
2013-06-11 13:41 | lassoan | Status | new => assigned |
2013-06-11 13:41 | lassoan | Assigned To | => jcfr |
2013-06-11 13:42 | lassoan | File Added: test.bat | |
2013-06-11 13:46 | lassoan | Note Added: 0008748 | |
2013-06-11 14:35 | lassoan | Note Added: 0008749 | |
2013-06-11 16:40 | lassoan | Note Added: 0008751 | |
2013-06-12 05:07 | jcfr | Note Added: 0008753 | |
2013-06-13 06:15 | blowekamp | Note Added: 0008759 | |
2013-06-13 07:57 | blowekamp | Note Added: 0008760 | |
2013-06-13 08:04 | lassoan | Note Added: 0008761 | |
2013-06-13 20:25 | jcfr | Priority | normal => high |
2013-06-13 20:25 | jcfr | Target Version | => Slicer 4.3.0 |
2013-07-05 05:59 | blowekamp | Note Added: 0008856 | |
2013-07-16 12:12 | blowekamp | Note Added: 0009089 | |
2013-07-16 14:11 | jcfr | Status | assigned => feedback |
2013-07-22 08:09 | jcfr | Status | feedback => resolved |
2013-07-22 08:09 | jcfr | Fixed in Version | => Slicer 4.3.0 |
2013-07-22 08:09 | jcfr | Resolution | open => fixed |
2014-03-06 04:56 | jcfr | Note Added: 0010812 | |
2014-03-06 04:58 | jcfr | Status | resolved => closed |
2014-05-19 04:18 | lassoan | Note Added: 0011886 | |
2014-05-19 05:09 | jcfr | Status | closed => feedback |
2014-05-19 05:09 | jcfr | Resolution | fixed => reopened |
2014-05-19 05:15 | blowekamp | Note Added: 0011887 | |
2014-05-19 06:36 | lassoan | Note Added: 0011888 | |
2014-05-19 06:47 | lassoan | Note Edited: 0011888 | |
2014-08-26 15:12 | lassoan | Note Added: 0012423 | |
2015-11-03 19:35 | jcfr | Fixed in Version | Slicer 4.3.0 => |
2015-11-03 19:35 | jcfr | Target Version | Slicer 4.3.0 => Slicer 4.6.0 |
2016-10-12 03:55 | jcfr | Target Version | Slicer 4.6.0 => Slicer 4.7.0 |
2016-10-12 09:00 | blowekamp | Note Added: 0014169 | |
2016-10-17 12:20 | lassoan | Note Added: 0014199 | |
2016-10-17 12:20 | lassoan | Status | feedback => assigned |
2016-10-17 12:20 | lassoan | Status | assigned => resolved |
2016-10-17 12:20 | lassoan | Resolution | reopened => won't fix |
2018-03-02 11:01 | jcfr | Status | resolved => closed |