Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 311703

Summary: media-libs/freeglut-2.6.0 fails to build on Mac OS 10.6/64bit
Product: Gentoo/Alt Reporter: Stuart Shelton <srcshelton>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED NEEDINFO    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: OS X   
Whiteboard:
Package list:
Runtime testing required: ---

Description Stuart Shelton 2010-03-27 23:58:19 UTC
>>> Source configured.
>>> Compiling source in /opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0 ...
make 
make  all-recursive
make[1]: Entering directory `/opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0'
Making all in src
make[2]: Entering directory `/opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0/src'
/opt/gentoo/bin/bash ../libtool --tag=CC   --mode=compile x86_64-apple-darwin10-gcc -DHAVE_CONFIG_H -I. -I..  -I../include    -O2 -fno-math-errno -march=core2 -msse4.1 -mfpmath=sse -pipe -MT libglut_la-freeglut_callbacks.lo -MD -MP -MF .deps/libglut_la-freeglut_callbacks.Tpo -c -o libglut_la-freeglut_callbacks.lo `test -f 'freeglut_callbacks.c' || echo './'`freeglut_callbacks.c
libtool: compile:  x86_64-apple-darwin10-gcc -DHAVE_CONFIG_H -I. -I.. -I../include -O2 -fno-math-errno -march=core2 -msse4.1 -mfpmath=sse -pipe -MT libglut_la-freeglut_callbacks.lo -MD -MP -MF .deps/libglut_la-freeglut_callbacks.Tpo -c freeglut_callbacks.c  -fno-common -DPIC -o .libs/libglut_la-freeglut_callbacks.o
In file included from ../include/GL/freeglut.h:17,
                 from freeglut_callbacks.c:28:
../include/GL/freeglut_std.h:121:20: error: GL/glu.h: No such file or directory
In file included from freeglut_callbacks.c:29:
freeglut_internal.h:107:24: error: GL/glx.h: No such file or directory
In file included from freeglut_callbacks.c:29:
freeglut_internal.h:390: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'SFG_WindowContextType'
freeglut_internal.h:407: error: expected specifier-qualifier-list before 'SFG_WindowContextType'
freeglut_internal.h:588: error: expected specifier-qualifier-list before 'SFG_WindowContextType'
freeglut_internal.h:814: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
make[2]: *** [libglut_la-freeglut_callbacks.lo] Error 1
make[2]: Leaving directory `/opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0'
make: *** [all] Error 2
 * ERROR: media-libs/freeglut-2.6.0 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line   54:  Called call-ebuildshell 'src_compile'
 *   environment, line  570:  Called src_compile
 *   environment, line 3239:  Called _eapi2_src_compile
 *     ebuild.sh, line  695:  Called die
 * The specific snippet of code:
 *   		emake || die "emake failed"
Comment 1 Stuart Shelton 2010-03-27 23:58:43 UTC
$ emerge --info
Portage 2.2.00.15842-prefix (prefix/darwin/macos/10.6/x64, gcc-4.2.1, unavailable, 10.2.0 x86_64)
=================================================================
System uname: Darwin-10.2.0-x86_64-i386-64bit
Timestamp of tree: Sat, 27 Mar 2010 22:36:47 +0000
distcc 2.18.5-Apple.1 i386-apple-darwin10.0 (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.5
dev-python/pycrypto: 2.1.0
sys-devel/autoconf:  2.65
sys-devel/automake:  1.10.2-r00.1, 1.11.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:   2.2.6b
ACCEPT_KEYWORDS="x64-macos x86-macos ~amd64 ~x64-macos ~x86 ~x86-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin10"
CFLAGS="-O2 -fno-math-errno -march=core2 -msse4.1 -mfpmath=sse -pipe"
CHOST="x86_64-apple-darwin10"
CONFIG_PROTECT="/etc /opt/gentoo/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /opt/gentoo/etc/ca-certificates.conf /opt/gentoo/etc/env.d /opt/gentoo/etc/env.d/java/ /opt/gentoo/etc/fonts/fonts.conf /opt/gentoo/etc/gconf /opt/gentoo/etc/revdep-rebuild /opt/gentoo/etc/terminfo"
CXXFLAGS="-O2 -fno-math-errno -march=core2 -msse4.1 -mfpmath=sse -pipe"
DISTDIR="/opt/gentoo/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages metadata-transfer news nostrip parallel-fetch preserve-libs protect-owned sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS=""
LINGUAS="en en_GB"
PKGDIR="/opt/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/opt/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/opt/gentoo/var/tmp"
PORTDIR="/opt/gentoo/usr/portage"
PORTDIR_OVERLAY="/opt/gentoo/usr/local/portage"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="X aqua ares bash-completion berkdb bzip2 cairo chroot common-lisp coreaudio cracklib cxx expat faac faad fftw flac fontconfig gdbm gmp graphviz gs gtk hpn iconv icu idea ipv6 ithreads java jbig jpeg jpeg2k lcms lzma md5sum mmap mmx mmxext modules mp3 ncurses network nls objc objc++ ogg opengl openmp pcre perl png prefix python rar readline sasl schroedinger slang sndfile speex spell sqlite sqlite3 sse sse2 ssl svg tcl test theora threads tiff tk trace truetype unicode urandom utils vdpau vim-syntax vorbis wmf x264 x64-macos xcb xinerama xml xpm xvid zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" RUBY_TARGETS="ruby18" USERLAND="GNU" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Fabian Groffen gentoo-dev 2010-03-28 15:14:30 UTC
do you have opengl-apple installed?
Comment 3 Stuart Shelton 2010-03-29 10:41:16 UTC
I do... am I not supposed to?

$ equery f opengl-apple
 * Searching for opengl-apple ...
 * Contents of media-libs/opengl-apple-3:
/opt/gentoo/usr
/opt/gentoo/usr/include
/opt/gentoo/usr/include/GL
/opt/gentoo/usr/include/GL/GLwDrawA.h -> /usr/X11R6/include/GL/GLwDrawA.h
/opt/gentoo/usr/include/GL/glu.h -> /usr/X11R6/include/GL/glu.h
/opt/gentoo/usr/include/GL/osmesa.h -> /usr/X11R6/include/GL/osmesa.h
/opt/gentoo/usr/lib
/opt/gentoo/usr/lib/libGLU.dylib -> /usr/X11R6/lib/libGLU.dylib
/opt/gentoo/usr/lib/libGLw.a -> /usr/X11R6/lib/libGLw.a
/opt/gentoo/usr/lib/opengl
/opt/gentoo/usr/lib/opengl/apple-opengl
/opt/gentoo/usr/lib/opengl/apple-opengl/include
/opt/gentoo/usr/lib/opengl/apple-opengl/include/gl.h -> /usr/X11R6/include/GL/gl.h
/opt/gentoo/usr/lib/opengl/apple-opengl/include/glext.h -> /usr/X11R6/include/GL/glext.h
/opt/gentoo/usr/lib/opengl/apple-opengl/include/glx.h -> /usr/X11R6/include/GL/glx.h
/opt/gentoo/usr/lib/opengl/apple-opengl/include/glxext.h -> /usr/X11R6/include/GL/glxext.h
/opt/gentoo/usr/lib/opengl/apple-opengl/include/glxmd.h -> /usr/X11R6/include/GL/glxmd.h
/opt/gentoo/usr/lib/opengl/apple-opengl/include/glxproto.h -> /usr/X11R6/include/GL/glxproto.h
/opt/gentoo/usr/lib/opengl/apple-opengl/include/glxtokens.h -> /usr/X11R6/include/GL/glxtokens.h
/opt/gentoo/usr/lib/opengl/apple-opengl/lib
/opt/gentoo/usr/lib/opengl/apple-opengl/lib/libGL.dylib -> /usr/X11R6/lib/libGL.dylib

Ah!  It's because on 10.6 (at least) the correct path should be /usr/X11/include/GL/ - perhaps this is because this was a 10.5 installation which I upgraded to 10.6...

Update: Nope - it's a broken opengl-apple:

>>> Emerging (1 of 1) media-libs/opengl-apple-3
 * checking ebuild checksums ;-) ...                                     [ ok ]
 * checking auxfile checksums ;-) ...                                    [ ok ]
 * checking miscfile checksums ;-) ...                                   [ ok ]
 * CPV:  media-libs/opengl-apple-3
 * REPO: gentoo_prefix
 * USE:  elibc_Darwin kernel_Darwin prefix test userland_GNU x64-macos
 * ERROR: media-libs/opengl-apple-3 failed:
 *   /usr/X11R6 not found, do you have X11/Xquartz installed?
 * 
 * Call stack:
 *               ebuild.sh, line  54:  Called call-ebuildshell 'pkg_setup'
 *               ebuild.sh, line  66:  Called pkg_setup
 *   opengl-apple-3.ebuild, line  23:  Called die
 * The specific snippet of code:
 *   	[[ ! -d ${X11_OPENGL_DIR} ]] && \
 *   		die "${X11_OPENGL_DIR} not found, do you have X11/Xquartz installed?"
 * 
 * If you need support, post the output of 'emerge --info =media-libs/opengl-apple-3',
 * the complete build log and the output of 'emerge -pqv =media-libs/opengl-apple-3'.
 * The complete build log is located at '/opt/gentoo/var/tmp/portage/media-libs/opengl-apple-3/temp/build.log'.
 * The ebuild environment file is located at '/opt/gentoo/var/tmp/portage/media-libs/opengl-apple-3/temp/die.env'.
 * S: '/opt/gentoo/var/tmp/portage/media-libs/opengl-apple-3/work/opengl-apple-3'

>>> Failed to emerge media-libs/opengl-apple-3, Log file:

>>>  '/opt/gentoo/var/tmp/portage/media-libs/opengl-apple-3/temp/build.log'

 * Messages for package media-libs/opengl-apple-3:

 * ERROR: media-libs/opengl-apple-3 failed:
 *   /usr/X11R6 not found, do you have X11/Xquartz installed?
 * 
 * Call stack:
 *               ebuild.sh, line  54:  Called call-ebuildshell 'pkg_setup'
 *               ebuild.sh, line  66:  Called pkg_setup
 *   opengl-apple-3.ebuild, line  23:  Called die
 * The specific snippet of code:
 *   	[[ ! -d ${X11_OPENGL_DIR} ]] && \
 *   		die "${X11_OPENGL_DIR} not found, do you have X11/Xquartz installed?"

X11_OPENGL_DIR is hardcoded in the ebuild - this either needs to auto-detect whether to use /usr/X11R6 or /usr/X11, or be able to be overridden from make.conf, I guess.
Comment 4 Stuart Shelton 2010-03-29 11:47:22 UTC
... and even with a fixed opengl-apple, freeglut still fails :(

libtool: link: x86_64-apple-darwin10-gcc -dynamiclib  -o .libs/libglut.3.9.0.dylib  .libs/libglut_la-freeglut_callbacks.o .libs/libglut_la-freeglut_cursor.o .libs/libglut_la-freeglut_display.o .libs/libglut_la-freeglut_ext.o .libs/libglut_la-freeglut_font.o .libs/libglut_la-freeglut_glutfont_definitions.o .libs/libglut_la-freeglut_font_data.o .libs/libglut_la-freeglut_stroke_roman.o .libs/libglut_la-freeglut_stroke_mono_roman.o .libs/libglut_la-freeglut_gamemode.o .libs/libglut_la-freeglut_geometry.o .libs/libglut_la-freeglut_init.o .libs/libglut_la-freeglut_input_devices.o .libs/libglut_la-freeglut_spaceball.o .libs/libglut_la-freeglut_joystick.o .libs/libglut_la-freeglut_main.o .libs/libglut_la-freeglut_menu.o .libs/libglut_la-freeglut_misc.o .libs/libglut_la-freeglut_overlay.o .libs/libglut_la-freeglut_state.o .libs/libglut_la-freeglut_structure.o .libs/libglut_la-freeglut_teapot.o .libs/libglut_la-freeglut_videoresize.o .libs/libglut_la-freeglut_window.o .libs/libglut_la-freeglut_xinput.o   -lGL -L/opt/gentoo/usr/lib /opt/gentoo/usr/lib/libXi.dylib /opt/gentoo/usr/lib/libXext.dylib /opt/gentoo/usr/lib/libX11.dylib /opt/gentoo/usr/lib/libxcb.dylib /opt/gentoo/usr/lib/libXau.dylib /opt/gentoo/usr/lib/libXdmcp.dylib  -march=core2 -msse4.1 -mfpmath=sse   -install_name  /opt/gentoo/usr/lib/libglut.3.dylib -compatibility_version 13 -current_version 13.0 -Wl,-single_module
collect2: ld terminated with signal 6 [Abort trap]
Undefined symbols:
  "_glXGetFBConfigAttrib", referenced from:
      _fghGetConfig in libglut_la-freeglut_state.o
      _glutGetModeValues in libglut_la-freeglut_state.o
      _fgChooseFBConfig in libglut_la-freeglut_window.o
      _fgChooseFBConfig in libglut_la-freeglut_window.o
  "_glXCreateNewContext", referenced from:
      _fghCreateNewContext in libglut_la-freeglut_window.o
  "_glXDestroyContext", referenced from:
      _fgDeinitialize in libglut_la-freeglut_init.o
      _fgCloseWindow in libglut_la-freeglut_window.o
  "_glXIsDirect", referenced from:
      _fgOpenWindow in libglut_la-freeglut_window.o
  "_glXMakeCurrent", referenced from:
      _fgSetWindow in libglut_la-freeglut_window.o
      _fgOpenWindow in libglut_la-freeglut_window.o
  "_glXGetVisualFromFBConfig", referenced from:
      _glutGet in libglut_la-freeglut_state.o
      _fgOpenWindow in libglut_la-freeglut_window.o
  "_glXQueryExtension", referenced from:
      _glutInit in libglut_la-freeglut_init.o
  "_XF86VidModeSetViewPort", referenced from:
      _glutLeaveGameMode in libglut_la-freeglut_gamemode.o
      _glutEnterGameMode in libglut_la-freeglut_gamemode.o
  "_XF86VidModeGetAllModeLines", referenced from:
      _fghChangeDisplayMode in libglut_la-freeglut_gamemode.o
      _glutLeaveGameMode in libglut_la-freeglut_gamemode.o
  "_XF86VidModeSwitchToMode", referenced from:
      _fghChangeDisplayMode in libglut_la-freeglut_gamemode.o
      _glutLeaveGameMode in libglut_la-freeglut_gamemode.o
  "_XF86VidModeGetViewPort", referenced from:
      _glutEnterGameMode in libglut_la-freeglut_gamemode.o
  "_glXGetProcAddressARB", referenced from:
      _fghGetProcAddress in libglut_la-freeglut_ext.o
  "_glXChooseFBConfig", referenced from:
      _glutGetModeValues in libglut_la-freeglut_state.o
      _fgChooseFBConfig in libglut_la-freeglut_window.o
      _fgChooseFBConfig in libglut_la-freeglut_window.o
  "_glXGetCurrentContext", referenced from:
      _fgOpenWindow in libglut_la-freeglut_window.o
  "_XF86VidModeGetModeLine", referenced from:
      _glutEnterGameMode in libglut_la-freeglut_gamemode.o
  "_glXSwapBuffers", referenced from:
      _glutSwapBuffers in libglut_la-freeglut_display.o
got unhandled exception: symbol(s) not found
terminate called after throwing an instance of 'char const*'
make[2]: *** [libglut.la] Error 1
make[2]: Leaving directory `/opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/gentoo/var/tmp/portage/media-libs/freeglut-2.6.0/work/freeglut-2.6.0'
make: *** [all] Error 2
 * ERROR: media-libs/freeglut-2.6.0 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line   54:  Called call-ebuildshell 'src_compile'
 *   environment, line  570:  Called src_compile
 *   environment, line 3239:  Called _eapi2_src_compile
 *     ebuild.sh, line  695:  Called die
 * The specific snippet of code:
 *   		emake || die "emake failed"

... I'm not sure from that whether ld intentionally failed due to undefined symbols, or whether ld crashed and the symbols are arbitrary based on what it was processing at the time.

This is with the latest binutils-apple and latest apple-gcc.
Comment 5 Fabian Groffen gentoo-dev 2010-03-29 12:17:58 UTC
so step 1 is to fix opengl-apple.
Comment 6 Stuart Shelton 2010-03-29 13:09:41 UTC
Hmm - interesting: I have two Macs on-hand.  One has a /usr/X11R6 -> X11 symlink, whilst the other has the X11 directory only...

I'm now wondering if perhaps I *don't* have X11/Xquartz installed on my test machine!

It could be that this entire problem has been me mixing my systems up... I'll check this out and get back to you - but I'd hold-off from making any changes just yet ;)