Opened 11 years ago

Closed 11 years ago

#1884 closed defect (fixed)

grass7 - cairodriver fails to detect right architecture - OSX 10.8

Reported by: epifanio Owned by: grass-dev@…
Priority: major Milestone: 7.0.0
Component: Compiling Version: svn-trunk
Keywords: cairo Cc:
CPU: OSX/Intel Platform: MacOSX

Description (last modified by hamish)

Trying to build grass7 with cairo enabled, the build fails with the following error :

epi:grass_trunk epi$ cd /usr/local/src/grass_trunk/lib/cairodriver
epi:cairodriver epi$ make
cc -dynamiclib -compatibility_version 7.0 -current_version 7.0 -install_name /usr/local/grass-7.0.svn/lib/libgrass_cairodriver.7.0.svn.dylib -o /usr/local/src/grass_trunk/dist.x86_64-apple-darwin12.2.0/lib/libgrass_cairodriver.7.0.svn.dylib -L/usr/local/src/grass_trunk/dist.x86_64-apple-darwin12.2.0/lib -L/usr/local/src/grass_trunk/dist.x86_64-apple-darwin12.2.0/lib    OBJ.x86_64-apple-darwin12.2.0/Box.o OBJ.x86_64-apple-darwin12.2.0/Color.o OBJ.x86_64-apple-darwin12.2.0/Draw.o OBJ.x86_64-apple-darwin12.2.0/Draw_bitmap.o OBJ.x86_64-apple-darwin12.2.0/Driver.o OBJ.x86_64-apple-darwin12.2.0/Erase.o OBJ.x86_64-apple-darwin12.2.0/Graph.o OBJ.x86_64-apple-darwin12.2.0/Line_width.o OBJ.x86_64-apple-darwin12.2.0/Raster.o OBJ.x86_64-apple-darwin12.2.0/Set_window.o OBJ.x86_64-apple-darwin12.2.0/Text.o OBJ.x86_64-apple-darwin12.2.0/read.o OBJ.x86_64-apple-darwin12.2.0/read_bmp.o OBJ.x86_64-apple-darwin12.2.0/read_ppm.o OBJ.x86_64-apple-darwin12.2.0/read_xid.o OBJ.x86_64-apple-darwin12.2.0/write.o OBJ.x86_64-apple-darwin12.2.0/write_bmp.o OBJ.x86_64-apple-darwin12.2.0/write_ppm.o OBJ.x86_64-apple-darwin12.2.0/write_xid.o  -lgrass_driver.7.0.svn -lgrass_gis.7.0.svn -L/usr/local/Cellar/cairo/1.12.12/lib -lcairo      -liconv 
Undefined symbols for architecture x86_64:
  "_FcConfigGetCurrent", referenced from:
      _Cairo_set_font in Text.o
  "_FcConfigSubstitute", referenced from:
      _Cairo_set_font in Text.o
  "_FcDefaultSubstitute", referenced from:
      _Cairo_set_font in Text.o
  "_FcFontList", referenced from:
      _font_list_fc in Text.o
  "_FcFontMatch", referenced from:
      _Cairo_set_font in Text.o
  "_FcFontSetDestroy", referenced from:
      _font_list_fc in Text.o
  "_FcInit", referenced from:
      _font_list_fc in Text.o
      _Cairo_set_font in Text.o
  "_FcNameParse", referenced from:
      _Cairo_set_font in Text.o
  "_FcObjectSetBuild", referenced from:
      _font_list_fc in Text.o
  "_FcObjectSetDestroy", referenced from:
      _font_list_fc in Text.o
  "_FcPatternCreate", referenced from:
      _font_list_fc in Text.o
  "_FcPatternDestroy", referenced from:
      _font_list_fc in Text.o
  "_FcPatternGetString", referenced from:
      _font_list_fc in Text.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: *** [/usr/local/src/grass_trunk/dist.x86_64-apple-darwin12.2.0/lib/libgrass_cairodriver.7.0.svn.dylib] Error 1
epi:cairodriver epi$ 

this is not correct, the cairo lib installed on my machine are built as universal in both arch 32 and 64 bit.

lipo -info /usr/local/Cellar/cairo/1.12.12/lib/cairo/libcairo-trace.0.dylib /usr/local/Cellar/cairo/1.12.12/lib/libcairo-gobject.2.dylib /usr/local/Cellar/cairo/1.12.12/lib/libcairo-script-interpreter.2.dylib /usr/local/Cellar/cairo/1.12.12/lib/libcairo.2.dylib 
Architectures in the fat file: /usr/local/Cellar/cairo/1.12.12/lib/cairo/libcairo-trace.0.dylib are: i386 x86_64 
Architectures in the fat file: /usr/local/Cellar/cairo/1.12.12/lib/libcairo-gobject.2.dylib are: i386 x86_64 
Architectures in the fat file: /usr/local/Cellar/cairo/1.12.12/lib/libcairo-script-interpreter.2.dylib are: i386 x86_64 
Architectures in the fat file: /usr/local/Cellar/cairo/1.12.12/lib/libcairo.2.dylib are: i386 x86_64 
epi:~ epi$ 


/usr/local/Cellar/fontconfig/2.10.91/bin/fc-cache:    Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-cache (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-cache (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-cat:      Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-cat (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-cat (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-list:     Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-list (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-list (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-match:    Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-match (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-match (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-pattern:  Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-pattern (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-pattern (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-query:    Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-query (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-query (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-scan:     Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-scan (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-scan (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-validate: Mach-O universal binary with 2 architectures
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-validate (for architecture i386):	Mach-O executable i386
/usr/local/Cellar/fontconfig/2.10.91/bin/fc-validate (for architecture x86_64):Mach-O 64-bit executable x86_64

suspect :

seems that the GRASS Configure is not storing the fontconfig linking in platform.make so it doesn't get into the cairo driver compilation.

Change History (3)

comment:1 by hamish, 11 years ago

Description: modified (diff)

added {{{}}} for <code></code> readability

in reply to:  description ; comment:2 by glynn, 11 years ago

Replying to epifanio:

seems that the GRASS Configure is not storing the fontconfig linking in platform.make so it doesn't get into the cairo driver compilation.

configure sets CAIROLIB to whatever it gets from

pkg-config --libs cairo-ft cairo-fc cairo-pdf cairo-ps cairo-svg

plus anything added manually via the --with-cairo-libs and/or --with-cairo-ldflags switches.

However: lib/cairodriver uses fontconfig directly, as well as via cairo. The above list of undefined symbols is exactly the set of fontconfig functions which lib/cairodriver/Text.c references directly.

So we probably need to add "fontconfig" to the pkg-config command. Try r55040.

in reply to:  2 comment:3 by epifanio, 11 years ago

Resolution: fixed
Status: newclosed

Replying to glynn:

Replying to epifanio:

So we probably need to add "fontconfig" to the pkg-config command. Try r55040.

This fixed the error, now cairodriver build fine without errors Configure asked about missed cairo includes, fixed with :

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig/

Now WxGrass start fine after commenting this line :

#72 if not os.getenv("GRASS_WXBUNDLED"):
#73     CheckForWx()

in : http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/core/globalvar.py#L72

and i'm able to display vector data in wxgui (using 2.9 cocoa)

Note: See TracTickets for help on using tickets.