How to fix the error "recipe for target 'lib/libCore.so' failed" during installation?

Hi everyone,
Today I attempted to install latest pro version of root on my Ubuntu 16.04 (gcc 5.4) for the first time using the following URL Install and Build Root in the following steps:

tar zxvf root_v6.08.06.source.tar.gz
cd Downloads/root-6.08.06/
./configure --all --fail-on-missing
make

I remember just before make, it said make is deprecated and cmake is used instead but I could not run gmake either. So I was left with make only.

However, at the very end of make, (after 3 hours) there was an error saying:

collect2: error: ld returned 1 exit status
Makefile:874: recipe for target ‘lib/libCore.so’ failed
make: *** [lib/libCore.so] Error 1

What is the issue? Is there anyway to fix it? Am I using a correct method to install root?log.txt (11.1 KB)log.txt (176.6 KB)

Hi,

Ideally you run

mkdir build-dir
cd build-dir
cmake <path-to-ROOT-sources>
make -j8

We can also debug what’s wrong with your build, but the part you pasted is missing the actual error message - that might be a few pages before. You can just re-run make and at some point it will move all the way to the end, making it easier to find.

Axel.

1 Like

make -j 8 may be too aggressive on some older computers. I have frozen many a computer by doing that.

Thanks Axel.
I just added the log file in which there are some clues about the issue. Can you see the uploaded file? I had set up my python to to Anaconda version and somehow ‘disable’ system’s own python version. Could that be an issue? What should I do now?

I also extracted and build the root in the same place namely Downloads directory. Could that be the reason of failure? How would you go about it step by step?

Building in Downloads should not be a problem. You only posted stdout. Please run make > log.txt 2>&1 and post log.txt.

Axel

Oops. OK, just updated the log.txt file. I hope that will be helpful,

Hi,

You have a broken installation of your compiler: what is invoked as g++ behaves like gcc, it doesn’t link against the c++ libraries. Any insight on why that might be? I don’t think we will be able to help you maintain your system - but some of the readers might have a few recommendations if you specify how you installed g++ and why it might misbehave etc.

Good luck!

Axel

Hi Axel, I really don’t know how to answer that question. All I know is that I installed my Ubuntu in a dual boot along with my Windows 7 on the same pc using USB according to the following page (https://www.ubuntu.com/download/desktop/install-ubuntu-desktop) with all the defaults as they were. But I remember once I mistakenly deleted some packages and then tried to undo that by installing them back again. I don’t know if gcc and/or g++ were among them or not but here is the output of two commands:

username@username-Rev-1-0:~$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
username@username-Rev-1-0:~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Is there any hope to fix the whole mess?

I tried to remove g++ and gcc completely and then reinstall them. But even that didn’t resolve the issue. I am not sure why g++ is behaving like gcc! What are my options at this point? I also tried to disable my anaconda version of the python by commenting it out in bashrc file and instead use the system’s own version of python package (Which I assume is needed as a prerequisite) but I am not sure if that’s even related to my issue. I just don’t know what to do. Any help?

Looks like anaconda is injecting its own libstdc++. Evil. Can you mv ~/anaconda ~/anaconda-BAK (or wherever you have it) and try again?

1 Like

Thanks Axel for figuring out the issue. Yes that evil was the problem. Can I now rename the folders of Anacoda2-BAK and 3-BAK in the home directory as they were before AND add the line in bashrc (export PATH="/home/username/anaconda3/bin:$PATH"), or should I proceed with something else when running python codes? (because I have all the modules and packages available through anaconda and I prefer to use them rather than system’s python.)

Sincerely,

I don’t know - you probably have to rebuild ROOT pointing CMake to Anaconda’s compiler, to be compatible with the compiler injected by Anaconda… Please report your findings; I’m sure other people will run into this, too.

@Danilo @etejedor - any experience with this?

Cheers, Axel.

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