Compiling Root on Mac OS Mountain Lion

Hello,
I am trying to compile the root trunk with the following configure command -

./configure --with-f77=/usr/local/bin/gfortran \
    --enable-python\
    --enable-ruby\
    --with-clang\
    --enable-minuit2\
    --enable-roofit\
    --enable-soversion\
    --enable-bonjour\
    --enable-builtin-afterimage\

But I am getting this error -

clang++ -dynamiclib -single_module -Wl,-dead_strip_dylibs -install_name @rpath/libASImage.5.so -g -m64 -mmacosx-version-min=10.8 -o lib/libASImage.5.99.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 -lCint -compatibility_version 5 -current_version 5.99.01
Undefined symbols for architecture x86_64:
  "_XAllocColor", referenced from:
      _query_screen_visual_id in libAfterImage.a(asvisual.o)
      _find_useable_visual in libAfterImage.a(asvisual.o)
      _setup_as_colormap in libAfterImage.a(asvisual.o)
  "_XCheckWindowEvent", referenced from:
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XClearWindow", referenced from:
      _show_asimage in libAfterImage.a(asimagexml.o)
  "_XCopyArea", referenced from:
      _copyshade_drawable_area in libAfterImage.a(pixmap.o)
      _CopyAndShadeArea in libAfterImage.a(pixmap.o)
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XCreateColormap", referenced from:
      _query_screen_visual_id in libAfterImage.a(asvisual.o)
      _find_useable_visual in libAfterImage.a(asvisual.o)
  "_XCreateGC", referenced from:
      _put_ximage in libAfterImage.a(ximage.o)
      _asimage2alpha in libAfterImage.a(ximage.o)
      _create_visual_gc in libAfterImage.a(asvisual.o)
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
      _FillPixmapWithTile in libAfterImage.a(pixmap.o)
      _fill_with_darkened_background in libAfterImage.a(pixmap.o)
  "_XCreateImage", referenced from:
      _create_visual_ximage in libAfterImage.a(asvisual.o)
      _create_visual_scratch_ximage in libAfterImage.a(asvisual.o)
  "_XCreatePixmap", referenced from:
      _create_visual_pixmap in libAfterImage.a(asvisual.o)
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
  "_XCreateWindow", referenced from:
      _find_useable_visual in libAfterImage.a(asvisual.o)
      _create_visual_window in libAfterImage.a(asvisual.o)
      _create_visual_gc in libAfterImage.a(asvisual.o)
  "_XDestroyWindow", referenced from:
      _find_useable_visual in libAfterImage.a(asvisual.o)
      _destroy_asvisual in libAfterImage.a(asvisual.o)
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XDisplayHeight", referenced from:
      _asim_asxml_var_init in libAfterImage.a(afterbase.o)
      _get_dpy_window_position in libAfterImage.a(asvisual.o)
      _GetRootDimensions in libAfterImage.a(pixmap.o)
  "_XDisplayWidth", referenced from:
      _asim_asxml_var_init in libAfterImage.a(afterbase.o)
      _get_dpy_window_position in libAfterImage.a(asvisual.o)
      _GetRootDimensions in libAfterImage.a(pixmap.o)
  "_XDrawImageString16", referenced from:
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
  "_XFillRectangle", referenced from:
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
      _FillPixmapWithTile in libAfterImage.a(pixmap.o)
      _center_pixmap in libAfterImage.a(pixmap.o)
      _grow_pixmap in libAfterImage.a(pixmap.o)
      _GrowPixmap in libAfterImage.a(pixmap.o)
      _fill_with_darkened_background in libAfterImage.a(pixmap.o)
  "_XFlush", referenced from:
      _show_asimage in libAfterImage.a(asimagexml.o)
  "_XFree", referenced from:
      _query_screen_visual_id in libAfterImage.a(asvisual.o)
      _visual_prop2visual in libAfterImage.a(asvisual.o)
      _My_XDestroyImage in libAfterImage.a(asvisual.o)
      _create_visual_ximage in libAfterImage.a(asvisual.o)
      _create_visual_scratch_ximage in libAfterImage.a(asvisual.o)
      _GetRootPixmap in libAfterImage.a(pixmap.o)
      _ValidatePixmap in libAfterImage.a(pixmap.o)
      ...
  "_XFreeColormap", referenced from:
      _find_useable_visual in libAfterImage.a(asvisual.o)
      _destroy_asvisual in libAfterImage.a(asvisual.o)
      _visual_prop2visual in libAfterImage.a(asvisual.o)
  "_XFreeFont", referenced from:
      _open_X11_font_int in libAfterImage.a(asfont.o)
  "_XFreeGC", referenced from:
      _put_ximage in libAfterImage.a(ximage.o)
      _asimage2alpha in libAfterImage.a(ximage.o)
      _open_X11_font_int in libAfterImage.a(asfont.o)
      _FillPixmapWithTile in libAfterImage.a(pixmap.o)
      _fill_with_darkened_background in libAfterImage.a(pixmap.o)
  "_XFreePixmap", referenced from:
      _file2pixmap in libAfterImage.a(import.o)
      _asimage2pixmap in libAfterImage.a(ximage.o)
      _destroy_visual_pixmap in libAfterImage.a(asvisual.o)
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
      _show_asimage in libAfterImage.a(asimagexml.o)
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XGetGeometry", referenced from:
      _asim_get_drawable_size in libAfterImage.a(afterbase.o)
      _asimage2alpha_drawable in libAfterImage.a(ximage.o)
      _find_useable_visual in libAfterImage.a(asvisual.o)
      _get_dpy_drawable_size in libAfterImage.a(asvisual.o)
      _get_dpy_window_position in libAfterImage.a(asvisual.o)
      _ValidatePixmap in libAfterImage.a(pixmap.o)
      _cut_pixmap in libAfterImage.a(pixmap.o)
      ...
  "_XGetImage", referenced from:
      _ASGetXImage in libAfterImage.a(asvisual.o)
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
  "_XGetVisualInfo", referenced from:
      _query_screen_visual_id in libAfterImage.a(asvisual.o)
      _visual_prop2visual in libAfterImage.a(asvisual.o)
  "_XGetWindowProperty", referenced from:
      _GetRootPixmap in libAfterImage.a(pixmap.o)
      _ValidatePixmap in libAfterImage.a(pixmap.o)
  "_XGrabServer", referenced from:
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XInternAtom", referenced from:
      _GetRootPixmap in libAfterImage.a(pixmap.o)
      _ValidatePixmap in libAfterImage.a(pixmap.o)
  "_XLoadQueryFont", referenced from:
      _open_X11_font_int in libAfterImage.a(asfont.o)
  "_XLookupColor", referenced from:
      _asim_parse_argb_color in libAfterImage.a(afterbase.o)
  "_XMapRaised", referenced from:
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XMatchVisualInfo", referenced from:
      _query_screen_visual_id in libAfterImage.a(asvisual.o)
  "_XPutImage", referenced from:
      _ASPutXImage in libAfterImage.a(asvisual.o)
  "_XQueryColor", referenced from:
      _ximage2scanline_pseudo3bpp in libAfterImage.a(asvisual.o)
      _ximage2scanline_pseudo6bpp in libAfterImage.a(asvisual.o)
      _ximage2scanline_pseudo12bpp in libAfterImage.a(asvisual.o)
  "_XSetErrorHandler", referenced from:
      _find_useable_visual in libAfterImage.a(asvisual.o)
      _get_dpy_drawable_size in libAfterImage.a(asvisual.o)
      _get_dpy_window_position in libAfterImage.a(asvisual.o)
      _ValidatePixmap in libAfterImage.a(pixmap.o)
  "_XSetForeground", referenced from:
      _load_X11_glyph_range in libAfterImage.a(asfont.o)
  "_XSetWindowBackgroundPixmap", referenced from:
      _show_asimage in libAfterImage.a(asimagexml.o)
  "_XSync", referenced from:
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "_XTranslateCoordinates", referenced from:
      _get_dpy_window_position in libAfterImage.a(asvisual.o)
  "_XUngrabServer", referenced from:
      _cut_pixmap in libAfterImage.a(pixmap.o)
  "__XInitImageFuncPtrs", referenced from:
      _create_visual_ximage in libAfterImage.a(asvisual.o)
      _create_visual_scratch_ximage in libAfterImage.a(asvisual.o)
  "_png_create_info_struct", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_create_read_struct", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_create_write_struct", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_destroy_info_struct", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_destroy_read_struct", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_destroy_write_struct", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_get_IHDR", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_get_gAMA", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_get_io_ptr", referenced from:
      _asim_png_write_data in libAfterImage.a(export.o)
      _asim_png_read_data in libAfterImage.a(import.o)
  "_png_get_rowbytes", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_get_sRGB", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_get_valid", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_init_io", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_read_end", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_read_image", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_read_info", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_read_update_info", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_IHDR", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_set_bKGD", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_set_compression_level", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_set_expand", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_filler", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_gamma", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_longjmp_fn", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_packing", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_read_fn", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_strip_16", referenced from:
      _png2ASImage_int in libAfterImage.a(import.o)
  "_png_set_write_fn", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_write_end", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_write_info", referenced from:
      _ASImage2png_int in libAfterImage.a(export.o)
  "_png_write_rows", referenced from:
      _ASImage2png_int in libAfterImage.a(export.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 tried checking if I had some other compiled version of libAfterImage in my /usr/local/lib directory. But it isnt there.

Could you tell me what is going wrong here?

Cheers,
Subho.

A stupid idea … maybe you could try to add “–enable-shared” to the “./configure” command line.

Hello Pepe,
That did not work. I am still stuck on the libAfterImage linking.

[quote=“sbanerje”]Hello Pepe,
That did not work. I am still stuck on the libAfterImage linking.[/quote]

Hi. Which version of ROOT you are trying to compile?
At the moment, trunk on Mac OSX 10.8 by default is configured with --enable-cocoa, in this case
asimage should be also configured and build without X11. Is it 5.34 you have?

[quote=“tpochep”][quote=“sbanerje”]Hello Pepe,
That did not work. I am still stuck on the libAfterImage linking.[/quote]

Hi. Which version of ROOT you are trying to compile?
At the moment, trunk on Mac OSX 10.8 by default is configured with --enable-cocoa, in this case
asimage should be also configured and build without X11. Is it 5.34 you have?[/quote]

I am using the trunk…

A stupid question … looking at the output, I can see “x86_64”. Are you sure that you have the 64-bit version of X11 libraries installed on your system (is it possible that you have them as 32-bit only)?

I have the ones that ship with xquartz by default

Hi,

something has been fixed recently in the OSX 10.8 build of ROOT trunk. Please do:

cd root
svn up
./configure
make distclean
make

and it should work in building the Cocoa backend version of ROOT free of X11.

Cheers, Fons.