Here is the error message that was popping up on my Mac OSX Big Sur (Apple clang version 12.0.5 (clang-1205.0.22.11)).
I fixed it by changing the CMakeLists.txt file. Wanted to post here incase other beginners face the same issue.
bash-3.2$ make
[ 50%] Building CXX object CMakeFiles/HelloWorld.dir/HelloWorld.cxx.o
In file included from /Users/veritas/GITROOT/ITIA/HelloWorld.cxx:27:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkImage.h:21:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkImageRegion.h:31:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkRegion.h:31:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkObject.h:31:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkLightObject.h:21:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkMacro.h:42:
/Users/veritas/bin/GITROOT/itk/Modules/Core/Common/itkConfigure.h:56:6: warning: "WARNING: The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK" [-W#warnings]
#warning "WARNING: The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK"
^
In file included from /Users/veritas/GITROOT/ITIA/HelloWorld.cxx:27:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkImage.h:21:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkImageRegion.h:31:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkRegion.h:31:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkObject.h:31:
In file included from /Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkLightObject.h:21:
/Users/veritas/GITROOT/ITK/Modules/Core/Common/include/itkMacro.h:192:6: error: "Apple LLVM < 5.1 (clang < 3.4) or compiling with a standard less than C++14 is not supported under ITKv5.3"
# error "Apple LLVM < 5.1 (clang < 3.4) or compiling with a standard less than C++14 is not supported under ITKv5.3"
^
I picked up the example from the github release branch with that path, created a new build folder, just copied over the CMakeLists and cxx file. Also used the latest version of cmake.
On the one hand, Iām wondering whether it makes sense/it is possible to inherit the flags from the upstream CMake files where the values are originally set. On the other hand, that example is just to illustrate a minimal CMakeLists.txt file in here (section 2.5.1; https://itk.org/ItkSoftwareGuide.pdf) (looks like the contents are outdated, and the file is not being read), so Iām not sure of the benefit of inheriting the flags.
Concerning the ITKSphinxExamples, it looks like the flags are being set to a value that is different from ITK, which might be fine unless there is a clash when using the SuperBuild. But it looks counter-intuitive to require a different version in the ITKSphinxExamples.
ITKSphinxExamples has not been updated to ITK 5.3 yet, so it still has the old CXX standard and version of CMake.
Each example in there is supposed to be standalone, thatās why it has so much duplication.
@krm15 is using an unusual ācompilerā (clang pretending to be GCC?), thatās why it might be defaulting to such an old version of C++ standard. I donāt know how prevalent such occurrence is. Also, the provided error message is clear and easily fixed for those who run into it.
. I am in favor of updating the ITKSphinxExamples. Matt may be in a better position to provide favourable/against arguments.
. Not sure next time the C++ standard is updated the CMAKE_CXX_STANDARD will be hit, and if it is, the contributor will update it (other hits corresponding to 3rd parties should be left apart), so maybe adding a note somewhere about updating C++ standards in general and the CMAKE_CXX_STANDARD flag in particular, could be a good idea/candidate for a documentation issue.
True, but at the same time:
I ignore how unusual these situations are.
I think it is preferable not to allow Examples/Installation to fail.