# Error running Geant4 examples macro with ROOT6 from trunk

**URL:** <https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285>\
**Category:** ROOT\
**Created:** [June 6, 2022, 7:04am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285 "2022-06-06T07:04:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr-xak](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mr-xak/32/29098_2.png) [@mr-xak](https://root-forum.cern.ch/u/mr-xak)\
**Post date:** [June 6, 2022, 7:04am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/1 "2022-06-06T07:04:13Z")

</div>

This is cross-post from Geant4 forum.

I’m running ROOT6 built from git source, tagged as 6.27/01. While trying to run /examples/extended/medical/dna/chem6 example of Geant4 using the provided ROOT macros files the execution fails. With the ‘plotG\_LET.C’ macro nothing happens, ROOT just exits withour warnings after several seconds, with ‘plotG\_time.C’ macro there is an error like

```auto
   ------------------------------------------------------------------
  | Welcome to ROOT 6.27/01 https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win64 on Mar 14 2022, 21:44:00 |
  | From heads/master@v6-25-02-723-g6c5bfb7480 |
  | With MSVC 19.29.30141.0 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

Processing plotG_time.C...
Assertion failed: LV.getLinkage() == T->getLinkage(), file D:\dev\otherProjects\ROOT6\root_trunk4\interpreter\llvm\src\tools\clang\lib\AST\Type.cpp, line 3746

```

and also exits. With some older version of ROOT these macro were started succesfully.

Mentioning @Axel, @bellenot

* * *

ROOT6 installed using the git clone command, opening cmake-gui within VS Command Prompt x64 environment, choosing x64 default option, adding -Thost=x64 to additional commands, changing CMAKE\_INSTALL\_PREFIX, calling Configure double times, Generate one time, than following to the build folder and running

```auto
cmake --build .
cmake --build . --target install

```

---

<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:** [June 7, 2022, 9:00am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/2 "2022-06-07T09:00:07Z")

</div>

Can you share the file `CMakeLists.txt` from your build directory, please?

@bellenot is the MSVC version the right one? Why do we have asserts on given the build steps mentioned above - is this even a release build?

---

<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:** [June 7, 2022, 9:06am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/3 "2022-06-07T09:06:55Z")

</div>

@Axel yes, this is the correct version of MSVC. @mr-xak please use this syntax to build ROOT on Windows:

```auto
cmake --build . --config Release

```

i.e. Specify the build type (Release, Debug, RelWithDebInfo)  
And meanwhile I’ll try to reproduce the problem.

---

<div class="post-metadata">

**Author:** ![mr-xak](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mr-xak/32/29098_2.png) [@mr-xak](https://root-forum.cern.ch/u/mr-xak)\
**Post date:** [June 7, 2022, 10:01am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/4 "2022-06-07T10:01:53Z")

</div>

You mean CMakeLists.txt of Geant4 example or from ROOT that I’ve installed?

In ROOT Build directory there is no CMakeLists.txt, only CMakeCache.txt

---

<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:** [June 7, 2022, 12:59pm UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/5 "2022-06-07T12:59:51Z")

</div>

Of ROOT, and yes I was distracted and meant `CMakeCache.txt` 🙂 Thanks!

---

<div class="post-metadata">

**Author:** ![mr-xak](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mr-xak/32/29098_2.png) [@mr-xak](https://root-forum.cern.ch/u/mr-xak)\
**Post date:** [June 7, 2022, 1:22pm UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/6 "2022-06-07T13:22:50Z")

</div>

While trying to rebuild with the current upstream forgot another problem of x64, that it is not building with builtin\_lzma

```auto
"D:\dev\otherProjects\ROOT6\root_trunk5_x64_build\ALL_BUILD.vcxproj" (целевой объект по умолчанию) (1) ->
"D:\dev\otherProjects\ROOT6\root_trunk5_x64_build\graf2d\asimage\G__ASImage.vcxproj" (целевой объект по умолчанию) (186
) ->
"D:\dev\otherProjects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj" (целевой объект по умолчанию) (187) ->
(Целевой объект Link) ->
  ZipLZMA.obj : error LNK2019: ссылка на неразрешенный внешний символ lzma_code в функции R__unzipLZMA. [D:\dev\otherPr
ojects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj]
  ZipLZMA.obj : error LNK2019: ссылка на неразрешенный внешний символ lzma_end в функции R__unzipLZMA. [D:\dev\otherPro
jects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj]
  ZipLZMA.obj : error LNK2019: ссылка на неразрешенный внешний символ lzma_lzma_preset в функции R__zipLZMA. [D:\dev\ot
herProjects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj]
  ZipLZMA.obj : error LNK2019: ссылка на неразрешенный внешний символ lzma_stream_encoder в функции R__zipLZMA. [D:\dev
\otherProjects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj]
  ZipLZMA.obj : error LNK2019: ссылка на неразрешенный внешний символ lzma_stream_decoder в функции R__unzipLZMA. [D:\d
ev\otherProjects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj]
  D:\dev\otherProjects\ROOT6\root_trunk5_x64_build\bin\libCore.dll : fatal error LNK1120: неразрешенных внешних элемент
ов: 5 [D:\dev\otherProjects\ROOT6\root_trunk5_x64_build\core\Core.vcxproj]

    Предупреждений: 6552
    Ошибок: 6

```

(sorry for russian output)

I need to explicitly uncheck this box in cmake-gui, and put the include/lib of pre-built liblzma.

I’ve put --config specification, rebuilt both x32 and x64 versions of ROOT using separate folders, and I can confirm that x32 version of the upstream having the same issue as described in the topic with Geant4 examples macros.

---

<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:** [June 7, 2022, 1:24pm UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/7 "2022-06-07T13:24:22Z")

</div>

I have no problem with LZMA. And I’m building Geant4 right now, will keep you updated

---

<div class="post-metadata">

**Author:** ![mr-xak](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mr-xak/32/29098_2.png) [@mr-xak](https://root-forum.cern.ch/u/mr-xak)\
**Post date:** [June 7, 2022, 1:28pm UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/8 "2022-06-07T13:28:13Z")

</div>

Here it is  
[CMakeCache.txt](https://root-forum.cern.ch/uploads/short-url/n2hUCwRldHXVN29pYBzrsP2MU1m.txt) (123.4 KB)

---

<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:** [June 7, 2022, 2:56pm UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/9 "2022-06-07T14:56:25Z")

</div>

So the problem comes from the Geant4 macros. Please try with these ones:  
[plotG\_LET.C](https://root-forum.cern.ch/uploads/short-url/jUgNFIYRMZiUDkwmFb6TdMmh9mU.C) (4.9 KB)  
[plotG\_time.C](https://root-forum.cern.ch/uploads/short-url/y3CiSf2mwCqY10MPhQFnqBMp8Vt.C) (6.5 KB)

---

<div class="post-metadata">

**Author:** ![mr-xak](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mr-xak/32/29098_2.png) [@mr-xak](https://root-forum.cern.ch/u/mr-xak)\
**Post date:** [June 7, 2022, 4:10pm UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/10 "2022-06-07T16:10:47Z")

</div>

Yes, these macros runs succesfully as intended. Thank you very much!  
Should I post this versions to Geant4 forum as the suggested modification?

---

<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:** [June 8, 2022, 7:13am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/11 "2022-06-08T07:13:54Z")

</div>

Yes, feel free to ask them, and please mention me, so they can come discuss with me if they want

---

<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:** [June 22, 2022, 7:13am UTC](https://root-forum.cern.ch/t/error-running-geant4-examples-macro-with-root6-from-trunk/50285/12 "2022-06-22T07:13:58Z")

</div>

Closed on June 22, 2022, 7:13am UTC

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