# Build ROOT 6.26.04 module Core and std problem (ubuntu 22.04)

**URL:** <https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742>\
**Category:** ROOT\
**Tags:** build\
**Created:** [July 9, 2022, 4:41pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742 "2022-07-09T16:41:55Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukroz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lukroz](https://root-forum.cern.ch/u/lukroz)\
**Post date:** [July 9, 2022, 4:41pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/1 "2022-07-09T16:41:55Z")

</div>

Hi. I have trouble with installing ROOT 6.26.04 on my ubuntu 22.04. I use cmake with that configurations:

> cmake $options Druntime\_cxxmodules=OFF -Dxrootd=0 -Dmemstat=0 -Dbuiltin\_afterimage=0 -Dbuiltin\_glew=0 -Dbuiltin\_ftgl=0 -Dbuiltin\_veccore=1 -Droofit=1 -Dunuran=1 -Dminuit2=1 -Dmathmore=1 -Dtmva=0 -Dfftw3=1 -Dvdt=0 -Dgenvector=1 -Dopengl=1 -Dsoversion=1 -Dexplicitlink=1 -DCMAKE\_CXX\_FLAGS=-D\_\_ROOFIT\_NOBANNER -DCMAKE\_INSTALL\_PREFIX=…/install $sources

Below I add error message. I will be grateful for any help.

```plaintext
> While building module 'Core':
> While building module 'std' imported from input_line_1:1:
> In file included from <module-includes>:76:
> /usr/include/c++/10/valarray:1214:5: error: exception specification in declaration does not match previous declaration
> begin(valarray<_Tp>& __va) noexcept
> ^
> /usr/include/c++/10/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>:76:
> /usr/include/c++/10/valarray:1224:5: error: exception specification in declaration does not match previous declaration
> begin(const valarray<_Tp>& __va) noexcept
> ^
> /usr/include/c++/10/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>:76:
> /usr/include/c++/10/valarray:1234:5: error: exception specification in declaration does not match previous declaration
> end(valarray<_Tp>& __va) noexcept
> ^
> /usr/include/c++/10/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>:76:
> /usr/include/c++/10/valarray:1249:5: error: exception specification in declaration does not match previous declaration
> end(const valarray<_Tp>& __va) noexcept
> ^
> /usr/include/c++/10/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>
> ~~~~~~~~ ^
> Warning in cling::IncrementalParser::CheckABICompatibility():
> Failed to extract C++ standard library version.
> While building module 'Core':
> While building module 'Cling_Runtime' imported from input_line_2:1:
> While building module 'Cling_Runtime_Extra' imported from /home/lukasz/Install/root/v6-26-04/build/etc/cling/Interpreter/RuntimeUniverse.h:27:
> In file included from <module-includes>:1:
> /home/lukasz/Install/root/v6-26-04/build/etc/cling/Interpreter/DynamicExprInfo.h:13:10: fatal error: could not build module 'std'
> #include <string>
> ~~~~~~~~ ^
> /home/lukasz/Install/root/v6-26-04/build/etc/cling/Interpreter/RuntimeUniverse.h:27:10: fatal error: could not build module 'Cling_Runtime_Extra'
> #include "cling/Interpreter/Visibility.h"
> ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from input_line_3:1:
> In file included from /home/lukasz/Install/root/v6-26-04/build/etc/cling/lib/clang/9.0.1/include/assert.h:8:
> In file included from /usr/include/assert.h:35:
> In file included from /usr/include/features.h:510:
> /usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
> # include <gnu/stubs-32.h>
> ^ ~~~~~~~~~~~~~~~
> While building module 'Core':
> While building module 'ROOT_Rtypes' imported from /home/lukasz/Install/root/v6-26-04/build/include/Rtypes.h:23:
> In file included from <module-includes>:1:
> /home/lukasz/Install/root/v6-26-04/build/include/RtypesCore.h:28:10: fatal error: could not build module 'std'
> #include <cstddef> // size_t, NULL
> ~~~~~~~~ ^
> /home/lukasz/Install/root/v6-26-04/build/include/ThreadLocalStorage.h:60:10: fatal error: could not build module 'ROOT_Rtypes'
> #include "RtypesCore.h"
> ~~~~~~~~^~~~~~~~~~~~~~
> While building module 'Core':
> While building module 'ROOT_Foundation_Stage1_NoRTTI' imported from /home/lukasz/Install/root/v6-26-04/build/include/Rtypes.h:195:
> In file included from <module-includes>:2:
> In file included from /home/lukasz/Install/root/v6-26-04/build/include/ROOT/RStringView.hxx:30:
> /usr/include/c++/10/experimental/string_view:41:10: fatal error: could not build module 'std'
> #include <string>
> ~~~~~~~~ ^
> Error: Error loading the default rootcling header files.
> make[2]: *** [core/CMakeFiles/G __Core.dir/build.make:470: core/G__ Core.cxx] Error 1
> make[1]: *** [CMakeFiles/Makefile2:23504: core/CMakeFiles/G__Core.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs....
> [76%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TClingRdictModuleFileExtension.cxx.o
> [76%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TClingTypedefInfo.cxx.o
> [76%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TClingTypeInfo.cxx.o
> [76%] Building CXX object core/metacling/src/CMakeFiles/MetaCling.dir/TClingValue.cxx.o
> [76%] Built target MetaCling
> -- clad build command succeeded. See also /home/lukasz/Install/root/v6-26-04/build/interpreter/cling/tools/plugins/clad/clad-prefix/src/clad-stamp/clad-build-*.log
> [76%] Performing install step for 'clad'
> -- clad install command succeeded. See also /home/lukasz/Install/root/v6-26-04/build/interpreter/cling/tools/plugins/clad/clad-prefix/src/clad-stamp/clad-install-*.log
> [76%] Completed 'clad'
> [76%] Built target clad
> make: *** [Makefile:156: all] Error 2

```

_ROOT Version:_ 6.26.04  
_Platform:_ ubuntu 20.04  
_Compiler:_ gcc

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 9, 2022, 7:08pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/2 "2022-07-09T19:08:33Z")

</div>

First, welcome to the ROOT Forum! Then, do you really need to build from source? Why don’t you take a pre-built binary or use conda?

---

<div class="post-metadata">

**Author:** ![lukroz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lukroz](https://root-forum.cern.ch/u/lukroz)\
**Post date:** [July 9, 2022, 7:26pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/3 "2022-07-09T19:26:32Z")

</div>

Hi. I really prefer to build it from source.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 9, 2022, 7:31pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/4 "2022-07-09T19:31:18Z")

</div>

Then I don’t know, maybe try with `-DCMAKE_CXX_STANDARD=17`. And if it doesn’t work, we may need help from @Axel , once he’s back next week

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 9, 2022, 8:22pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/5 "2022-07-09T20:22:50Z")

</div>

Where does the “`/usr/include/c++/10`” come from?  
On Ubuntu 20.04, you should have “`/usr/include/c++/9`” (coming from :“`libstdc++-9-dev`”).  
On Ubuntu 22.04, you should have “`/usr/include/c++/11`” (coming from :“`libstdc++-11-dev`”).

---

<div class="post-metadata">

**Author:** ![lukroz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lukroz](https://root-forum.cern.ch/u/lukroz)\
**Post date:** [July 9, 2022, 9:29pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/6 "2022-07-09T21:29:19Z")

</div>

Thanks for your advice, but `-DCMAKE_CXX_STANDARD=17` did not work 😕

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 9, 2022, 9:36pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/7 "2022-07-09T21:36:34Z")

</div>

OK, but can you check what @Wile_E_Coyote [asked](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/5)?

---

<div class="post-metadata">

**Author:** ![amarcine](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amarcine/32/17539_2.png) [@amarcine](https://root-forum.cern.ch/u/amarcine)\
**Post date:** [July 11, 2022, 2:41pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/8 "2022-07-11T14:41:10Z")

</div>

Hello @bellenot and @Wile_E_Coyote,

I am working with @lukroz and can give more context.

The issue is that we need simultaneous installation of ROOT v5 and ROOT v6. ROOT v5 did not install with gcc 11, native to Ubuntu 22.04, so we’ve installed gcc 10 via alternatives. This allowed for installation of ROOT v5 and our experiment’s software which depends on it. Unfortunately ROOT v6-26-00 and 04 builds fail with gcc 10 even though these ROOT versions, with the same cmake options, build fine on Debian 11 with gcc 10.

**The error is actually coming from the call to rootcling to generate G\_\_Core.cxx**

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 11, 2022, 2:55pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/9 "2022-07-11T14:55:42Z")

</div>

You could try to configure it adding:  
`-DCMAKE_C_COMPILER=/full/path/to/your/gcc10 -DCMAKE_CXX_COMPILER=/full/path/to/your/g++10`

---

<div class="post-metadata">

**Author:** ![lukroz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lukroz](https://root-forum.cern.ch/u/lukroz)\
**Post date:** [July 11, 2022, 5:04pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/10 "2022-07-11T17:04:25Z")

</div>

@Wile_E_Coyote thanks for your advice, unfortunately the result did not change 😕

---

<div class="post-metadata">

**Author:** ![amarcine](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amarcine/32/17539_2.png) [@amarcine](https://root-forum.cern.ch/u/amarcine)\
**Post date:** [July 11, 2022, 5:19pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/11 "2022-07-11T17:19:16Z")

</div>

Does it affect rootcling?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [July 11, 2022, 6:18pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/14 "2022-07-11T18:18:01Z")

</div>

When building your new ROOT 6, are you sure that nothing in your environment points to another ROOT version that you have (e.g., via “`${ROOTSYS}`” or “`${PATH}`” or “`${LD_LIBRARY_PATH}`” or “`${PYTHONPATH}`”)?

---

<div class="post-metadata">

**Author:** ![lukroz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/57b2e6/32.png) [@lukroz](https://root-forum.cern.ch/u/lukroz)\
**Post date:** [July 11, 2022, 6:30pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/15 "2022-07-11T18:30:29Z")

</div>

Yes, I am sure.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 25, 2022, 6:30pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/16 "2022-07-25T18:30:57Z")

</div>

Closed on July 25, 2022, 6:30pm UTC

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

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 10, 2022, 7:24am UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/17 "2022-11-10T07:24:38Z")

</div>

Turns out that this is a bug in libstdc++ :-/ There’s not much we can do about it; it has been fixed in updates of GCC, so updating your compiler might address this.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [November 10, 2022, 8:21am UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/18 "2022-11-10T08:21:44Z")

</div>

@Axel Maybe you could add some links to what you have found about it.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [November 11, 2022, 12:57pm UTC](https://root-forum.cern.ch/t/build-root-6-26-04-module-core-and-std-problem-ubuntu-22-04/50742/19 "2022-11-11T12:57:10Z")

</div>

Phew. OK here you go 🙂

[https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2b2d97fc545635a0f6aa9c9ee3b017394bc494bf](https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2b2d97fc545635a0f6aa9c9ee3b017394bc494bf)
