<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I have a patch which may fix the issue you are experiencing. It would be great if you could test it on you platform.<div><br></div><div><a href="http://review.source.kitware.com/#/c/6205/1">http://review.source.kitware.com/#/c/6205/1</a></div><div><br></div><div>Thanks,</div><div>Brad</div><div><br><div><div>On Jun 14, 2012, at 7:32 AM, Prevrhal, Sven wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Success!<br>I wrote a little Python script that removes the duplicate entries from the gcc_xml.inc files (find it attached to this email), then ran it from a Cygwin bash cmd line with<br><br>find ./ -name gcc_xml.inc -execdir python /cygdrive/d/bin/uniqus.py {} {} \;<br><br>That did it, I now have the itk nightly sources built with Python Wrapper support. NB, run duplicate line removal *after* the last CMake generation, which would otherwise replace the gcc_xml.inc files with faulty ones again.<br><br>Greetings<br>-- Sven<br><br>-----Original Message-----<br>From: Prevrhal, Sven<br>Sent: Mittwoch, 13. Juni 2012 17:01<br>To: 'Alexandre GOUAILLARD'; <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>Cc: 'Patrick Arbez'<br>Subject: RE: [Insight-users] itk python wrapping failing on Win<br><br>I have come a bit farther with identifying the problem. It's not related to Visual Studio since it also fails with mingw.<br><br>The first make step to fail is in Wrapping\Modules\ITKCommon\CMakeFiles\ITKCommonGccXML.dir. The following is directly copied out of the build.make file there:<br><br>cd /d D:\packages\builds\itk-nightly-x86\mingw\Wrapping\Modules\ITKCommon && D:\packages\gccxml\mingw\bin\gccxml.exe -fxml-start=_cable_ -fxml=D:/packages/builds/itk-nightly-x86/mingw/Wrapping/Modules/ITKCommon/vcl_complex.xml --gccxml-gcc-options D:/packages/builds/itk-nightly-x86/mingw/Wrapping/Modules/ITKCommon/gcc_xml.inc -DCSWIG -DCABLE_CONFIGURATION -DITK_MANUAL_INSTANTIATION D:/packages/builds/itk-nightly-x86/mingw/Wrapping/Modules/ITKCommon/vcl_complex.cxx<br><br>This indeed fails when executed from the cmd line. I deleted all the paths and it still failed. I narrowed it down to the --gccxml-gcc-options gcc_xml.inc being the offending part. This is a gccxml option that allow passing a long list of includes to the patched gcc in a single file. Then I looked at gcc_xml.inc and saw that it contained 18 copies of the same includes, and this is what gccxml balks at: After removing the duplicates, it compiles without a hitch and produces a correct-looking vcl_complex.xml file.<br><br>The gcc_xml.inc's are produced by a macro in Wrapping/Generators/GccXML/CMakeList.txt<br><br>macro(itk_wrap_module_gccxml library_name)<br> # create the files used to pass the file to include to gccxml<br> set(gccxml_inc_file "${WRAPPER_LIBRARY_OUTPUT_DIR}/gcc_xml.inc")<br> set(CONFIG_GCCXML_INC_CONTENTS)<br> get_directory_property(include_dir_list INCLUDE_DIRECTORIES)<br><br> if(ITK_USE_CCACHE)<br> # it is used on the command line<br> foreach(dir ${include_dir_list})<br> set(CONFIG_GCCXML_INC_CONTENTS ${CONFIG_GCCXML_INC_CONTENTS} -I${dir})<br> endforeach(dir)<br> else(ITK_USE_CCACHE)<br> # really create the content of the file<br> foreach(dir ${include_dir_list})<br> set(CONFIG_GCCXML_INC_CONTENTS "${CONFIG_GCCXML_INC_CONTENTS}-I${dir}\n")<br> endforeach(dir)<br> # and the file.<br> configure_file("${ITK_WRAP_GCCXML_SOURCE_DIR}/gcc_xml.inc.in" "${gccxml_inc_file}"<br> @ONLY IMMEDIATE)<br> endif(ITK_USE_CCACHE)<br> set(GCC_XML_OUTPUT_FILES )<br>endmacro(itk_wrap_module_gccxml)<br><br>The macro looks alright to me, although I am not a CMake expert - it seems to build the list CONFIG_GCCXML_INC_CONTENTS from a variable include_dir_list which in turns comes from this line:<br><br>get_directory_property(include_dir_list INCLUDE_DIRECTORIES)<br><br>I used message to print out the contents of ${include_dir_list}, and indeed, it already contains the duplicates. So The CMake INCLUDE_DIRECTORIES command doesn't care about duplicates, and when it's called from each module's CMakeList.txt, obviously there will be lots of them. The quick dirty fix for me would be to run a script that cleans them up (I hope this doesn't trigger a rerun of cmake configuration and generation when I call make!), or better, we find the bug that's either in CMake or in the itk CMakeLists.txt files. I saw that David Cole was involved with fixed in CMake 2.8.8 related to INCLUDE_DIRECTORIES but I don't have his email.<br><br><br>BTW: I tried using variable_watch(include_dir_list) before the get_directory_property command but CMake reproducibly crashes with that.<br><br>Gruesse - Greetings,<br>-- Sven<br><br><br>-----Original Message-----<br>From: Alexandre GOUAILLARD [mailto:agouaillard@gmail.com]<br>Sent: Sonntag, 27. Mai 2012 12:41<br>To: Prevrhal, Sven<br>Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>Subject: Re: [Insight-users] itk python wrapping failing on Win<br><br>dear sven,<br><br>you re getting different errors messages, that s progress :-)<br><br>On Sun, May 27, 2012 at 4:26 AM, Prevrhal, Sven <<a href="mailto:Sven.Prevrhal@philips.com">Sven.Prevrhal@philips.com</a>> wrote:<br><blockquote type="cite">Thanks -<br></blockquote><blockquote type="cite">I tried D:/ for itk build, same error. Then I followed your advice and tried installing gccxml and ITK_USE_SYSTEM_GCCXML.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Now I get errors like<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">867>D:\packages\src\ITK-nightly\Modules\Filtering\ImageIntensity\inclu<br></blockquote><blockquote type="cite">867>de\itkConstrainedValueDifferenceImageFilter.h(97) : error C2487:<br></blockquote><blockquote type="cite">867>'itk::ProcessObject::MakeOutput' : member of dll interface class<br></blockquote><blockquote type="cite">867>may not be declared with dll interface<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">And literally 100s of 1000s of lines like<br></blockquote><br>I never met that specific error before but, it's likely to be related to the window specific all import/export feature. If this is the case, this is supposed to be made transparent through the definition of ITK_EXPORT at configuration time. each itk class declaration should use it ( class ITK_EXPORT itkMyClassName ...). Can you check if in the declaration of itkProcessObject the keyword is there and as the right value (in MSVC you can move your mouse over the symbol to see it's definition, if it s empty, you have a problem).<br><br>this is a windows issues and, from what I see, not necessarily related to wrapping.<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">867>D:\packages\builds\itk-nightly-x86\Wrapping\Typedefs\ITKImageInten<br></blockquote><blockquote type="cite">867>sityExplicit.h(628) : warning C4231: nonstandard extension used :<br></blockquote><blockquote type="cite">867>'extern' before template explicit instantiation<br></blockquote><br>I wouldn't use EXPLICIT. Just use normal wrapping (there is an extra advanced flag for EXPLICIT instanciation, that is supposed to fasten the compilation of the wrapping if you use several language by first explicitly instantiating some of the template, and then wrapping those, switch it off).<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">I am sure I missing something obvious - there must be more folks out there wanting to compile itk with python wrapping on a windows box.<br></blockquote><br>I guess it works for them :-)<br><br>More seriously, I just checked the dashboard sand indeed, there is not a lot of windows machine (ihpc @ NLM, redwall @ kitware, factory @ kitware which has a different purpose, ...). Maybe it s time to call for contribution. I will see if I can resurrect one of the machine that gaetan was using for the wrapping.<br><br>Maybe you would also like to contribute, even only on-time experimental build so we can see more in details your errors? within MSVC just build the Experimental project (which is skipped by default when you BUILD_ALL), from the command line you can run:<br>ctest -D Experimental.<br><br>regards,<br><br>alex.<br><blockquote type="cite"><br></blockquote><blockquote type="cite">sven<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-----Original Message-----<br></blockquote><blockquote type="cite">From: Alexandre GOUAILLARD [mailto:agouaillard@gmail.com]<br></blockquote><blockquote type="cite">Sent: Samstag, 26. Mai 2012 10:22<br></blockquote><blockquote type="cite">To: Prevrhal, Sven<br></blockquote><blockquote type="cite">Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br></blockquote><blockquote type="cite">Subject: Re: [Insight-users] itk python wrapping failing on Win<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">hi,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">my guts feeling is that the path to the executable is too long.<br></blockquote><blockquote type="cite">try to either relocate ITK closer to the D:/ root, or to install gccXML first, and use the installed version within ITK.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">regards,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">alex.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Sat, May 26, 2012 at 6:13 AM, Prevrhal, Sven <<a href="mailto:Sven.Prevrhal@philips.com">Sven.Prevrhal@philips.com</a>> wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">Gccxml is making trouble. Non-wrapping projects all compile just<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">fine, using<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">VS2008 32-bit debug. Python wrappers don't compile at all. Here is a<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">snippet of the build log - any ideas? I did set GCCXML_COMPILER to<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">msvc9 but it apparently got ignored, and probably wouldn't solve the problem anyway.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">290>Generating itkAntiAliasBinaryImageFilter.xml<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>15.00.21022.08<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">for 80x86<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Copyright (C) Microsoft Corporation. All rights reserved.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>usage: cl [ option... ] filename... [ /link linkoption... ]<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Warning:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>9, and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">10 are installed.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex",<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>"msvc9",<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">or "msvc10" for the GCCXML_COMPILER setting.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Using MSVC 9 because it was used to build GCC-XML.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Error: Could not run<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">D:/packages/builds/itk-nightly-x86/Wrapping/Generators/GccXML/gccxml/bin/gccxml_cc1plus.exe:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>The filename or extension is too long<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>Project : error PRJ0019: A tool returned an error code from<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">289>"Generating<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">itkErodeObjectMorphologyImageFilter.xml"<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The information contained in this message may be confidential and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">legally protected under applicable law. The message is intended<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">solely for the addressee(s). If you are not the intended recipient,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">you are hereby notified that any use, forwarding, dissemination, or<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">reproduction of this message is strictly prohibited and may be<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">unlawful. If you are not the intended recipient, please contact the<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">sender by return e-mail and destroy all copies of the original message.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_____________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Powered by <a href="http://www.kitware.com">www.kitware.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Visit other Kitware open-source projects at<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Kitware offers ITK Training Courses, for more information visit:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Please keep messages on-topic and check the ITK FAQ at:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Follow this link to subscribe/unsubscribe:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">________________________________<br></blockquote><blockquote type="cite">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.<br></blockquote><blockquote type="cite"><br></blockquote><span><uniqus.py></span>_____________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">========================================================</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Medical Science and Computing for</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Office of High Performance Computing and Communications</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>