<div dir="ltr">Michael--<div><br></div><div>I'm not sure if this is the same problem, but I once ran into trouble compiling ITK with c++11 and found that I needed to add the flag during the <i>initial</i> configuration at commandline. If I added it in the ccmake gui, I got type traits errors. Something like this:</div><div><br></div><div>$ ccmake ../src -DCMAKE_CXX_FLAGS=-std=c++11</div><div><br></div><div>Hope that helps, and best of luck if not.</div><div><br></div><div>--Davis</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 30, 2015 at 12:54 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The issue is that I am probably missing something when configuring ITK. Looking in my CMake configure logs I have this message:<br>
<br>
Run Build Command:"/usr/local/bin/ninja" "cmTC_2927f"<br>
[1/2] Building CXX object CMakeFiles/cmTC_2927f.dir/CheckIncludeFile.cxx.o<br>
FAILED: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.7 -o CMakeFiles/cmTC_2927f.dir/CheckIncludeFile.cxx.o -c CheckIncludeFile.cxx<br>
CheckIncludeFile.cxx:1:10: fatal error: 'type_traits' file not found<br>
#include <type_traits><br>
^<br>
1 error generated.<br>
ninja: build stopped: subcommand failed.<br>
<br>
If you take that same command line and file to compile but simply add "-std=c++11 -stdlib=libc++” to the command line then the compile succeeds. So this is clearly a “user error”. How do I ensure that when CMake is running all of its detection tests that those flags get added? Otherwise the tests are not really valid for the way I am going to compile the codes. I figured by creating an initial CMakeCache.txt file that those flags would get added to every “test” but I guess that is not the way to accomplish that task.<br>
<span class="im HOEnZb">--<br>
Michael A. Jackson<br>
BlueQuartz Software, LLC<br>
[e]: <a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a><br>
<br>
</span><div class="HOEnZb"><div class="h5">> On Oct 29, 2015, at 11:37 PM, Matt McCormick <<a href="mailto:matt.mccormick@kitware.com">matt.mccormick@kitware.com</a>> wrote:<br>
><br>
> Hi Michael,<br>
><br>
>>> I am getting the following compile error when I compile my codes against<br>
>>> ITK 4.8.1<br>
>>><br>
>>> /Users/Shared/DREAM3D_SDK/InsightToolkit-4.8.1/Modules/Core/Common/<br>
>>> include/itkImageAlgorithm.h:26:12: fatal error: 'tr1/type_traits' file<br>
>>> not found<br>
>>> # include <tr1/type_traits><br>
>>><br>
>>> I compiled ITK with C++ 11 support by initializing ITK’s CMake cache<br>
>>> with the following values:<br>
>>><br>
>>><br>
>>> echo "CMAKE_CXX_STANDARD=11" >> $cacheFile<br>
>>> echo "CMAKE_CXX_STANDARD_REQUIRED:BOOL=ON" >> $cacheFile<br>
>>> echo “CMAKE_OSX_DEPLOYMENT_TARGET=10.7" >> $cacheFile<br>
>>> echo "CMAKE_OSX_SYSROOT:Path=$OSX_SDK" >> $cacheFile<br>
>>> echo "CMAKE_CXX_FLAGS:STRING=-stdlib=libc++ -std=c++11 " >> cacheFile<br>
>>><br>
>>> ITK seemed to compile and install but I only compiled the libraries and<br>
>>> none of the tests.<br>
>>><br>
>>> Has anyone ever had this issue? And what do I need to do to solve it.<br>
><br>
> Where the same CMake variables used when building your codes? All<br>
> these should be consistent throughout all compiled and linked code.<br>
><br>
> Hope this helps,<br>
> Matt<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>