Skip to content

ggobi and Mac OS X

3 messages · Dennis A. Wolf, Jan de Leeuw, Duncan Temple Lang

#
Greetings:

I have been trying to install ggobi with the ultimate goal of using it 
within R. I am having difficulty which appears to be related to gcc not 
allowing -shared as an option with Mac OS X. Can anyone suggest how I 
can overcome this problem?

I am using a 15" flat-panel iMac, Mac OSX 10.2.4, Apple's X11 beta 3.

The gory details of the attempted installation follow:

I downloaded ggobi, ggobi_0.99-10.tar.gz and gunzipped and tarred it as 
su to get the directory /usr/local/lib/ggobi and within that directory 
I did

sudo ./configure --with-xml --enable-embed

and got:

loading cache ./config.cache
checking for gtk-config... (cached) /sw/bin/gtk-config
Setting gtk flags
checking for uname... (cached) /usr/bin/uname
checking for install... (cached) /usr/bin/install
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
Checking flag for linking shared libraries
SHLIB linker flags: -shared
with_xml: yes
checking for xml2-config... (cached) /sw/bin/xml2-config
Have xml-config: /sw/bin/xml2-config
USE_XML := USE_XML=2
XML Version := 2
checking for uname... (cached) /usr/bin/uname
creating ./config.status
creating Makeconf
creating GNUmakefile
creating src/GNUmakefile
creating gtkext/src/GNUmakefile
creating bin/setLD.csh
creating bin/setLD.bsh
creating bin/ggobi
creating bin/ggobi-config
creating bugTemplate
creating share/ggobirc
creating local.config
creating share/tools/plugin
creating src/config.h
src/config.h is unchanged
Installation directory: /usr/local

Now when I

sudo make

I got

make -C gtkext/src install
gcc -shared -o libgtkext.so cokus.lo mt19937ar.lo gtkextruler.lo 
gtkexthruler.lo gtkextvruler.lo
gcc: unrecognized option `-shared'
ld: Undefined symbols:
_main
_g_log
_gdk_draw_pixmap
_gdk_gc_destroy
_gdk_gc_new
_gdk_gc_set_exposures
_gdk_pixmap_new
_gdk_pixmap_unref
_gdk_window_get_size
_gdk_window_move_resize
_gdk_window_new
_gdk_window_set_user_data
_gtk_marshal_NONE__NONE
_gtk_object_class_add_signals
_gtk_signal_new
_gtk_style_attach
_gtk_style_set_background
_gtk_type_check_class_cast
_gtk_type_check_object_cast
_gtk_type_class
_gtk_type_is_a
_gtk_type_unique
_gtk_widget_get_colormap
_gtk_widget_get_events
_gtk_widget_get_parent_window
_gtk_widget_get_type
_gtk_widget_get_visual
_gtk_widget_queue_draw
_gtk_widget_set_state
_myrint
_gdk_draw_line
_gdk_draw_string
_gdk_pointer_grab
_gdk_pointer_ungrab
_gdk_window_get_pointer
_gtk_paint_box
_gtk_signal_emit_by_name
_gtk_type_new
make[1]: *** [libgtkext.so] Error 1
make: *** [lib/libgtkext.so] Error 2

It appears that gcc does not like the -shared option. And indeed in the 
help file for gcc it says that this option is not allowed for Mac OS X.
#
In MacOS X you can build either dynamic libraries (foo.dylib), which are
to be linked against, or bundles (foo.so) which are to be loaded at run
time (plugins, packages). Most ELF based systems dont distinguish the
two.

So in R, for instance, you make libR.dylib and R_gnome.so or tcltk.so.
For dylibs you need the flag -dynamiclib, for bundles you need -bundle
(but more, because you need to tell the linker what to do about 
undefined
symbols). See the configure files for R for more details.

I'll look at ggobi, which I have running, but I am not sure what I 
needed
to do.
On Tuesday, March 18, 2003, at 08:35 AM, Dennis A. Wolf wrote:

            
#
I have been meaning to add this to the GGobi configuration, and will
get to it now that I know there is at least a small level of interest.
For the moment, you can run configure and then edit Makeconf and edit
the value of SHLIB_LDFLAGS. We parameterized it because we knew this
would arise, just never got to putting all the pieces together.

Also, just as a pointer for simplicity, if you untar the ggobi 
distribution and then from within the top-level directory
untar Rggobi, you could install both in one step as

  ./configure --with-R

Of course, we'll have to fix the configuration to get the -shared flag right.
Jan de Leeuw wrote: