You may successfull compile all Cuda SDK 4.1 with gcc-4.7.0 (with my ebuild for gcc 4.7.0) on Linux Gentoo
http://portage.perestoroniny.ru/sys-devel/gcc/
http://portage.perestoroniny.ru/dev-util/nvidia-cuda-sdk/
http://portage.perestoroniny.ru/dev-util/nvidia-cuda-toolkit/
http://perestoroniny.ru/site/software
Keys of changes are clear in following diffs:
— nvidia-cuda-toolkit-4.1.ebuild
+++ nvidia-cuda-toolkit-4.1-r4.ebuild
@@ -34,6 +34,15 @@
#QA_DT_HASH_x86=“opt/cuda/."
#QA_DT_HASH_amd64="opt/cuda/.”
+src_unpack() {
+}
+
src_install() {
local DEST=/opt/cuda
— include/host_config.h
+++ include/host_config.h
@@ -79,7 +79,7 @@
#if GNUC > 4 || (GNUC == 4 && GNUC_MINOR > 5)
-#error – unsupported GNU version! gcc 4.6 and up are not supported!
+//#error – unsupported GNU version! gcc 4.8 and up are not supported!
#endif /* GNUC> 4 || (GNUC == 4 && GNUC_MINOR > 5) */
— nvidia-cuda-sdk-4.1.ebuild
+++ nvidia-cuda-sdk-4.1-r6.ebuild
@@ -4,7 +4,7 @@
EAPI=2
-inherit unpacker toolchain-funcs
+inherit unpacker toolchain-funcs eutils
DESCRIPTION=“NVIDIA CUDA Software Development Kit”
HOMEPAGE=“http://developer.nvidia.com/cuda”
@@ -20,7 +20,7 @@
IUSE=“debug +doc +examples opencl +cuda”
RDEPEND=">=dev-util/nvidia-cuda-toolkit-4.1
DEPEND=“${RDEPEND}”
@@ -37,6 +37,12 @@
echo $(gcc-major-version) $(gcc-minor-version)
}
+src_prepare() {
/opt/cuda:’ sdk/shared/common.mk sdk/C/common/common.mk
–compiler-options -ansi|’ sdk/shared/common.mk sdk/C/common/common.mk
+}
+
src_compile() {
if ! use examples; then
return
test # cat sdk_shared_inc_stdio.h
#undef _GLIBCXX_ATOMIC_BUILTINS
#include “/usr/include/stdio.h”