Building error in KALI Linux subsystem


ROOT Version: latest
Platform: Kali linux subsystem for windows
Hi, while trying to build root in Kali subsystem for windows I get this error which don’t know how to fix.

 
[ 76%] Generating G__Core.cxx, ../lib/Core.pcm
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:75:
/usr/include/c++/11/valarray:1215:5: error: exception specification in declaration does not match previous declaration
    begin(valarray<_Tp>& __va) noexcept
    ^
/usr/include/c++/11/bits/range_access.h:107:31: note: previous declaration is here
  template<typename _Tp> _Tp* begin(valarray<_Tp>&);
                              ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:75:
/usr/include/c++/11/valarray:1226:5: error: exception specification in declaration does not match previous declaration
    begin(const valarray<_Tp>& __va) noexcept
    ^
/usr/include/c++/11/bits/range_access.h:108:37: note: previous declaration is here
  template<typename _Tp> const _Tp* begin(const valarray<_Tp>&);
                                    ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:75:
/usr/include/c++/11/valarray:1237:5: error: exception specification in declaration does not match previous declaration
    end(valarray<_Tp>& __va) noexcept
    ^
/usr/include/c++/11/bits/range_access.h:109:31: note: previous declaration is here
  template<typename _Tp> _Tp* end(valarray<_Tp>&);
                              ^
While building module 'Core':
While building module 'std' imported from input_line_1:1:
In file included from <module-includes>:75:
/usr/include/c++/11/valarray:1253:5: error: exception specification in declaration does not match previous declaration
    end(const valarray<_Tp>& __va) noexcept
    ^
/usr/include/c++/11/bits/range_access.h:110:37: note: previous declaration is here
  template<typename _Tp> const _Tp* end(const valarray<_Tp>&);
                                    ^
input_line_1:1:10: fatal error: could not build module 'std'
#include <new>

I followed the guide for building root located in https://root.cern/install/build_from_source/


Hi,
given the error message, clearing the build directory and reconfiguring with -Druntime_cxxmodules=OFF might work around the problem.

I can’t tell what might be wrong though. @Axel or @vvassilev might have better insights.

Cheers,
Enrico

Should I write -Druntime_cxxmodules=OFF in the options space while starting cmake? Like this for example

cmake --build . --target install -Druntime_cxxmodules=OFF

Hi Jacopo,
the -D configuration flags must be passed to cmake at configuration time, i.e. when you first run cmake without the --build . flag and it is configuring the build. Then cmake --build . starts the build.

Cheers,
Enrico

That seems to be a bug in the GCC headers?! Which exact GCC version is this?

Yup: libstdc++: Fix inconsistent noexcept-specific for valarray begin/end · gcc-mirror/gcc@423cd47 · GitHub

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.