libEGPythia6.so in MacOSX 10.6 snow leopard

Hi ,

I have installed ROOTv5.24/00 on MacOSX 10.6.2 Snow Leopard.
Instration finished with no Error.
But , When I try Pythia6 in ROOT, I’ve got follow error.

root [0] gSystem->Load(“libEG.so”)
(int)0
root [2] gSystem->Load(“libEGPythia6.so”)
dlopen error: dlopen(/Users/hashimotokimiaki/CERN/rootsys/lib/root/./libEGPythia6.so, 9): Library not loaded: /Users/hashimotokimiaki/pythia6/libPythia6.dylib
Referenced from: /Users/hashimotokimiaki/CERN/rootsys/lib/root/./libEGPythia6.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/hashimotokimiaki/CERN/rootsys/lib/root/./libEGPythia6.so
(int)(-1)
*** Interpreter error recovered ***

There is libPythia6.so in Users/hashimotokimiaki/CERN/rootsys/lib/root/./libEGPythia6.

My gcc,g++,gfortran is
gcc version 4.4.1 (GCC) (from fink)

./configure --prefix=/Users/hashimotokimiaki/CERN/rootsys --enable-pythia6 --with-pythia6-libdir=/Users/hashimotokimiaki/CERN/pythia6

Help me.

see example in $ROOTSYS/tutorials/pythia/pythiaExample.C
you must load libPythia6 before libEGPythia6.
Also note that with macos10.6 you do not need the dylib anymore, only .so
I suggest to use 5.26 instead of 5.24

Rene

Hi

I removed v5.24 and installed v5.26/00.

My gcc,g++,gfortran is
gcc version 4.4.1 (GCC) (from fink)

./configure --prefix=/Users/hashimotokimiaki/CERN/rootsys --enable-pythia6 --with-pythia6-libdir=/Users/hashimotokimiaki/CERN/pythia6

So, try, but I got same error.

root [0] gSystem->Load(“libEG.so”)
(int)0
root [1] gSystem->Load(“libPythia6.so”)
(int)0
root [2] gSystem->Load(“libEGPythia6.so”)
dlopen error: dlopen(/Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so, 9): Library not loaded: /Users/hashimotokimiaki/pythia6/libPythia6.dylib
Referenced from: /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
(int)(-1)
*** Interpreter error recovered ***

In /Users/hashimotokimiaki/pythia6 could you do

ln -s libPythia6.dylib libPythia6.so or rebuild pythia6 with your latest compiler?

Rene

gcc-4 mean gcc 4.4.1 (from fink)
gcc mean gcc 4.2.1 (Apple Inc. build 5646)

1)Try link
In /Users/hashimotokimiaki/CERN/pythia6
ln -s libPythia6.dylib libPythia6.so

But , I got same error.
root [0] gSystem->Load(“libEG.so”)
(int)0
root [1] gSystem->Load(“libPythia6.so”)
(int)0
root [2] gSystem->Load(“libEGPythia6.so”)
dlopen error: dlopen(/Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so, 9): Library not loaded: /Users/hashimotokimiaki/pythia6/libPythia6.dylib
Referenced from: /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
(int)(-1)
*** Interpreter error recovered ***

  1. rebuild Pythia6 gcc-4

I have maked ROOTv5.26 by gcc4.4.1(from fink).But , To build libPythia6.so and .dylib, I have used gcc4.2.1(Apple Inc. build 5646) .
So, Try to rebuild libPythia6 by gcc4.4.1(from fink).

First , Edit makePythia6.macosx64 by emacs , Simply change gcc to gcc-4

And rebuild libPythia6…
sudo ./makePythia6.macosx64

/Users/hashimotokimiaki/CERN/pythia6% ls -l
total 22032
-rwxr-xr-x 1 root wheel 3.7M 2 4 16:25 libPythia6.dylib*
lrwxr-xr-x 1 root wheel 16B 2 4 16:25 libPythia6.so@ -> libPythia6.dylib

But , In ROOT I got same error.

  1. rebuild root
    Next , rebuild ROOTv5.26/00 by gcc4.4.1 useing libPythia6 that rebuild by gcc4.4.1.
    Same error…

How did you install pythia6? Did you follow the instructions on our install page? For example if you have a 64 bits mac, you should do something like:

code [180] cat makePythia6.macosx64

/bin/sh

Pythia6 compiled with gfortran on MacOS X >= 10.4

Look for a fink installation

FINKDIR=which fink 2>&1 | sed -ne "s/\/bin\/fink//p"
macosx_minor=sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2

gfortran -m64 -c pythia*.f
gfortran -m64 -fno-second-underscore -c tpythia6_called_from_cc.F
echo ‘void MAIN__() {}’ > main.c
gcc -m64 -c main.c
gcc -m64 -c pythia6_common_address.c
rm -f libPythia6.dylib libPythia6.so
gcc -m64 -dynamiclib -single_module -undefined dynamic_lookup
-install_name $HOME/pythia6/libPythia6.dylib -o libPythia6.dylib
main.o tpythia6_called_from_cc.o pythia*.o
gfortran -m64 -print-file-name=libgfortran.dylib
gfortran -m64 -print-file-name=libgfortran.a
ln -s libPythia6.dylib libPythia6.so[/code]

Rene

I have 64bit mac.
To install pythia6, I get source here(ftp://root.cern.ch/root/pythia6.tar.gz).

Here is my makePythia6.macosx64.
and gcc-4 indicate gcc 4.4.1(from fink)

/Users/hashimotokimiaki/CERN/pythia6% cat makePythia6.macosx64

/bin/sh

Pythia6 compiled with gfortran on MacOS X >= 10.4

Look for a fink installation

FINKDIR=which fink 2>&1 | sed -ne "s/\/bin\/fink//p"
macosx_minor=sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2

gfortran -m64 -c pythia*.f
gfortran -m64 -fno-second-underscore -c tpythia6_called_from_cc.F
echo ‘void MAIN__() {}’ > main.c
gcc-4 -m64 -c main.c
gcc-4 -m64 -c pythia6_common_address.c
rm -f libPythia6.dylib libPythia6.so
gcc-4 -m64 -dynamiclib -single_module -undefined dynamic_lookup
-install_name $HOME/pythia6/libPythia6.dylib -o libPythia6.dylib
main.o tpythia6_called_from_cc.o pythia*.o
gfortran -m64 -print-file-name=libgfortran.dylib
gfortran -m64 -print-file-name=libgfortran.a
ln -s libPythia6.dylib libPythia6.so

Fons will follow this problem once he will be back.
Meanwhile, can you execute $ROOTSYS/tutorials/pythia/pythiaExample.C ?

Rene

Hi

Meanwhile, can you execute $ROOTSYS/tutorials/pythia/pythiaExample.C ?
Can not execute.I got same error.

root [0] .L pythiaExample.C
root [1] makeEventSample(1000)
dlopen error: dlopen(/Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so, 9): Library not loaded: /Users/hashimotokimiaki/pythia6/libPythia6.dylib
Referenced from: /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
(int)(-1)
*** Interpreter error recovered ***

Did you add /Users/hashimotokimiaki/pythia6/ to your DYLD_LIBRARY_PATH?

export DYLD_LIBRARY_PATH=/Users/hashimotokimiaki/pythia6:$DYLD_LIBRARY_PATH

Add this in your .bash_profile. I’ve there:

export PYTHIA6=~/Dropbox/src/pythia6 # must contain libPythia6
export DYLD_LIBRARY_PATH=$PYTHIA6:$DYLD_LIBRARY_PATH

The $PYTHIA6 is also used by the ./configure script to find the location of PYTHIA6, so no need to add that to the ./configure anymore.

Cheers, Fons.

1 Like

Also just doing:

root [1] gSystem->Load("libEGPythia6.so") 

will be enough. ROOT will automatically load the libEG and libPythia6 since it knows these dependencies via the libEGPythia6.rootmap file.

– Fons

My Settings…

export ROOTSYS=/Users/hashimotokimiaki/CERN/rootsys
export PATH=$PATH:$ROOTSYS/bin
export PYTHIA6=/Users/hashimotokimiaki/CERN/pythia6/
export DYLD_LIBRARY_PATH=PYTHIA6:$DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$ROOTSYS/lib/root:$DYLD_LIBRARY_PATH

There is libPythia6.dylib and .so in PYTHIA6.

The error message is: image not found. So there must be a typo somewhere. Does you get something when you do:

(proof) [168] otool -L $PYTHIA6/libPythia6.so
/Users/rdm/Dropbox/src/pythia6/libPythia6.so:
        /Users/rdm/pythia6/libPythia6.dylib (compatibility version 0.0.0, current version 0.0.0)
        /sw/lib/gcc4.4/lib/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

Also the trailing / in $PYTHIA6 is not needed.

Cheers, Fons.

otool output…
/Users/hashimotokimiaki/CERN/pythia6% otool -L $PYTHIA6/libPythia6.so
/Users/hashimotokimiaki/CERN/pythia6//libPythia6.so:
/Users/hashimotokimiaki/pythia6/libPythia6.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
/sw/lib/gcc4.4/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

After remove “/” from $PYTHIA6 ,rebuildlibPythia6.so and ROOT.
Next , try to run tutorials/pythia/pythiaExample.C
root [0] .L pythiaExample.C
root [1] makeEventSample(1000)
dlopen error: dlopen(/Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so, 9): Library not loaded: /Users/hashimotokimiaki/pythia6/libPythia6.dylib
Referenced from: /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
(int)(-1)
*** Interpreter error recovered ***

Do you have both gfortran in /usr/loca/lib and /sw/lib/gcc4.4/lib from Fink? My version of libPythia6 is not linked with libgcc_s.

Are all those libs used by libPythia6 available on your system?

Cheers, Fons.

Hi ,

In /usr/local/lib , there are follow libs and objectfiles about gfortran
/usr/local/lib/libgfortran.2.0.0.dylib* /usr/local/lib/libgfortran.a
/usr/local/lib/libgfortran.2.dylib@ /usr/local/lib/libgfortran.dylib@
/usr/local/lib/libgfortran.3.dylib* /usr/local/lib/libgfortran.la*

Here,
libgfortran.dylib@ → libgfortran.3.dylib
/usr/local/lib/libgfortran.2.dylib@ → libgfortran.2.0.0.dylib

And in /sw/lib/gcc4.4/lib,
/sw/lib/gcc4.4/lib/libgfortran.3.dylib* /sw/lib/gcc4.4/lib/libgfortran.dylib@
/sw/lib/gcc4.4/lib/libgfortran.a /sw/lib/gcc4.4/lib/libgfortran.la*

Here ,
/sw/lib/gcc4.4/lib/libgfortran.dylib@ → libgfortran.3.dylib

Are all those libs used by libPythia6 available on your system?
libPythia6.dylib
libgfortran.3.dylib
libgcc_s.1.dylib
libSystem.B.dylib
are exactly exist in their directry.

Why do have tow sets of libs. Mixing the does not look like a good idea. Anyway, you still cannot load the libEGPythia6?

– Fons

I can not remember why 2 different version exist.
But , execute gfortran-uninstall. So,libgfortran.2.0.0.dylib in /usr/local/lib/ is removed.Now , single version(libgfortran.3.dylib) is exist.And in /sw/lib/gcc4.4/lib , libgfortran.3.dylib exist.

But , situation didn’t change.
1)rebuild libPythia6
2)rebuild ROOT
3)run /tutorials/pythiapythiaExample.C

root [0] .L pythiaExample.C
root [1] makeEventSample(1000)
dlopen error: dlopen(/Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so, 9): Library not loaded: /Users/hashimotokimiaki/pythia6/libPythia6.dylib
Referenced from: /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
Reason: image not found
Load Error: Failed to load Dynamic link library /Users/hashimotokimiaki/CERN/rootsys/lib/root/libEGPythia6.so
(int)(-1)
*** Interpreter error recovered ***

otool output is same ,
libPythia6.dylib:
/Users/hashimotokimiaki/pythia6/libPythia6.dylib (compatibility version 0.0.0, current version 0.0.0)
/sw/lib/gcc4.4/lib/x86_64/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
/sw/lib/gcc4.4/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)

Seems to be an issue with your libPythia6.so, can you do:

root [0] gSystem->Load("$PYTHIA6/libPythia6.so")
(int)0

?

– Fons

Yes , I can.

/Users/hashimotokimiaki% root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.26/00 14 December 2009 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      [root.cern.ch](http://root.cern.ch)            *
    
  •                                     *
    

ROOT 5.26/00 (trunk@31882, Dec 14 2009, 20:18:36 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.17.00, Dec 21, 2008
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] gSystem->Load("$PYTHIA6/libPythia6.so")
(int)0
root [1]