Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 347497 - dev-util/nvidia-cuda-sdk-3.2: compile errors with GCC 4.5.1
Summary: dev-util/nvidia-cuda-sdk-3.2: compile errors with GCC 4.5.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Michal Januszewski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-02 02:11 UTC by Richard
Modified: 2010-12-12 14:55 UTC (History)
1 user (show)

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


Attachments
Ebuild for nvidia-cuda-sdk-3.2 (nvidia-cuda-sdk-3.2.ebuild,1.62 KB, text/plain)
2010-12-03 17:01 UTC, Gary Macindoe
Details
Patch to ebuild to filter out examples that don't compile with gcc-4.5.1 (nvidia-cuda-sdk-3.2.9-gcc45.patch,760 bytes, patch)
2010-12-03 17:02 UTC, Gary Macindoe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2010-12-02 02:11:32 UTC
The ebuild fails to build with GCC 4.5.1.

Reproducible: Always

Steps to Reproduce:
1. Switch the system compiler to GCC 4.5.1.
2. emerge -1v =dev-util/nvidia-cuda-sdk-3.2
3. Watch it fail.




I originally had this in a local overlay before the official Gentoo ebuild was available. I recently switched to GCC 4.5.1 and this package will not build. I thought it was my ebuild that was causing it, but I removed my ebuild from my local overlay to switch to the in-tree version and it does not build either way.

# emerge --info dev-util/nvidia-cuda-sdk
Portage 2.1.9.25 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.1, glibc-2.12.1-r3, 2.6.36.1 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.36.1-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 02 Dec 2010 00:15:01 +0000
ccache version 3.1.3 [enabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r2
dev-lang/python:     2.6.6-r1, 2.7.1, 3.1.3
dev-util/ccache:     3.1.3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1-r1
sys-apps/openrc:     0.6.6
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5, 4.5.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -mtune=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
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.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/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"
CXXFLAGS="-march=core2 -mtune=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg ccache distlocks fixlafiles fixpackages multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=core2 -mtune=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.mirrors.tds.net/gentoo http://gentoo.netnitco.net"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="/var/lib/layman/java-overlay /var/lib/layman/vmware /var/lib/layman/sunrise /var/lib/layman/Spring /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 berkdb branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig fortran gdbm gif gpm hal iconv ipv6 java jpeg kde lcms ldap libnotify lzma mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl png ppds pppd python qt3support qt4 readline sdl session spell sse sse2 ssl ssse3 startup-notification svg sysfs tcpd theora tiff truetype unicode usb vdpau vorbis x264 xcb xcomposite xml xorg xulrunner xv xvid xvmc zlib zsh-completion" ALSA_CARDS="snd-ctxfi" 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 cgi cgid 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" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-util/nvidia-cuda-sdk-3.2 was built with the following:
USE="cuda doc examples (multilib) opencl -debug"
Comment 1 Charl van Deventer 2010-12-03 10:24:44 UTC
The issue is with the nvidia nvcc compiler and is known upstream.  Looking at the release notes, GCC-4.4.4 is the newest gcc that it plays well with.  This is also an issue with earlier SDK versions.

What fails to compile is the examples.  Simply emerging it with USE="-examples" makes the error go away.  Its either that or setting your system to use an earlier GCC, emerging the sdk, then setting it back to GCC-4.5.x.

Note that what fails is the inclusion of stl or other complex headers in .cu files.  Development for CUDA under GCC 4.5.x still works well, solong as you keep the .cu source file as header free as possible.
Comment 2 Charl van Deventer 2010-12-03 11:22:01 UTC
Confirmed that nvidia-cuda-sdk emerges successfully with USE="examples" using =sys-devel/gcc-4.4.3-r3.  gcc 4.4.4 is not tested but suspected to be working as well.

[ebuild   R   ] dev-util/nvidia-cuda-sdk-3.2  USE="cuda doc examples opencl -debug" 0 kB

Also confirmed that nvidia-cuda-sdk emerges successfully with USE="-examples" using =sys-devel/gcc-4.5.1-r1.

[ebuild   R   ] dev-util/nvidia-cuda-sdk-3.2  USE="cuda doc -examples opencl -debug" 0 kB
Comment 3 Gary Macindoe 2010-12-03 17:01:18 UTC
Created attachment 256254 [details]
Ebuild for nvidia-cuda-sdk-3.2

The ebuild from my local overlay to install the nVidia CUDA SDK version 3.2.9.
Comment 4 Gary Macindoe 2010-12-03 17:02:20 UTC
Created attachment 256255 [details, diff]
Patch to ebuild to filter out examples that don't compile with gcc-4.5.1
Comment 5 Michal Januszewski (RETIRED) gentoo-dev 2010-12-12 14:55:26 UTC
I added a check for GCC 4.4, similar to what was used in SDK 3.0 and older.  I would rather not have the ebuild skip compiling some examples depending on the installed GCC version -- the ebuild should always work completely, or not at all, in which case the user should be informed about what to do to mitigate the problem.