Linker problem with Mac OS 10.9 and libAfterImage

Hi,

I’m having problems compiling ROOT with the head version and following the instructions here: http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=17190&start=75

I also installed the latest XCode, the command-line tools and re-installed XQuartz.

The error message I get is:

clang++  -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude    -stdlib=libc++  -pthread -Igraf2d/asimage/src/libAfterImage -I. -I/Users/stefanohm/Software/root/cint/cint/inc  -o graf2d/asimage/src/G__ASImage.o -c graf2d/asimage/src/G__ASImage.cxx
clang++ -dynamiclib -single_module -Wl,-dead_strip_dylibs -install_name @rpath/libASImage.so -O2 -m64 -mmacosx-version-min=10.9 -stdlib=libc++ -o lib/libASImage.so graf2d/asimage/src/TASImage.o graf2d/asimage/src/TASPluginGS.o graf2d/asimage/src/G__ASImage.o -ldl -Llib -lGraf -lMathCore lib/libAfterImage.a -L/Users/stefanohm/Library/Enthought/Canopy_64bit/User/lib -lfreetype -lz -L/usr/local/lib -L/usr/local/lib -ljpeg -lpng -lz -L/usr/X11R6/lib -lXpm -L/usr/X11R6/lib -lXext -lX11 -Llib -lCore -lCint
Undefined symbols for architecture x86_64:
  "_png_set_longjmp_fn", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
      _png2ASImage_int in libAfterImage.a(import.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libASImage.so] Error 1

I have checked the png libraries in all folders and they are compatible with 64 and 32 bit, e.g.:

/usr/local/lib/libpng.dylib:           Mach-O universal binary with 2 architectures
/usr/local/lib/libpng.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/usr/local/lib/libpng.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64

Any help on how to resolve this is greatly appreciated.

configure.txt (6.81 KB)

All the best, Stefan

Hi! I have a similar problem, I’d posted a question in less specific thread, on various issues with Mac OS 10.9: viewtopic.php?f=3&t=17190&start=75#p73411. Maybe this is a more appropriate thread.

Thanks for the help

Paola

[quote=“paolafer”]Hi! I have a similar problem, I’d posted a question in less specific thread, on various issues with Mac OS 10.9: viewtopic.php?f=3&t=17190&start=75#p73411. Maybe this is a more appropriate thread.

Thanks for the help

Paola[/quote]

I checked the linker again and the problem seems to be with the libpng library, which is shipped with the Canopy Enthought python distribution. This libpng library 64-bit only version. And this causes the compilation to fail.

Hope that helps.

Cheers, Stefan

Hi again, I haven’t solved my problem, but I’ ve found a way to overcome it.
Since the makefile of the AfterImage library didn’t create the commands, for some reason, I executed by hand those commands, taken from another system where the compilation did work. I attach the file with these command, if anyone else should need them. After doing this, I could finish the compilation of ROOT without any other problem.

Update: although it compiled, I couldn’t look into histograms in a TBrowser(). I can open the TBrowser but when I click on the histogram, I get the following series of messages

[code]*** Break *** bus error
Generating stack trace…

Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: xcrun atos
To silence this warning, pass the ‘-d’ command-line flag to this tool.

0x000000010380d5d2 in TGX11TTF::RenderString(int, int, TVirtualX::ETextMode) (in libGX11TTF.so) + 706

Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: xcrun atos
To silence this warning, pass the ‘-d’ command-line flag to this tool.

0x0000000102cbd5e5 in TPad::PaintText(double, double, char const*) (in libGpad.so) + 101

Warning: /usr/bin/atos is moving and will be removed from a future OS X release.
It is now available in the Xcode developer tools to be invoked via: xcrun atos
To silence this warning, pass the ‘-d’ command-line flag to this tool.

0x0000000102a29eef in TLatex::Analyse(double, double, TextSpec_t, char const*, int) (in libGraf.so) + 46063

[/code]

I found a suggestion to fix to this problem in this thread

http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=17190&start=60

but that hasn’t worked. I’ve also looked in the graf2d/asimage/src/libAfterImage/config.h file and I don’t see any #define X_DISPLAY_MISSING. What else should I check?

Thank you

Paola
commands.txt (14.3 KB)

Hi there,

I now see this error when running my code. Has anyone had success in dealing with this?

Cheers,
Donal

Hello again,

I’ve updated the ROOT version to the changes of the last few days and I still have the same problem with libAfterImage.
However, after compiling that library “by hand”, when I try to open a TBrowser in an interactive session I have another kind of error, repeated a lot of times:

libpng warning: Application was compiled with png.h from libpng-1.5.11 libpng warning: Application is running with png.c from libpng-1.2.50 libpng error: Incompatible libpng version in application and library Warning in <TASImage::GetMask>: No image

After that, sometimes there’s a crash, sometimes I can open the TBrowser() but not navigating the content for problems in the visualization and sometimes I can do everything. It looks a bit strange to me.

Cheers

Paola

Hi Paola,

Could you post details of how you compiled the library by hand, so that I can try the same thing?

Googling the new error you see, I get quite a few results. This thread suggests that you may not have set LD_LIBRARY_PATH correctly in your .bash_profile:

linuxquestions.org/questions … ng-840821/

Have you got

export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

in your .bash_profile along with

export ROOTSYS=/usr/local/root/root.git
export PATH=$PATH:$ROOTSYS/bin

(I’m not sure if the root.git at the end is needed in ROOTSYS)

Cheers,
Donal

When I find the compilation error, I move to the graf2d/asimage/src/libAfterImage/ folder and I execute by hand the commands I attached in a previous post, by

It works, then I go back to the main ROOT folder and type

again. The installation ends normally (apparently).

Hi Paola,

I could run commands.sh, but running ‘make’ did not work for me afterwards. Does your machine use clang when running make? Your commands.sh has gcc compiler instructions, so I’m wondering wheter that could be my problem. My Mac uses clang which I believe is the default.

Cheers,
Donal

In my config.log I find the following checks:

Checking for C compiler
Result: clang
Checking for C++ compiler
Result: clang++
Checking for linker (LD)
Result: clang++

so I guess it’s using clang.

I’m not sure why it won’t work in my case, strange…

Just to document what I see currently, I get the error message:

*** Break *** bus error
Generating stack trace…
0x000000010d6ec5e2 in TGX11TTF::RenderString(int, int, TVirtualX::ETextMode) (in libGX11TTF.so) + 706
0x000000010a980645 in TPad::PaintText(double, double, char const*) (in libGpad.so) + 101
0x000000010a592fbf in TLatex::Analyse(double, double, TextSpec_t, char const*, int) (in libGraf.so) + 46063
0x000000010a594e23 in TLatex::PaintLatex(double, double, double, double, char const*) (in libGraf.so) + 4147
0x000000010a57e91a in TGaxis::PaintAxis(double, double, double, double, double&, double&, int&, char const*, double, bool) (in libGraf.so) + 27274
0x0000000151a3b376 in THistPainter::PaintAxis(bool) (in libHistPainter.so) + 2102
0x0000000151a3a23a in THistPainter::Paint(char const*) (in libHistPainter.so) + 1866
0x000000010a97d369 in TPad::Paint(char const*) (in libGpad.so) + 601
0x000000010a97d369 in TPad::Paint(char const*) (in libGpad.so) + 601
0x000000010a9826d9 in TPad::Print(char const*, char const*) (in libGpad.so) + 6121
0x000000010a983a2d in TPad::SaveAs(char const*, char const*) const (in libGpad.so) + 1021
0x0000000108b44c1a in Fitting::RunFullFit(bool) (in run) (Fitting.C:1156)
0x0000000108b357d9 in Fitting::Fitting(Parameters*, TApplication*) (in run) (Fitting.C:160)
0x0000000108b2a974 in main (in run) (ostream:1180)
0x00007fff910185fd in start (in libdyld.dylib) + 1
0x0000000000000009 in

right at the point where my code attempts to draw stuff onto a TCanvas. It creates the TCanvas objects and I see them blank on my screen, but it crashes shortly after.

Sorry to bump this again. Has anyone seen the same issue and found a solution? I’m afraid I’m stuck between a rock and a hard place, where older ROOT versions will not compile on OS X 10.9 and the latest version gives the error I posted above when drawing to a TCanvas.

Any help would be greatly appreciated!

Donal

Hi Donal,
I have exactly the same issue as you (and here are some other guys: pyRoot on OS X Maverick). My solution for now is a virtual machine.

edit: Batch mode still works.

Hi folks,

I’m glad to report that I have found another installation method which works for me. It uses Mac Ports.

The exact steps I followed to get it to work (by work I mean that ROOT installs correctly and my code compiles and runs without errors) are:

  1. Uninstall homebrew (if you don’t have it, you don’t need to worry!). I followed superuser.com/questions/203707/h … ge-manager

  2. Uninstall Mac Ports following guide.macports.org/chunked/insta … lling.html

  3. Put the line below in /opt/local/etc/macports/variants.conf:

-x11 +no_x11 +quartz +clang33

This I believe fixes the issues with x11 related stuff like the canvas printing.

  1. Starting from a fresh install of Mac Ports, do:

sudo port install root

and give it some time :slight_smile:

  1. After it is finished (takes quite a while), I had to put in my .bash_profile:

export ROOTSYS=/opt/local
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

If you have the line

export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH

remove it from your .bash_profile too.

Several of these steps (like uninstalling homebrew and the reinstall of MAc Ports) may not be necessary, but I wanted to make sure that they weren’t conflicting in terms of libraries.

Best of luck!
Donal

Hello,

I am having a similar problem with libAfterimage and mavericks. I tried compiling on my own, with the error

clang++ -dynamiclib -single_module -Wl,-dead_strip_dylibs -install_name @rpath/libASImage.so -O2 -m64 -mmacosx-version-min=10.9 -stdlib=libc++ -o lib/libASImage.so graf2d/asimage/src/TASImage.o graf2d/asimage/src/TASPluginGS.o graf2d/asimage/src/G__ASImage.o -ldl -Llib -lGraf -lMathCore lib/libAfterImage.a lib/libfreetype.a -lz -lz -Llib -lCore

Undefined symbols for architecture x86_64:
"_TIFFClose", referenced from:
_ASImage2tiff in libAfterImage.a(export.o)
_tiff2ASImage in libAfterImage.a(import.o)

Then I tried homebrew with (first brew doctor and brew update say ready to go)
brew install homebrew/science/root --with-cocoa --with-fftw -v
which fails shortly after reporting
/bin/rm -f libAfterImage.a
"many .o files"
ranlib libAfterImage.a
"more stuff"
Error: root did not build
Logs:
/Users/walkloud/Library/Logs/Homebrew/root/01.configure
/Users/walkloud/Library/Logs/Homebrew/root/01.configure.cc
/Users/walkloud/Library/Logs/Homebrew/root/02.make
/Users/walkloud/Library/Logs/Homebrew/root/02.make.cc
/Users/walkloud/Library/Logs/Homebrew/root/config.log

I attempted the above solution of sourcing the commands.sh, but that did not help me. I am trying to manage all my software with homebrew, so I have not tried macports.

Thanks,
Andre

Hello. I’m experiencing this very problem (“Undefined symbols for architecture x86_64:”) with root 5.34/05 and MacOS Sierra 10.12.4. By now is there a clean solution (like update to root 6 or something…)?

Thanks,
Abi

I should note that I see this message:

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: warning: object file (/Users/Abi/Documents/Work/pheno/CPV in B to D**taunu/simulation/BWInt2_cxx_ACLiC_dict.o) was built for newer OSX version (10.12) than being linked (10.8)

Don’t know if it’s pertinent.

Thanks,
Abi