# Rootcling Errors on Rocky Linux

**URL:** <https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245>\
**Category:** ROOT\
**Tags:** root, rootcling\
**Created:** [November 24, 2023, 12:22pm UTC](https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245 "2023-11-24T12:22:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjt00](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@cjt00](https://root-forum.cern.ch/u/cjt00)\
**Post date:** [November 24, 2023, 12:22pm UTC](https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245/1 "2023-11-24T12:22:48Z")

</div>

I’m trying to use rootcling and rootcint as part of the build of various applications on a new system which uses Rocky Linux and these are currently failing with lots of errors like these:

```auto
[cthorpe@wn3803320 rootcling_test]$ rootcling -v4 -f ParticleDict.cxx -rmf libParticleDict.rootmap -rml libParticleDict.so LinkDef.h
In file included from input_line_3:2:
In file included from /cvmfs/larsoft.opensciencegrid.org/products/gcc/v8_2_0/Linux64bit+3.10-2.17/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/string:40:
In file included from /cvmfs/larsoft.opensciencegrid.org/products/gcc/v8_2_0/Linux64bit+3.10-2.17/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/bits/char_traits.h:40:
In file included from /cvmfs/larsoft.opensciencegrid.org/products/gcc/v8_2_0/Linux64bit+3.10-2.17/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/bits/postypes.h:40:
In file included from /cvmfs/larsoft.opensciencegrid.org/products/gcc/v8_2_0/Linux64bit+3.10-2.17/bin/../lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../include/c++/8.2.0/cwchar:44:
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:104:1: error: unknown type name '__BEGIN_NAMESPACE_C99'
__BEGIN_NAMESPACE_C99
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:106:1: error: expected unqualified-id
typedef __mbstate_t mbstate_t;
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:107:1: error: unknown type name '__END_NAMESPACE_C99'
__END_NAMESPACE_C99
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:112:23: error: unknown type name 'mbstate_t'
__USING_NAMESPACE_C99(mbstate_t)
                      ^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:112:33: error: expected ';' after top level declarator
__USING_NAMESPACE_C99(mbstate_t)
                                ^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:134:1: error: unknown type name '__BEGIN_NAMESPACE_STD'
__BEGIN_NAMESPACE_STD
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:137:1: error: expected unqualified-id
struct tm;
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:138:1: error: unknown type name '__END_NAMESPACE_STD'
__END_NAMESPACE_STD
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:142:23: error: unknown type name 'tm'
__USING_NAMESPACE_STD(tm)
                      ^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:145:1: error: expected function body after function declarator
__BEGIN_NAMESPACE_STD
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:168:1: error: unknown type name '__END_NAMESPACE_STD'
__END_NAMESPACE_STD
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:172:1: error: expected unqualified-id
extern int wcscasecmp (const wchar_t * __s1, const wchar_t *__ s2) __THROW;
^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/etc/cling/lib/clang/5.0.0/include/wchar.h:180:11: fatal error: 'xlocale.h' file not found
# include <xlocale.h>
          ^ ~~~~~~~~~~
#0 0x0000147babe5562f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x0000147babe532ce llvm::sys::RunSignalHandlers() (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x250b2ce)
#2 0x0000147babe53506 SignalHandler(int) Signals.cpp:0:0
#3 0x0000147ba8f43cf0 __restore_rt (/lib64/libpthread.so.0+0x12cf0)
#4 0x0000147ba9c763d4 ROOT::TMetaUtils::TNormalizedCtxtImpl::keepTypedef(cling::LookupHelper const&, char const*, bool) (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x32e3d4)
#5 0x0000147ba9c764f0 ROOT::TMetaUtils::TNormalizedCtxtImpl::TNormalizedCtxtImpl(cling::LookupHelper const&) (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x32e4f0)
#6 0x0000147ba9c76648 ROOT::TMetaUtils::TNormalizedCtxt::TNormalizedCtxt(cling::LookupHelper const&) (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x32e648)
#7 0x0000147ba9cd85a6 TCling::TCling(char const*, char const*, char const* const*) (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x3905a6)
#8 0x0000147ba9cd8bc6 CreateInterpreter (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x390bc6)
#9 0x0000147ba9323456 TROOT::InitInterpreter() (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCore.so+0x1d2456)
#10 0x0000147ba9323598 ROOT::Internal::GetROOT2() (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCore.so+0x1d2598)
#11 0x0000147ba9cb732d TCling__GetInterpreter (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x36f32d)
#12 0x0000147ba9c9c036 RootClingMain(int, char**, bool, bool) (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x354036)
#13 0x0000147ba9ca3377 ROOT_rootcling_Driver (/cvmfs/larsoft.opensciencegrid.org/products/root/v6_18_04d/Linux64bit+3.10-2.17-e19-prof/lib/libCling.so+0x35b377)
#14 0x0000000000400be7 (rootcling+0x400be7)
#15 0x0000147ba8288d85 __libc_start_main (/lib64/libc.so.6+0x3ad85)
#16 0x0000000000400c24 (rootcling+0x400c24)
Stack dump:
0.	Program arguments: rootcling -v4 -f ParticleDict.cxx -rmf libParticleDict.rootmap -rml libParticleDict.so LinkDef.h 
[SimParticle.h|attachment](upload://yPywTCftzXA1GLcFPYl5PVp7odT.h) (397 Bytes)
[SimParticle.cc|attachment](upload://98BZjsOXyyPF97iK2kkCeYHOXtq.cc) (82 Bytes)
[LinkDef.h|attachment](upload://fkr0yXyzohySGjcKg2UhRQinWEN.h) (154 Bytes)

 ***Break*** segmentation violation

```

The only obvious change I can think of that might have caused this the move to a new OS, previously I was working with SL7 on which all of this works fine. I’ve checked with the same version of root, same compiler etc on the old SL7 system and the above command works just fine.

_ROOT Version:_ 6.18.04  
_Platform:_ Rocky Linux 8.9  
_Compiler:_ GCC 8.2.0

* * *

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [November 25, 2023, 3:57pm UTC](https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245/2 "2023-11-25T15:57:57Z")

</div>

Hi @cjt00, welcome back to the ROOT forum!

Hmm, looks like something is wrong with the compiler setup of gcc and clang. The headers from the GCC STL are trying to include some headers from clang, for whatever reason.

> The only obvious change I can think of that might have caused this the move to a new OS, previously I was working with SL7 on which all of this works fine. I’ve checked with the same version of root, same compiler etc on the old SL7 system and the above command works just fine.
> 
> _ROOT Version:_ 6.18.04  
> _Platform:_ Rocky Linux 8.9  
> _Compiler:_ GCC 8.2.0

With “same version of ROOT”, do you mean the exact same ROOT build on cvmfs? If yes, this seems like it would never work. SL 7 is based on RHEL 7, and Rocky 8.9 is based on RHEL 8. It’s guaranteed that something goes wrong if you mix and match packages from different major RHEL versions like that. How did you make sure to even have the same compiler version? Maybe that’s where the problem with the environment comes from.

Maybe this post is also helpful to you:

> [@Unpleasantly late ROOT 6.10.04 compilation error with GCC 7.1](https://root-forum.cern.ch/t/unpleasantly-late-root-6-10-04-compilation-error-with-gcc-7-1/26074/6):
>
> Looks like all your problems stem from your gcc distribution. The CMake file shipped with ROOT copies the wchar.h file from your distribution before compilation (core/clingutils/CMakeLists.txt): # These headers do not have complete include guards on all platforms we # support. This means that the PCH cannot provide their representation at # runtime and clang will hit disk, triggering a possible incompatibility # of that file in build-time versus run-time (different length etc). # Capture their …

Cheers,  
Jonas

---

<div class="post-metadata">

**Author:** ![cjt00](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@cjt00](https://root-forum.cern.ch/u/cjt00)\
**Post date:** [November 27, 2023, 10:05am UTC](https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245/3 "2023-11-27T10:05:53Z")

</div>

Hi @jonas thanks for the response.

I’ve checked and yes they’re using exactly the same versions of root and gcc from exactly the same locations on cvmfs.

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [November 27, 2023, 2:13pm UTC](https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245/4 "2023-11-27T14:13:16Z")

</div>

> I’ve checked and yes they’re using exactly the same versions of root and gcc from exactly the same locations on cvmfs.

Ok, then I think this is the problem, already starting with gcc. You can’t use gcc compiled for SL7 (i.e. RHEL 7) on Rocky Linux 8 (based on RHEL 8). You need to RHEL 8 packages all the way if you want things to work. In this case, the problem is not related to ROOT, and you should maybe ask your system administrator what to do.

In other works, after this major OS update you can’t use the same binaries on cvmfs, and that’s your problem. Or did I misunderstand something?

Note that there are plenty of ROOT builds on cvmfs for RHEL 8 (aka. CentOS 8), for example:

> **[Release 62806](https://root.cern/releases/release-62806/)**
>
> Retracted Due to a security vulnerability, this version of ROOT has been retracted; please upgrade to v6.28/10.

```auto
/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.28.06/x86_64-centos8-gcc85-opt

```

Can you not just use one of these?

---

<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:** [December 11, 2023, 2:13pm UTC](https://root-forum.cern.ch/t/rootcling-errors-on-rocky-linux/57245/5 "2023-12-11T14:13:36Z")

</div>

Closed on December 11, 2023, 2:13pm UTC

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