Ld: 1059 duplicate symbols for architecture x86_64

Hi, everyone!

I’ve been trying to compile and build TMVA, according to the instructions on:


I have a Mac Os X 10.8.4.

First, I created the .bash_profile on Emacs with the following environment variables:

export ROOTSYS=/root/root-v5-34-00-patches
export PATH=$PATH:$ROOTSYS/bin

as suggested in: root.cern.ch/root/EnvVars.html

Then, I opened a terminal and wrote: cd $ROOTSYS/tmva. Enter
Then I wrote: make. Enter

After a few seconds, terminal showed the following message:

“ld: 1059 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libTMVA.dylib] Error 1”

I did’nt know what to do, but I followed with the next instruction. So, I opened a terminal in X11 and wrote:

cd /root/root-v5-34-00-patches/tmva/test. Enter

Then I wrote: source setup.sh. Enter
Then I wrote: root -l TMVAClassification.C . Enter

It opened ROOT, but It showed the following message:

“Error in TUnixSystem::DynamicPathName: libTMVA.1[.so | .dll | .dylib | .sl | .dl | .a] does not exist in …/lib:/root/root-v5-34-00-patches/lib:/root/root-v5-34-00-patches/tmva/lib:/root/root-v5-34-00-patches/lib::::…/lib:/root/root-v5-34-00-patches/cint/cint/stl” <<<<<mesagge important

Then it started TMVAClassification, but then it showed the message: “sh: wget: command not found
Error in TFile::TFile: file ./tmva_class_example.root does not exist
Error: illegal pointer to class object input 0x0 6 TMVAClassification.C:208:
— TMVAClassification : Using input file: (class G__CINT_ENDL)140563175411472
*** Interpreter error recovered ***”

However, when I run the program: root -l TMVARegression.C , it didn’t have any problem, despite sending the same message that I put with the arrows <<<<. I could see the GUI described in the “howto” site.

I hope someone can help me to solve these errors and finally start to work with TMVA.

Thanks in advance.


I think the “libTMVA” should be built when you install ROOT (it’s enabled by default, I believe).
root-config --has-tmva
and see if you get “yes”, or try:
root-config --features
and see if there’s “tmva” in the returned string.

That said, I think you might have destroyed your ROOT distribution when you manually called “make” the the “tmva” subdirectory (well, maybe the ROOT’s “libTMVA” got destroyed, for example).

The “wget” is as external utility. You need to add it to your MacOs (I assume there’s a binary package with that name).
Add also “curl” (another similar utility that ROOT may try to use; again, there should be a binary package for MacOS).

I think you should use “source /Full/Path/To/Your/Root/bin/thisroot.sh” in your “.bash_profile”, but if you really want to set environment variables manually, do remember to PREPEND new entries:
export PATH=$ROOTSYS/bin:$PATH

Do remember, if you plan to (re)build ROOT … first REMOVE all ROOT related entries from your “.bash_profile” then re-login (so that everything is really gone from your current environment), then remove the “destination subdirectory” (so that there are no remnants from any previous trials) and start with a “fresh” source code (i.e. remove the “source subdirectory” and unpack the source code again).

Good afternoon:

Thank your for your suggestions. It worked! I run the macro suggested in: tmva.sourceforge.net/howto.shtml


root -l TMVAClassification.C

It works well. Thank you very much!