In working to update the cuda support on Arch Linux I’ve run across the following problem. Our approach so far has been to patch the common.mk file using the workaround proposed for cuda sdk 2.3. So first we apply the following patch to common.mk.
[codebox]
— pkg/sdk/C/common/common.mk 2010-03-03 22:14:46.000000000 +0900
+++ pkg/sdk/C/common/common.mk.fix 2010-03-29 20:39:15.000000000 +0900
@@ -55,7 +55,7 @@
SHAREDDIR := $(ROOTDIR)/…/…/shared/
Compilers
-NVCC := $(CUDA_INSTALL_PATH)/bin/nvcc
+NVCC := nvcc
CXX := g++
CC := gcc
LINK := g++ -fPIC
@@ -89,7 +89,7 @@
architecture flag for nvcc and gcc compilers build
CUBIN_ARCH_FLAG :=
CXX_ARCH_FLAGS :=
-NVCCFLAGS :=
+NVCCFLAGS := --compiler-options -fno-inline
LIB_ARCH := $(OSARCH)
Determining the necessary Cross-Compilation Flags
[/codebox]
Next we perform make in the /sdk/C directory. When building gcc / nvcc errors out while compiling postProcessGL. An error log follows:
[codebox]make[1]: Entering directory `/home/XXXXX/build/cuda-sdk/src/pkg/sdk/C/src/postProcessGL’
main.cpp:158: note: #pragma message: Note: Using Texture fmt GL_RGBA16F_ARB
…/…/…/shared//inc/shrUtils.h:55: warning: ‘nGpuArchCoresPerSM’ defined but not used
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/…/…/…/…/include/c++/4.4.3/x86_64-unknown-linux-gnu/bits/c++locale.h: In function ‘int std::__convert_from_v(__locale_struct* const&, char*, int, const char*, …)’:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/…/…/…/…/include/c++/4.4.3/x86_64-unknown-linux-gnu/bits/c++locale.h:86: error: ‘__builtin_stdarg_start’ was not declared in this scope
make[1]: *** [obj/x86_64/release/postProcessGL.cu.o] Error 1
make[1]: Leaving directory `/home/XXXXX/build/cuda-sdk/src/pkg/sdk/C/src/postProcessGL’
make: *** [src/postProcessGL/Makefile.ph_build] Error 2
[/codebox]
This build error was produce on Arch Linux 2.6.32, 64 bit, gcc 4.4.3, and cuda-toolkit 3.0.
Has anyone else built cuda-sdk 3.0 using gcc 4.4? How did you patch sdk/C/common/common.mk?