Skip to content

ENH: Upgrade ITK from C++11 to C++14#2563

Merged
dzenanz merged 3 commits intoInsightSoftwareConsortium:masterfrom
N-Dekker:CXX_STANDARD-from-11-to-14
Jun 3, 2021
Merged

ENH: Upgrade ITK from C++11 to C++14#2563
dzenanz merged 3 commits intoInsightSoftwareConsortium:masterfrom
N-Dekker:CXX_STANDARD-from-11-to-14

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

@N-Dekker N-Dekker commented May 31, 2021

Follow-up to commit babb677
"COMP: Enforce building ITK with C++11", Hans Johnson (@hjmjohnson), 19 January 2018

Discussion item: https://discourse.itk.org/t/may-we-start-using-c-14-at-the-master-branch/4172

@github-actions github-actions bot added the type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots label May 31, 2021
Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like rolling version updates like this.

@N-Dekker N-Dekker force-pushed the CXX_STANDARD-from-11-to-14 branch from 4086301 to af772d9 Compare May 31, 2021 16:41
@N-Dekker N-Dekker marked this pull request as ready for review May 31, 2021 16:41
@N-Dekker N-Dekker changed the title WIP: ENH: Upgrade ITK from C++11 to C++14 ENH: Upgrade ITK from C++11 to C++14 May 31, 2021
@N-Dekker N-Dekker force-pushed the CXX_STANDARD-from-11-to-14 branch from af772d9 to 0b0ca59 Compare June 1, 2021 08:23
@github-actions github-actions bot added the type:Enhancement Improvement of existing methods or implementation label Jun 1, 2021
@N-Dekker N-Dekker requested a review from dzenanz June 1, 2021 08:24
@N-Dekker N-Dekker force-pushed the CXX_STANDARD-from-11-to-14 branch from 0b0ca59 to a1df8f7 Compare June 1, 2021 13:34
@github-actions github-actions bot added the area:Core Issues affecting the Core module label Jun 1, 2021
@jhlegarreta
Copy link
Copy Markdown
Member

jhlegarreta commented Jun 1, 2021

The requirements in the ITK SW Guide (section Configuring and Building ITK) will need to be updated accordingly, and revise if specificities about the Implementation Language still hold.

Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good

Comment thread CMake/itkCompilerChecks.cmake Outdated
N-Dekker added a commit to N-Dekker/ITKSoftwareGuide that referenced this pull request Jun 1, 2021
Following pull request InsightSoftwareConsortium/ITK#2563
"ENH: Upgrade ITK from C++11 to C++14"

Suggested by Jon Haitz Legarreta Gorroño
Follow-up to commit babb677
"COMP: Enforce building ITK with C++11", Hans Johnson, 19 January 2018
@N-Dekker N-Dekker force-pushed the CXX_STANDARD-from-11-to-14 branch from a1df8f7 to 5539f55 Compare June 1, 2021 14:02
@N-Dekker N-Dekker requested a review from jhlegarreta June 1, 2021 14:05
Copy link
Copy Markdown
Member

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not have a strong opinion on this, since I do not use ITK in my daily work (and henc eI have not voiced my opinion in discourse), but in the past I have seen some resistance to such changes in some contexts (e.g. people maintaining an application that depends on ITK like to see long time support).

Relevant to this, it may be worthwhile revisiting the deprecation cycle statement in https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/master/SoftwareGuide/Latex/Introduction/Installation.tex#L27. I do not know if this change complies with that. If it does, it is a strong argument for it.

@N-Dekker
Copy link
Copy Markdown
Contributor Author

N-Dekker commented Jun 1, 2021

@jhlegarreta

in the past I have seen some resistance to such changes in some contexts (e.g. people maintaining an application that depends on ITK like to see long time support).

Thanks for your very relevant comment, Jon. Generally speaking there are always users who want to stick to the old standards, and those who prefer the latest and greatest. To me, a move to C++14 feels like a compromise, as it is quite an old standard revision already. C++17, which has quite some more interesting features, seems generally available for a while already. But then the relevant question is of course, whether there are still ITK users who would want to keep up-to-date with the latest ITK version, while requiring an older C++ version.

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Jun 1, 2021

VS2015 now has some extended support until 2025, while mainstream support ended in March 2020 (more than a year ago). And since VS2017 and 2019 are compatible with VS2015's CRT, I think it is OK to drop support for VS2015 now.

Comment on lines +191 to +192
# if defined(__clang__) && (__cplusplus < 201402L)
# error "Apple LLVM < 5.1 (clang < 3.4) is not supported under ITKv5.3"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that ITK.macOS.Python (Azure.Mac-1622555791099 Darwin-Build4705-PR2563-CXX_STANDARD-from-11-to-14-Python) fails here, because defined(__clang__) && (__cplusplus < 201402L)

At https://open.cdash.org/viewBuildError.php?buildid=7259248

Any suggestion? Is the compiler properly set to C++14 for ITK.macOS.Python?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@N-Dekker this may need to be updated:

if(CMAKE_CXX_EXTENSIONS)
set(_castxml_cc_flags "${_castxml_cc_flags} ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}")
else()
set(_castxml_cc_flags "${_castxml_cc_flags} ${CMAKE_CXX11_STANDARD_COMPILE_OPTION}")
endif()

Comment thread CMake/itkCompilerChecks.cmake Outdated
@N-Dekker N-Dekker force-pushed the CXX_STANDARD-from-11-to-14 branch from 5539f55 to a35dcbb Compare June 2, 2021 09:15
Comment thread CMake/itkCompilerChecks.cmake Outdated
@N-Dekker N-Dekker force-pushed the CXX_STANDARD-from-11-to-14 branch from a35dcbb to 40a795f Compare June 2, 2021 14:42
N-Dekker added a commit to N-Dekker/ITKSoftwareGuide that referenced this pull request Jun 8, 2021
Following pull request InsightSoftwareConsortium/ITK#2563
"ENH: Upgrade ITK from C++11 to C++14"

Suggested by Jon Haitz Legarreta Gorroño
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Aug 26, 2021
C++14 is a small extension over C++11, featuring mainly bug fixes and small improvements: https://en.wikipedia.org/wiki/C%2B%2B14

This commit follows ITK pull request InsightSoftwareConsortium/ITK#2563 commit InsightSoftwareConsortium/ITK@daec0fd "ENH: Upgrade ITK from C++11 to C++14" (1 June 2021).
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Aug 26, 2021
C++14 is a small extension over C++11, featuring mainly bug fixes and small improvements: https://en.wikipedia.org/wiki/C%2B%2B14

This commit follows ITK pull request InsightSoftwareConsortium/ITK#2563 commit InsightSoftwareConsortium/ITK@daec0fd "ENH: Upgrade ITK from C++11 to C++14" (1 June 2021).

Follow-up to pull request #123 commit b84ab47 "ENH: Explicitly set CMAKE_CXX_STANDARD to 11", by Kasper Marstal, 8 March 2019
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Aug 27, 2021
C++14 is a small extension over C++11, featuring mainly bug fixes and small improvements: https://en.wikipedia.org/wiki/C%2B%2B14

This commit follows ITK pull request InsightSoftwareConsortium/ITK#2563 commit InsightSoftwareConsortium/ITK@daec0fd "ENH: Upgrade ITK from C++11 to C++14" (1 June 2021).

Follow-up to pull request #123 commit b84ab47 "ENH: Explicitly set CMAKE_CXX_STANDARD to 11", by Kasper Marstal, 8 March 2019
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 24, 2022
ITKv5.3 requires at least MSVC version 1910 (Visual Studio 2017) now, so
it is no longer useful to check if `MSVC_VERSION GREATER_EQUAL 1600`, or
`1800`, or `MSVC_VERSION GREATER 1310`.

Checks on `CMAKE_COMPILER_2005` (Visual Studio 2005) are also obsolete.

Follow-up to:

pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on on 3 June 2021)
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 24, 2022
ITKv5.3 requires at least MSVC version 1910 (Visual Studio 2017) now, so
it is no longer useful to check if `MSVC_VERSION GREATER_EQUAL 1600`, or
`1800`, or `MSVC_VERSION GREATER 1310`.

Checks on `CMAKE_COMPILER_2005` (Visual Studio 2005) are also obsolete.

Follow-up to:

pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on on 3 June 2021)
hjmjohnson pushed a commit that referenced this pull request Mar 25, 2022
ITKv5.3 requires at least MSVC version 1910 (Visual Studio 2017) now, so
it is no longer useful to check if `MSVC_VERSION GREATER_EQUAL 1600`, or
`1800`, or `MSVC_VERSION GREATER 1310`.

Checks on `CMAKE_COMPILER_2005` (Visual Studio 2005) are also obsolete.

Follow-up to:

pull request #2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on on 3 June 2021)
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 26, 2022
For Apple, ITKv5.3 ("itkCompilerChecks.cmake") requires at least LLVM
Clang 3.4 or GCC 5.1.

Follow-up to:

pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on 3 June 2021)
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 26, 2022
ITKv5.3 ("itkCompilerChecks.cmake") requires at least GCC 5.1.

Follow-up to:

pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on 3 June 2021)
hjmjohnson pushed a commit that referenced this pull request Mar 28, 2022
For Apple, ITKv5.3 ("itkCompilerChecks.cmake") requires at least LLVM
Clang 3.4 or GCC 5.1.

Follow-up to:

pull request #2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on 3 June 2021)
hjmjohnson pushed a commit that referenced this pull request Mar 28, 2022
ITKv5.3 ("itkCompilerChecks.cmake") requires at least GCC 5.1.

Follow-up to:

pull request #2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"
(merged on 3 June 2021)
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Nov 14, 2022
GCC 4 support was dropped with pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14", June 3, 2021
hjmjohnson pushed a commit that referenced this pull request Nov 19, 2022
GCC 4 support was dropped with pull request #2563
commit 4e812d6
"COMP: Require compiler versions that support C++14", June 3, 2021
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 17, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit daec0fd
"ENH: Upgrade ITK from C++11 to C++14"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 18, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit daec0fd
"ENH: Upgrade ITK from C++11 to C++14"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 18, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit daec0fd
"ENH: Upgrade ITK from C++11 to C++14"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 22, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit daec0fd
"ENH: Upgrade ITK from C++11 to C++14"
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 22, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"

Resources:

C++ reference - Compiler support for C++17
https://en.cppreference.com/w/cpp/compiler_support/17
Note that for C++17 "hardware interference size" support, we would need GCC 12
and Clang 15.

C++17 Support in GCC
https://gcc.gnu.org/projects/cxx-status.html#cxx17

Announcing: MSVC Conforms to the C++ Standard, Ulzii Luvsanbat, May 7th, 2018
https://devblogs.microsoft.com/cppblog/announcing-msvc-conforms-to-the-c-standard/

C++17 Features Supported by Intel C++ Compiler Classic, Last Updated: 09/12/2020 By Anoop Madhusoodhanan Prabha
https://www.intel.com/content/www/us/en/developer/articles/news/c17-features-supported-by-c-compiler.html

Xcode clang version record, Masayuki Yamaya, December 14, 2022
https://gist.github.com/yamaya/2924292
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 22, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"

Resources:

C++ reference - Compiler support for C++17
https://en.cppreference.com/w/cpp/compiler_support/17
Note that for C++17 "hardware interference size" support, we would need GCC 12
and Clang 15.

C++17 Support in GCC
https://gcc.gnu.org/projects/cxx-status.html#cxx17

Announcing: MSVC Conforms to the C++ Standard, Ulzii Luvsanbat, May 7th, 2018
https://devblogs.microsoft.com/cppblog/announcing-msvc-conforms-to-the-c-standard/

C++17 Features Supported by Intel C++ Compiler Classic, Last Updated: 09/12/2020 By Anoop Madhusoodhanan Prabha
https://www.intel.com/content/www/us/en/developer/articles/news/c17-features-supported-by-c-compiler.html

Xcode clang version record, Masayuki Yamaya, December 14, 2022
https://gist.github.com/yamaya/2924292
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Mar 23, 2023
Follow-up to pull request InsightSoftwareConsortium#2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"

Resources:

C++ reference - Compiler support for C++17
https://en.cppreference.com/w/cpp/compiler_support/17
Note that for C++17 "hardware interference size" support, we would need GCC 12
and Clang 15.

C++17 Support in GCC
https://gcc.gnu.org/projects/cxx-status.html#cxx17

Announcing: MSVC Conforms to the C++ Standard, Ulzii Luvsanbat, May 7th, 2018
https://devblogs.microsoft.com/cppblog/announcing-msvc-conforms-to-the-c-standard/

C++17 Features Supported by Intel C++ Compiler Classic, Last Updated: 09/12/2020 By Anoop Madhusoodhanan Prabha
https://www.intel.com/content/www/us/en/developer/articles/news/c17-features-supported-by-c-compiler.html

Xcode clang version record, Masayuki Yamaya, December 14, 2022
https://gist.github.com/yamaya/2924292
dzenanz pushed a commit that referenced this pull request Mar 30, 2023
Follow-up to pull request #2563
commit daec0fd
"ENH: Upgrade ITK from C++11 to C++14"
dzenanz pushed a commit that referenced this pull request Mar 30, 2023
Follow-up to pull request #2563
commit 4e812d6
"COMP: Require compiler versions that support C++14"

Resources:

C++ reference - Compiler support for C++17
https://en.cppreference.com/w/cpp/compiler_support/17
Note that for C++17 "hardware interference size" support, we would need GCC 12
and Clang 15.

C++17 Support in GCC
https://gcc.gnu.org/projects/cxx-status.html#cxx17

Announcing: MSVC Conforms to the C++ Standard, Ulzii Luvsanbat, May 7th, 2018
https://devblogs.microsoft.com/cppblog/announcing-msvc-conforms-to-the-c-standard/

C++17 Features Supported by Intel C++ Compiler Classic, Last Updated: 09/12/2020 By Anoop Madhusoodhanan Prabha
https://www.intel.com/content/www/us/en/developer/articles/news/c17-features-supported-by-c-compiler.html

Xcode clang version record, Masayuki Yamaya, December 14, 2022
https://gist.github.com/yamaya/2924292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module type:Documentation Documentation improvement or change type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants