Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259169 - Ogre 1.6.1 fails to build - can not find -lCg with nvidia-cg-toolkit-2.1.0016
Summary: Ogre 1.6.1 fails to build - can not find -lCg with nvidia-cg-toolkit-2.1.0016
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on: 255867
Blocks:
  Show dependency tree
 
Reported: 2009-02-16 04:02 UTC by Collin Day
Modified: 2013-01-26 17:24 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
config.log specified by ebuild to post (ogre-config.log,106.97 KB, text/plain)
2009-02-16 04:16 UTC, Collin Day
Details
build log (ogre-build.log,11.21 KB, text/plain)
2009-02-16 04:17 UTC, Collin Day
Details
(build) environment (ogre-environment,112.41 KB, text/plain)
2009-02-16 04:17 UTC, Collin Day
Details
emerge --info (emerge-info.txt,4.44 KB, text/plain)
2009-02-16 04:18 UTC, Collin Day
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Collin Day 2009-02-16 04:02:12 UTC
Hello -

I have reinstalled the nvidia-cg-toolkit but still can not install ogre. It keeps claiming that it can't find -lCg. I even tried adding LDPATH=/opt/nvidia-cg-toolkit/lib to /etc/env.d/80cgc-opt. ldconfig -p | grep libCg gives:

libCgGL.so (libc6) => /opt/nvidia-cg-toolkit/lib/libCgGL.so
libCg.so (libc6) => /opt/nvidia-cg-toolkit/lib/libCg.so

gcc -lCg gives:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lCg
collect2: ld returned 1 exit status

but gcc -L /opt/nvidia-cg-toolkit/lob -lGc gives:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.3/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `sqrt'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `sinf'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_mutexattr_settype'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_key_create'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_once'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `sqrtf'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_getspecific'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_mutexattr_destroy'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `log'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_mutexattr_init'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `cosf'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `exp'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `sin'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pow'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `cos'
/opt/nvidia-cg-toolkit/lib//libCg.so: undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status

meaning it then appears to find it (I think)

Top most configure error:

checking for cgCreateProgram in -lCg... no
configure: error:
****************************************************************
* You do not have the nVidia Cg libraries installed. *
* Go to http://developer.nvidia.com/object/cg_toolkit.html *
* (Click on Cg_Linux.tar.gz). *
* You can disable the building of Cg support by providing *
* --disable-cg to this configure script but this is highly *
* discouraged as this breaks many of the examples. *
**************************************************************** 

Reproducible: Always

Steps to Reproduce:
1.emerge ogre


Actual Results:  
Fails as described.

Expected Results:  
Ogre installs :)
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2009-02-16 04:11:35 UTC
reopen with the output from emerge --info
Comment 2 Collin Day 2009-02-16 04:16:38 UTC
Created attachment 182193 [details]
config.log specified by ebuild to post
Comment 3 Collin Day 2009-02-16 04:17:09 UTC
Created attachment 182194 [details]
build log
Comment 4 Collin Day 2009-02-16 04:17:40 UTC
Created attachment 182195 [details]
(build) environment
Comment 5 Collin Day 2009-02-16 04:18:36 UTC
Created attachment 182196 [details]
emerge --info
Comment 6 Collin Day 2009-02-16 04:20:16 UTC
Portage 2.2_rc23 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.26-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.26-gentoo-r1-i686-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-glibc2.0
Timestamp of tree: Mon, 16 Feb 2009 00:05:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p48-r1
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.4.4-r6, 2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.3.7
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi alsa ao audiofile avahi bash-completion berkdb bidi blas bzip2 cairo caps cddb cdparanoia cdr cgi clamav cli cracklib crypt css cups curl cxx dbus djvu doc dri dv dvd dvdr dvdread emacs encode examples exif expat extra fam fastcgi ffmpeg fftw firefox flac fltk fontconfig fortran ftp gd gdbm ggi gif gimp git gmp gnuplot gnutls gphoto2 gpm graphviz gsl gstreamer gtk gtkhtml guile gutenprint hal hbci hyperwav-api iconv ieee1394 imagemagick imap imlib ipv6 isdnlog java javascript jbig joystick jpeg jpeg2k kpathsea lame lapack latex lcms libcaca libedit libnotify libsamplerate libwww lm_sensors lua lzo mad mbox midi mikmod mime mmap mmx mng modplug motif mp3 mpeg mpi mplayer mudflap musepack mysql nas ncurses nis nls nntp nptl nptlonly nsplugin odbc offensive ofx ogg openal openexr opengl openmp oss pam pcre pdf perl php plotutils png ppds pppd pulseaudio python raw readline reflection rss samba sasl scanner sdl session slang smp sndfile snmp sockets speex spell spl ssl startup-notification subversion svg svga sysfs syslog szip tcl tcpd theora threads tiff tk truetype unicode v4l v4l2 vcd vhosts videos vnc vorbis wavpack win32codecs wmf wxwindows x86 xemeacs xine xinetd xml xmlrpc xorg xpm xprint xscreensaver xulrunner xv xvid zeroconf zlib" ALSA_CARDS="maestro3 ymfpci emu10k1 emu10k1x hdsp hdspm" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 7 Collin Day 2009-02-16 04:21:14 UTC
Portage 2.2_rc23 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r1, 2.6.26-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.26-gentoo-r1-i686-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-glibc2.0
Timestamp of tree: Mon, 16 Feb 2009 00:05:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p48-r1
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.4.4-r6, 2.5.4-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.3.7
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi alsa ao audiofile avahi bash-completion berkdb bidi blas bzip2 cairo caps cddb cdparanoia cdr cgi clamav cli cracklib crypt css cups curl cxx dbus djvu doc dri dv dvd dvdr dvdread emacs encode examples exif expat extra fam fastcgi ffmpeg fftw firefox flac fltk fontconfig fortran ftp gd gdbm ggi gif gimp git gmp gnuplot gnutls gphoto2 gpm graphviz gsl gstreamer gtk gtkhtml guile gutenprint hal hbci hyperwav-api iconv ieee1394 imagemagick imap imlib ipv6 isdnlog java javascript jbig joystick jpeg jpeg2k kpathsea lame lapack latex lcms libcaca libedit libnotify libsamplerate libwww lm_sensors lua lzo mad mbox midi mikmod mime mmap mmx mng modplug motif mp3 mpeg mpi mplayer mudflap musepack mysql nas ncurses nis nls nntp nptl nptlonly nsplugin odbc offensive ofx ogg openal openexr opengl openmp oss pam pcre pdf perl php plotutils png ppds pppd pulseaudio python raw readline reflection rss samba sasl scanner sdl session slang smp sndfile snmp sockets speex spell spl ssl startup-notification subversion svg svga sysfs syslog szip tcl tcpd theora threads tiff tk truetype unicode v4l v4l2 vcd vhosts videos vnc vorbis wavpack win32codecs wmf wxwindows x86 xemeacs xine xinetd xml xmlrpc xorg xpm xprint xscreensaver xulrunner xv xvid zeroconf zlib" ALSA_CARDS="maestro3 ymfpci emu10k1 emu10k1x hdsp hdspm" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 8 Collin Day 2009-02-16 04:21:45 UTC
Oops - sorry about that - but the info is now there :)
Comment 9 Small_Penguin 2009-02-17 22:25:50 UTC
I can confirm this bug trying to compile ogre-1.4.9, even if I use default LDFLAGS (though it worked with the following settings in earlier builds).

Portage 2.2_rc23 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.8_p20080602-r1, 2.6.28-tuxonice-r1 i686)
=================================================================
System uname: Linux-2.6.28-tuxonice-r1-i686-Intel-R-_Pentium-R-_4_CPU_3.40GHz-with-glibc2.0
Timestamp of tree: Sun, 15 Feb 2009 22:15:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.5.2-r7
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -fno-ident"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -fno-ident"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LC_ALL="C"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common -Wl,-z,now"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
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="/var/tmp"
PORTDIR="/usr/portage"
USE="7zip X a52 aac acpi alsa apache2 bash-completion berkdb bzip2 cairo cdparanoia cdr cli cracklib crypt cups curl dbus dri dvd dvdr dvdread emacs emacs-w3 encode exif ffmpeg firefox flac fortran ftp gdbm gif glitz gpm gs gtk hal iconv idn imagemagick imap ipv6 isdnlog java javascript jikes joystick jpeg jpeg2k kdeenablefinal kdehiddenvisibility libnotify lirc lm_sensors matroska midi mime mmkeys mmx mng mp3 mudflap musepack ncurses nls nptl nptlonly nsplugin ogg openal opengl openmp pam pch pcre pdf perl png pppd python qt4 readline recode reflection samba session shorten slang sndfile speex spl sse sse2 ssl startup-notification svg sysfs tcpd tetex theora threads tidy tiff truetype unicode usb vcd vorbis wmf x264 x86 xcb xcomposite xine xinerama xorg xpm xprint xscreensaver xv xvid zlib"
Comment 10 Mr. Bones. (RETIRED) gentoo-dev 2009-02-17 23:46:55 UTC
It doesn't have anything to do with the ogre ebuild.  nvidia-cg-toolkit-2.1.0016 is currently broken.  Don't use it if you need cg support in ogre.
Comment 11 Asfand Yar Qazi 2009-02-18 11:52:02 UTC
Thanks to Mr. Bones comment on nvidia-cg-toolkit-2.1.0016 being broken for Ogre, I put the following into my package.mask:

# It's broken, don't want ogre to try to use it
=media-gfx/nvidia-cg-toolkit-2.1.0016

and it now works after nvidia-cg-toolkit-2.1.0012 was downgraded to.
Comment 12 Frank Richter 2009-02-21 16:33:44 UTC
This is the same as bug 258385
Comment 13 Collin Day 2009-02-22 18:59:03 UTC
Yes - thank you - that seemed to do the trick (downgrade).
Comment 14 A.J. Gardner 2009-02-22 21:38:28 UTC
Meanwhile, check out http://bugs.gentoo.org/show_bug.cgi?id=255867

nvidia-cg-toolkit is being put into /opt because it's binary only. However, the environment is apparently not being told about this unexpected location, so clients like ogre (which expects cg in /usr) fail to build with cg. I'm guessing that previous cg packages weren't so stubbornly placed into /opt without at least letting the system know.
Comment 15 Tolga Dalman 2009-03-24 13:41:48 UTC
I can confirm this error. While nvidia-cg-toolkit may be broken, this is clearly a bug in Ogre, since the configure script fails. I think that either the "cg" use-flag is to be removed, or even better Ogre should be patched.
Comment 16 Frank Richter 2009-03-24 15:18:57 UTC
So if I'd put Cg into an arbitrary non-standard directory (e.g. /foo/Cg) it would still be Ogre's fault because configure doesn't detect it?

Besides, bug 261481 fixes the issue _without_ requiring any patches to packages using Cg.
Comment 17 Chris 2009-05-11 23:21:33 UTC
Downgrading to nvidia-cg-toolkit-2.1.0012 doesn't work for me. Trying to emerge Ogre 1.6.2, it fails to find Cg:

configure:27298: checking for cgCreateProgram in -lCg
configure:27333: i686-pc-linux-gnu-g++ -o conftest  -march=athlon-tbird -O2  -Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -Wl,-z,combreloc conftest.cpp -lCg  -lILU -lIL -lpthread -lz -lm -ldl  >&5
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_mutexattr_settype'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_key_create'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_once'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_getspecific'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_mutexattr_destroy'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_mutexattr_init'
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../libCg.so: undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status
Comment 18 Stephen Bridges 2009-05-22 21:30:54 UTC
Not a surprise here, but nvidia-cg.toolkit 2.1.0017 doesn't work either, still being in /opt.  .0012 has just got past configure stage here in ~amd64.
Comment 19 Christoph Brill (egore) (RESIGNED) 2009-05-24 08:56:41 UTC
For me it failes this way when I compile ogre with "LDFLAGS="-Wl,--as-needed"".

Could you try "LDFLAGS="" emerge ogre"? That's how I compile it every time.
Comment 20 Chris 2009-05-24 09:19:45 UTC
(In reply to comment #19)
> For me it failes this way when I compile ogre with "LDFLAGS="-Wl,--as-needed"".
> 
> Could you try "LDFLAGS="" emerge ogre"? That's how I compile it every time.
> 

Ah, sweet. That seems to have fixed the configure issue. Compiling now...
Comment 21 Mamadou Babaei 2009-08-17 02:29:45 UTC
with OGRE 3D 1.6.2 I had the same problem, but when I checked the media-gfx/nvidia-cg-toolkit version, it's outdated for 1.6.2.


# emerge -s media-gfx/nvidia-cg-toolkit

*  media-gfx/nvidia-cg-toolkit
      Latest version available: 2.1.0017
      Latest version installed: 2.1.0017
      Size of files: 27,412 kB
      Homepage:      http://developer.nvidia.com/object/cg_toolkit.html
      Description:   NVIDIA's C graphics compiler toolkit
      License:       NVIDIA


I did the following steps and it compiled successfully.

I downloaded the latest tar.gz from nvidia.
http://developer.nvidia.com/object/cg_download.html

# echo "media-gfx/nvidia-cg-toolkit-2.2.0" >> /etc/portage/profile/package.provided

# tar xvzf Cg-2.2_April2009_x86.tgz -C /

# emerge -avt dev-games/ogre

I think the problem is nVidia Cg is outdated on portage tree.
Comment 22 Anton Romanov 2009-09-12 16:15:26 UTC
(In reply to comment #21)
> I think the problem is nVidia Cg is outdated on portage tree.
no, that worked for you because you manually unpacked to / and now have libraries in /usr/lib

i only managed to workaround that by adding 
-L/opt/nvidia-cg-toolkit/lib/
to LDFLAGS
Comment 23 Frank Richter 2009-09-12 16:21:51 UTC
The solution presented in bug 261481 would fix this one as well.
Comment 24 Tolga Dalman 2009-10-01 17:57:29 UTC
This package is still broken for ogre-1.6.3. Either nvidia-cg-toolkit should be fixed or the cg flag should be removed entirely from portage. 
Comment 25 Daniel 2009-10-13 14:53:17 UTC
Quick Fix:

--- /usr/portage/dev-games/ogre/ogre-1.6.3.ebuild       2009-10-13 15:28:39.198063677 +0200
+++ /usr/portage/dev-games/ogre/ogre-1.6.3.ebuild.orig  2009-10-13 15:33:02.750053880 +0200
@@ -52,7 +52,6 @@
 }
 
 src_configure() {
-       append-ldflags -L/opt/nvidia-cg-toolkit/lib/
        strip-flags
                econf \
                --disable-dependency-tracking \

Or manually add the
append-ldflags -L/opt/nvidia-cg-toolkit/lib/
line on the first line of src_configure() and run ebuild digest over the ebuild.
Comment 26 Daniel 2009-10-13 19:57:04 UTC
Okay, additionally
ln -s /opt/nvidia-cg-toolkit/include/Cg/ /usr/include/Cg
should do the Trick
Comment 27 Daniel Santos 2009-11-11 06:58:50 UTC
(In reply to comment #26)
> Okay, additionally
> ln -s /opt/nvidia-cg-toolkit/include/Cg/ /usr/include/Cg
> should do the Trick
> 

yea, but that's dog ugly and then it doesn't resolve the problem of finding the libraries.  I think Ogre's configure.ac needs a --with-cg=<path> option, that's probably the cleanest solution.  But we still have to check to find out if cg is in /opt or not (depending upon which version of cg they have installed)
Comment 28 Tolga Dalman 2009-12-05 13:26:45 UTC
Still broken with media-gfx/nvidia-cg-toolkit-2.1.0017 and dev-games/ogre-1.6.4. Any progress here ?
Comment 29 Mr. Bones. (RETIRED) gentoo-dev 2009-12-21 20:45:36 UTC
worked around it with append-fooflags.
Comment 30 Frank Richter 2009-12-21 22:30:52 UTC
However, that resolution still doesn't help squat for anything outside portage.
Comment 31 thunder367 2013-01-26 16:39:36 UTC
Hi!

See also Bug #259169
Comment 32 thunder367 2013-01-26 16:40:27 UTC
(In reply to comment #31)
> Hi!
> 
> See also Bug #259169

Oops, ssory #443546