# Make error of an example

**URL:** <https://root-forum.cern.ch/t/make-error-of-an-example/44669>\
**Category:** Garfield++\
**Created:** [May 1, 2021, 12:03pm UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669 "2021-05-01T12:03:34Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 1, 2021, 12:03pm UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/1 "2021-05-01T12:03:35Z")

</div>

Hi,

I have installed Garfield++ on lxplus but during building an example by using make , i found the attached error !! Does anyone know where exactly the problem and how to solve ??

/cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86\_64-centos7-gcc10-opt/bin/cmake: /cvmfs/sft.cern.ch/lcg/external/gcc/4.8.4/x86\_64-slc6-gcc48-opt/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86_64-centos7-gcc10-opt/bin/cmake) /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86_64-centos7-gcc10-opt/bin/cmake: /cvmfs/sft.cern.ch/lcg/external/gcc/4.8.4/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6: version `GLIBCXX\_3.4.20’ not found (required by /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86\_64-centos7-gcc10-opt/bin/cmake)  
/cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86\_64-centos7-gcc10-opt/bin/cmake: /cvmfs/sft.cern.ch/lcg/external/gcc/4.8.4/x86\_64-slc6-gcc48-opt/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86_64-centos7-gcc10-opt/bin/cmake) /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86_64-centos7-gcc10-opt/bin/cmake: /cvmfs/sft.cern.ch/lcg/external/gcc/4.8.4/x86_64-slc6-gcc48-opt/lib64/libstdc++.so.6: version `GLIBCXX\_3.4.21’ not found (required by /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86\_64-centos7-gcc10-opt/bin/cmake)  
/cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86\_64-centos7-gcc10-opt/bin/cmake: /cvmfs/sft.cern.ch/lcg/external/gcc/4.8.4/x86\_64-slc6-gcc48-opt/lib64/libstdc++.so.6: version `CXXABI\_1.3.9’ not found (required by /cvmfs/sft.cern.ch/lcg/releases/CMake/3.18.4-2ffec/x86\_64-centos7-gcc10-opt/bin/cmake)  
make: \*\*\* [cmake\_check\_build\_system] Error 1

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 1, 2021, 12:21pm UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/2 "2021-05-01T12:21:06Z")

</div>

Hi,  
there seem to be some inconsistencies in your environment (gcc 10 vs. gcc 4.8.4). How did you set it up? Can you try with an LCG view, for instance

```auto
source /cvmfs/sft.cern.ch/lcg/views/LCG_99/x86_64-centos7-gcc10-opt/setup.sh

```

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 1, 2021, 12:34pm UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/3 "2021-05-01T12:34:06Z")

</div>

Thanks a lot , it is working , but when i run any example this error appear ,is it has a relation??

terminate called after throwing an instance of ‘std::logic\_error’  
what(): basic\_string::\_M\_construct null not valid  
Aborted (core dumped)

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [May 1, 2021, 10:27pm UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/4 "2021-05-01T22:27:41Z")

</div>

Hi @Tahany,

To me it seems that it doesn’t; the exception that you mentioned is thrown if you construct a `std::string` providing `(const char *)nullptr` as argument. We are missing important information, though; could you please attach the the code that you are trying to run?

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 2, 2021, 8:38am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/5 "2021-05-02T08:38:25Z")

</div>

Hello @jalopezg

Thanks for your response , the idea that , i get this error during running any Garfield++ example so , I thought that , anyway I attach a general basic example ( gem example) and i will try to mimic your solution into the others [gem.C](https://root-forum.cern.ch/uploads/short-url/q615zd1tMi2XwUiOy2HAbGSM3Sg.C) (4.5 KB) s .

Best wishes,  
Tahany

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 2, 2021, 8:56am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/6 "2021-05-02T08:56:04Z")

</div>

The culprit might be the line  
`const std::string path = getenv("GARFIELD_HOME");`  
Is this variable defined in your environment? What do you get when you type

```auto
echo $GARFIELD_HOME

```

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 2, 2021, 9:03am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/7 "2021-05-02T09:03:48Z")

</div>

@hschindl

I get this directory  
/cvmfs/sft.cern.ch/lcg/releases/Garfield++/HEAD-09e01/x86\_64-centos7-gcc10-opt

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 2, 2021, 10:08am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/8 "2021-05-02T10:08:29Z")

</div>

Ah, sorry for that, I think that may be a side effect of some recent changes.  
Where is the Garfield++ source directory on your machine?  
Can you try re-setting the `GARFIELD_HOME` variable to this directory? Something like

```auto
export GARFIELD_HOME=/home/user/path_to_garfield_src_dir

```

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 2, 2021, 10:14am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/9 "2021-05-02T10:14:25Z")

</div>

@hschindl , Exactly the problem was as you mentioned , it was in defining GAFIELD\_HOME , now most of them are working well , thank you 🙂  
but , what if I got this error , what do you think about ?  
terminate called after throwing an instance of ‘std::bad\_alloc’  
what(): std::bad\_alloc  
Aborted (core dumped)

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 2, 2021, 10:26am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/10 "2021-05-02T10:26:20Z")

</div>

Hm, that seems to be something else. Is this what you get when you run the `gem.C` program you sent earlier? Can you post/attach the full output you get when running the program?

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 2, 2021, 10:31am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/11 "2021-05-02T10:31:10Z")

</div>

No, it has no relation about garfield basic example , it is another one related to RPC.

omponentNeBem3d::Initialise:  
Prepared weighting field for readout group “BotGra”.  
E = ( -0.00000000, -0.00000000 70833.71188276), V = 7083.37941689, status = -5  
Sensor::AddElectrode:  
Added readout electrode “BotGra”.  
All signals are reset.  
Sensor::SetTimeWindow: Resetting all signals.  
Event = 1  
: Cluster = 1 :  
clust\_present :1, nel: 25  
j= 0xele, yele, zele, tele: -4.72707e-05 -7.29063e-05 0.0332024 0.00268757  
terminate called after throwing an instance of ‘std::bad\_alloc’  
what(): std::bad\_alloc  
Aborted (core dumped)

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 2, 2021, 10:32am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/12 "2021-05-02T10:32:45Z")

</div>

Can you attach the source code of the program?

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 2, 2021, 10:55am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/13 "2021-05-02T10:55:35Z")

</div>

could i send it by email because it is not for public ?!

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 2, 2021, 10:57am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/14 "2021-05-02T10:57:08Z")

</div>

Yes, no prob.

---

<div class="post-metadata">

**Author:** ![Tahany](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/c6cbf5/32.png) [@Tahany](https://root-forum.cern.ch/u/Tahany)\
**Post date:** [May 2, 2021, 11:01am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/15 "2021-05-02T11:01:19Z")

</div>

Ok , Thanks

---

<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:** [May 16, 2021, 11:01am UTC](https://root-forum.cern.ch/t/make-error-of-an-example/44669/16 "2021-05-16T11:01:51Z")

</div>

Closed on May 16, 2021, 11:01am UTC

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