# Problems while building CERN ROOT form source (gmake: \*\*\* \[all\] Error)

**URL:** <https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964>\
**Category:** ROOT\
**Created:** [October 22, 2020, 7:19pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964 "2020-10-22T19:19:23Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 22, 2020, 7:19pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/1 "2020-10-22T19:19:23Z")

</div>

I was working on the building process for Root from listed here :` https://root.cern/install/build_from_source/`

However after use `¨cmake --build . --target install¨` or `¨cmake -j1¨`  
i reach a 93% and then get this error:

```auto
usr/lib/libgif.so: error adding symbols: File in wrong format collect2: 
error: ld returned 1 exit status 
gmake[2]: *** [lib/libASImage.so] Error 1 
gmake[1]: *** [graf2d/asimage/CMakeFiles/ASImage.dir/all] Error 2 
gmake: *** [all] Error 2

```

I think the problems could be due to some wrong location of l`ibgif`, but i don’t know how figure out.

Have you guys faced this issue before?

Any suggestion would be appreciate…

---

<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:** [October 22, 2020, 7:25pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/2 "2020-10-22T19:25:45Z")

</div>

It looks like you’re trying to link against the 32 bit version of `libgif.so`. Try to install the `x86_64` version of it

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 22, 2020, 11:32pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/3 "2020-10-22T23:32:42Z")

</div>

> [@bellenot](#):
>
> `x86_64`

Thanks for your response!!

This will be basic questions…  
`rpm -ql` shows `/usr/lib64/libgif.so.4`  
and `/usr/lib64/libgif.so.4.1.6` . Are those the correct versions? if so, How can i indicate in the build process to search in /lib64 instead of /lib?

---

<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:** [October 23, 2020, 7:18am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/4 "2020-10-23T07:18:33Z")

</div>

But ld complains about `usr/lib/libgif.so` - I hope that’s actually `/usr/lib/libgif.so`? What does `file /usr/lib/libgif.so` say? Could you post your `CMakeCache.txt`? Which version of CMake do you use? Which operating system is this on?

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 23, 2020, 2:25pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/5 "2020-10-23T14:25:22Z")

</div>

Hi Alex, thanks for your response!  
Here is what i got:

1. `file /usr/lib/libgif.so` gives `/usr/lib/libgif.so: symbolic link to libgif.so.4.1.6'`

2. Cmake version is `3.15.2`

3. for `cat CmakeCache.txt`…I didn’t get if you were asking for some specific line or the complete file. let me know about it to edit this message since i can’t paste all the info due to the limit number of characters for this message(Cache file is ~150000/32000 😬).

---

<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:** [October 23, 2020, 2:54pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/6 "2020-10-23T14:54:25Z")

</div>

1. Could you _attach_ `CmakeCache.txt`?
2. What does `file /usr/lib/libgif.so.4.1.6` show?
3. Which operating system is this on?

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 23, 2020, 3:25pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/7 "2020-10-23T15:25:20Z")

</div>

Here is what i got:

1. `file /usr/lib/libgif.so.4.1.6` gives `/usr/lib/libgif.so.4.1.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=a688fbf12df2ef8ef5dec5cd658d1d9d22b5607a, stripped`

2. `file /usr/lib64/libgif.so.4.1.6` gives:` /usr/lib64/libgif.so.4.1.6: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=1019d5696d5724e1eabe8725aa77df05f0439849, stripped`

3. My os is : `SLF 7.8 (Nitrogen)`

lastly my .txt file

[CMakeCache.txt](https://root-forum.cern.ch/uploads/short-url/7a44FdTe7mt7v9ltDZpsS4tDoRw.txt) (133.4 KB)

---

<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:** [October 26, 2020, 10:16am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/8 "2020-10-26T10:16:40Z")

</div>

OK so CMake prefers a 32bit library over the correct 64bit library, for some reason. You initially invoked `cmake` with some flags (you can see them with `cat recmake_*` in the build directory).

Can you `rm CmakeCache.txt` and re-run `cmake` with those flags? What is the output? It should say “Looking for gif…” or similar - that’s what I care about. And: what _are_ the `cmake` flags you use?

Cheers, Axel.

---

<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:** [October 26, 2020, 10:18am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/9 "2020-10-26T10:18:40Z")

</div>

…and btw you should be able to take our CentOS7 binaries for your system, or even pull in the packages from EPEL - in general there’s no need for your to build ROOT yourself unless you need to debug something, develop ROOT,…

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 27, 2020, 1:59am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/10 "2020-10-27T01:59:52Z")

</div>

Hi Alex!! first of all, thanks for all your help so far, I really appreciate the time you spent in this post…  
I’m trying to set up all this software in a Server, i tried to use `yum ...` the first time but then i realized that i don’t have any root privilege in the server. That’s why i’m doing all this stuff (If there is an easier way to setup the software without using “root-privileges” and i’m to dumb to see it, please let me know)

for `cat recmake_*` in` ../root-6.20.04/build-root`

```auto
cat recmake_initial.sh 
#!/bin/sh
rm -f CMakeCache.txt
/emph/app/ydeniz/local/bin/cmake -DCMAKE_INSTALL_PREFIX="/emph/app/ydeniz/Cern_Root/root-6.20.04/install-root" /emph/app/ydeniz/Cern_Root/root-6.20.04

```

and

```auto
 cat recmake_replay.sh 
#!/bin/sh
rm -f CMakeCache.txt
/emph/app/ydeniz/local/bin/cmake -DCMAKE_INSTALL_PREFIX="/emph/app/ydeniz/Cern_Root/root-6.20.04/install-root" /emph/app/ydeniz/Cern_Root/root-6.20.04

```

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 27, 2020, 3:42pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/11 "2020-10-27T15:42:35Z")

</div>

> [@Axel](#):
>
> `cat recmake_*`

I’m following the instructions here: `https://root.cern/install/#build-from-source`  
in my first attempt the flags were:

```auto
 cmake -DCMAKE_INSTALL_PREFIX=../root-6.20.04/install-root /root-6.20.04

```

then:

```auto
cmake --build . -- install -j1 # i got in troubles in this step.

```

---

<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:** [October 27, 2020, 3:59pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/12 "2020-10-27T15:59:56Z")

</div>

Thanks. What’s the output of `rm CMakeCache.txt; cmake -DCMAKE_INSTALL_PREFIX=../root-6.20.04/install-root /root-6.20.04`? Can you attach it?

Alternatively you might be able to simply untar [https://root.cern/download/root\_v6.22.02.Linux-centos7-x86\_64-gcc4.8.tar.gz](https://root.cern/download/root_v6.22.02.Linux-centos7-x86_64-gcc4.8.tar.gz) and use that!

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 27, 2020, 7:08pm UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/13 "2020-10-27T19:08:04Z")

</div>

Seems working!  
I download the link that you suggested Axel.  
I untar, realize the `/bin` directory inside the directory `/root` and just run the programs (i didn’t use cmake at all), Seems working, but is that the correct way?.. I spent almost a week trying to get ROOT working.

if so, i don’t understand what did i do wrong in the previous build process. Sorry if this is a basic question… I don’t see any /bin directory in my previous attempts. However, in your approach there is a `/bin` right away, Why is that?

Here is the info that you required, the output of `-DCMAKE_INSTALL_PREFIX=../root-6.20.04/install-root /root-6.20.04` :  
[OUTPUT.txt](https://root-forum.cern.ch/uploads/short-url/cVLrFB8YMEq9S1bcbSDrlIeicbQ.txt) (11.0 KB)

---

<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:** [October 28, 2020, 9:24am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/14 "2020-10-28T09:24:41Z")

</div>

> Seems working, but is that the correct way?

Yes.

> However, in your approach there is a `/bin` right away, Why is that?

Because you downloaded our binaries for CentOS7, and they seem to work for your system, too. It’s like when you download an app - you usually don’t compile your Firefox either 😉

> the output of [cmake]

Thanks! Suuuper weird. CMake seems to simply take the 32bit lib! @oshadura any idea what could be the cause here? Note that the OP said:

> [@DENIZ0499](#):
>
> Cmake version is `3.15.2`

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![DENIZ0499](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/deniz0499/32/23745_2.png) [@DENIZ0499](https://root-forum.cern.ch/u/DENIZ0499)\
**Post date:** [October 28, 2020, 11:43am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/15 "2020-10-28T11:43:34Z")

</div>

Thanks for all your Help @Axel !!!  
The main problem was my lack of experience😅

I’m so excited about having things working

Best!! Yael.

---

<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:** [November 11, 2020, 11:43am UTC](https://root-forum.cern.ch/t/problems-while-building-cern-root-form-source-gmake-all-error/41964/16 "2020-11-11T11:43:36Z")

</div>

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