Here’s the patch file :
[codebox]— /usr/include/c++/4.2.1/i586-suse-linux/bits/c++config.h 2007-09-21 20:08:23.000000000 +0200
+++ /usr/local/cuda/include/c++config.patched.h 2008-02-27 13:30:26.000000000 +0100
@@ -47,7 +47,7 @@
define GLIBCXX 20070724
// Macros for visibility.
-# define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1
+//# define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1
#if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
define _GLIBCXX_VISIBILITY(V) attribute ((visibility (#V))
— /usr/include/c++/4.2.1/ext/atomicity.h 2007-09-21 20:08:19.000000000 +0200
+++ /usr/local/cuda/include/atomicity.patched.h 2008-02-27 13:34:15.000000000 +0100
@@ -45,7 +45,7 @@
// To abstract locking primatives across all thread policies, use:
// __exchange_and_add_dispatch
// __atomic_add_dispatch
-ifdef _GLIBCXX_ATOMIC_BUILTINS
+#if 0
static inline _Atomic_word
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{ return __sync_fetch_and_add(__mem, __val); }
— /usr/local/cuda/include/cuda_runtime.h.orig 2008-02-27 13:35:26.000000000 +0100
+++ /usr/local/cuda/include/cuda_runtime.h 2008-02-27 13:35:26.000000000 +0100
@@ -36,6 +36,10 @@
#if !defined(CUDA_RUNTIME_H)
define CUDA_RUNTIME_H
+#include “c++config.patched.h”
+#include “atomicity.patched.h”
/*******************************************************************************
-
* -
*
[/codebox]
“/usr/include/c++/4.2.1/i586-suse-linux/bits/c++config.h” was copied to “/usr/local/cuda/include/c++config.patched.h”
“/usr/include/c++/4.2.1/ext/atomicity.h” was copied to “/usr/local/cuda/include/atomicity.patched.h”
First you copy the two system files, and make a backup of “cuda_runtime.h”
Then either you copy paste the patch and use “patch” on it, or you manually edit the files at the line numbers indicated after the “@@” symbols.