You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With ROOT-10692 fixed, ROOT now, by default, uses the default C++ standard of the compiler rather than always using C++11. However, due to how our cmake logic is structured, root7 is still turned off by default, even if the default C++ standard used by the compiler was detected to be C++14 or higher.
Expected behavior
With a compiler that defaults to -std=C++14 or above, a vanilla cmake path/to/root should have root7 turned on.
Additional context
I think the root cause is that, at the following lines in our main CMakeLists.txt, we first include RootBuildOptions (which sets root7 to OFF by default because it doesn't detect a high-enough C++ standard) and then we include CheckCompiler, which sets our default CMAKE_CXX_STANDARD to the compiler default.
#---Load some basic macros which are needed later for the confiuration and build----------------
include(SearchRootCoreDeps)
include(RootBuildOptions)
include(RootMacros)
include(CheckCompiler)
include(CheckAssembler)
include(CheckIntrinsics)
Moving include(CheckCompiler) above include(RootBuildOptions) fixes this issue but breaks Windows, because some cmake variable that CheckCompiler needs in the case of windows were defined earlier.
The text was updated successfully, but these errors were encountered:
Looking into it a bit more, I think the right fix is indeed to move CheckCompiler above RootBuildOptions, and then fix the problem with Windows.
That problem is a circular dependency:
RootBuildOptions.cmake depends on CheckCompiler.cmake, because e.g. the default value of the root7 option (set in RootBuildOptions) depends on the value of CMAKE_CXX_STANDARD (set in CheckCompiler)
however, CheckCompiler.cmake includes SetUpWindows.cmake, which uses CMAKE_INSTALL_INCLUDEDIR in a couple of install commands. CMAKE_INSTALL_INCLUDEDIR is set by RootInstallDirs which is included by RootBuildOptions, completing the circle
@amadio suggested moving the install commands Windows needs from SetUpWindows to RootConfiguration.
eguiraud
added a commit
to eguiraud/root
that referenced
this issue
Sep 22, 2020
Otherwise features like root7 that depend on compiler support are turned
off by default even if, later, we add the required compilation flags.
This fixesroot-project#6406.
Otherwise features like root7 that depend on compiler support are turned
off by default even if, later, we add the required compilation flags.
This fixes#6406.
Describe the bug
With ROOT-10692 fixed, ROOT now, by default, uses the default C++ standard of the compiler rather than always using C++11. However, due to how our cmake logic is structured, root7 is still turned off by default, even if the default C++ standard used by the compiler was detected to be C++14 or higher.
Expected behavior
With a compiler that defaults to
-std=C++14
or above, a vanillacmake path/to/root
should have root7 turned on.Additional context
I think the root cause is that, at the following lines in our main
CMakeLists.txt
, we first includeRootBuildOptions
(which sets root7 to OFF by default because it doesn't detect a high-enough C++ standard) and then we includeCheckCompiler
, which sets our defaultCMAKE_CXX_STANDARD
to the compiler default.root/CMakeLists.txt
Lines 128 to 134 in 33458dc
Moving
include(CheckCompiler)
aboveinclude(RootBuildOptions)
fixes this issue but breaks Windows, because some cmake variable thatCheckCompiler
needs in the case of windows were defined earlier.The text was updated successfully, but these errors were encountered: