Error during MAKE of cudasdk example
Hi to everybody!

First of all I want to present myself: I'm paolo, an italian student of the Milano University Bicocca. I'm italian so SORRY FOR MY ENGLISH. I'm studying every day to improve it so I want to apologize if I'm going to write something wrong.

However...

I'm doing a thesis on CUDA and OPENCL computing and I'm installing the cuda sdk on my mac.

These are the specs of my mac:

MacBook4,1 2,4 GHz 2 GB ram GMA X3100

I know that CUDA runs only on NVIDIA gpu and I have a 8800GT in my other pc. I just installed the toolkit and sdk to try and compile CUDA code on my mac.

I'm running Snow Leopard 10.6.2 and I'm following the NVIDIA guide: Getting Started
NVIDIA CUDA Development
Tools 2.3 Installation and Verification on Mac OS X

I installed the these two files: cudatoolkit_2.3a_macos_32.pkg and gpucomputingsdk_2.3a_macos_32.pkg.

I changed the PATH variable and the other one ...

The problem is that when I try to make the Makefile in /Developer/GPU..../C I have this error:

[codebox]make emu=1
a - obj/i386/release/bank_checker.cpp.o
a - obj/i386/release/cmd_arg_reader.cpp.o
a - obj/i386/release/cutil.cpp.o
a - obj/i386/release/stopwatch.cpp.o
a - obj/i386/release/stopwatch_linux.cpp.o
a - obj/i386/release/multithreading.cpp.o
a - obj/i386/release/paramgl.cpp.o
a - obj/i386/release/param.cpp.o
src/rendercheck_gl.cpp:58: warning: unused parameter ‘bQAReadback’
src/rendercheck_gl.cpp:58: warning: unused parameter ‘bUseFBO’
src/rendercheck_gl.cpp: In member function ‘virtual bool CheckRender::PGMvsPGM(const char*, const char*, float, float)’:
src/rendercheck_gl.cpp:148: warning: too many arguments for format
src/rendercheck_gl.cpp: In member function ‘virtual bool CheckRender::PPMvsPPM(const char*, const char*, float, float)’:
src/rendercheck_gl.cpp:194: warning: too many arguments for format
src/rendercheck_gl.cpp:187: warning: unused variable ‘src_data’
src/rendercheck_gl.cpp:187: warning: unused variable ‘ref_data’
src/rendercheck_gl.cpp: In member function ‘virtual bool CheckRender::compareBin2BinUint(const char*, const char*, unsigned int, float, float)’:
src/rendercheck_gl.cpp:230: warning: too few arguments for format
src/rendercheck_gl.cpp:232: warning: too many arguments for format
src/rendercheck_gl.cpp: In member function ‘virtual bool CheckBackBuffer::readback(GLuint, GLuint, GLuint)’:
src/rendercheck_gl.cpp:463: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’
src/rendercheck_gl.cpp:467: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’
src/rendercheck_gl.cpp: At global scope:
src/rendercheck_gl.cpp:522: warning: unused parameter ‘Bpp’
src/rendercheck_gl.cpp:549: warning: unused parameter ‘width’
src/rendercheck_gl.cpp:549: warning: unused parameter ‘height’
src/rendercheck_gl.cpp:549: warning: unused parameter ‘Bpp’
src/rendercheck_gl.cpp:564: warning: unused parameter ‘width’
src/rendercheck_gl.cpp:564: warning: unused parameter ‘height’
src/rendercheck_gl.cpp:564: warning: unused parameter ‘Bpp’
src/rendercheck_gl.cpp:706: warning: unused parameter ‘width’
src/rendercheck_gl.cpp:706: warning: unused parameter ‘height’
src/rendercheck_gl.cpp: In member function ‘virtual bool CheckFBO::readback(GLuint, GLuint, GLuint)’:
src/rendercheck_gl.cpp:1273: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’
src/rendercheck_gl.cpp:1277: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’
a - obj/i386/release/rendercheck_gl.cpp.o
make -C src/3DFD/
ld: warning: in obj/i386/emurelease/3dfd.cu.o, file is not of required architecture
ld: warning: in /usr/local/cuda/lib/libcudart.dylib, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [../../bin/darwin/emurelease/3dfd] Error 1
make: *** [src/3DFD/Makefile.ph_build] Error 2[/codebox]



I typed emu=1 as written in the guide because I have no NVIDIA card.

I don't really know how to solve this problem. /sweat.gif' class='bbc_emoticon' alt=':sweat:' />

Every kind of help would be appreciated :rolleyes:

Thank you in advance.

Bye, Paolo
Hi to everybody!



First of all I want to present myself: I'm paolo, an italian student of the Milano University Bicocca. I'm italian so SORRY FOR MY ENGLISH. I'm studying every day to improve it so I want to apologize if I'm going to write something wrong.



However...



I'm doing a thesis on CUDA and OPENCL computing and I'm installing the cuda sdk on my mac.



These are the specs of my mac:



MacBook4,1 2,4 GHz 2 GB ram GMA X3100



I know that CUDA runs only on NVIDIA gpu and I have a 8800GT in my other pc. I just installed the toolkit and sdk to try and compile CUDA code on my mac.



I'm running Snow Leopard 10.6.2 and I'm following the NVIDIA guide: Getting Started

NVIDIA CUDA Development

Tools 2.3 Installation and Verification on Mac OS X



I installed the these two files: cudatoolkit_2.3a_macos_32.pkg and gpucomputingsdk_2.3a_macos_32.pkg.



I changed the PATH variable and the other one ...



The problem is that when I try to make the Makefile in /Developer/GPU..../C I have this error:



[codebox]make emu=1

a - obj/i386/release/bank_checker.cpp.o

a - obj/i386/release/cmd_arg_reader.cpp.o

a - obj/i386/release/cutil.cpp.o

a - obj/i386/release/stopwatch.cpp.o

a - obj/i386/release/stopwatch_linux.cpp.o

a - obj/i386/release/multithreading.cpp.o

a - obj/i386/release/paramgl.cpp.o

a - obj/i386/release/param.cpp.o

src/rendercheck_gl.cpp:58: warning: unused parameter ‘bQAReadback’

src/rendercheck_gl.cpp:58: warning: unused parameter ‘bUseFBO’

src/rendercheck_gl.cpp: In member function ‘virtual bool CheckRender::PGMvsPGM(const char*, const char*, float, float)’:

src/rendercheck_gl.cpp:148: warning: too many arguments for format

src/rendercheck_gl.cpp: In member function ‘virtual bool CheckRender::PPMvsPPM(const char*, const char*, float, float)’:

src/rendercheck_gl.cpp:194: warning: too many arguments for format

src/rendercheck_gl.cpp:187: warning: unused variable ‘src_data’

src/rendercheck_gl.cpp:187: warning: unused variable ‘ref_data’

src/rendercheck_gl.cpp: In member function ‘virtual bool CheckRender::compareBin2BinUint(const char*, const char*, unsigned int, float, float)’:

src/rendercheck_gl.cpp:230: warning: too few arguments for format

src/rendercheck_gl.cpp:232: warning: too many arguments for format

src/rendercheck_gl.cpp: In member function ‘virtual bool CheckBackBuffer::readback(GLuint, GLuint, GLuint)’:

src/rendercheck_gl.cpp:463: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’

src/rendercheck_gl.cpp:467: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’

src/rendercheck_gl.cpp: At global scope:

src/rendercheck_gl.cpp:522: warning: unused parameter ‘Bpp’

src/rendercheck_gl.cpp:549: warning: unused parameter ‘width’

src/rendercheck_gl.cpp:549: warning: unused parameter ‘height’

src/rendercheck_gl.cpp:549: warning: unused parameter ‘Bpp’

src/rendercheck_gl.cpp:564: warning: unused parameter ‘width’

src/rendercheck_gl.cpp:564: warning: unused parameter ‘height’

src/rendercheck_gl.cpp:564: warning: unused parameter ‘Bpp’

src/rendercheck_gl.cpp:706: warning: unused parameter ‘width’

src/rendercheck_gl.cpp:706: warning: unused parameter ‘height’

src/rendercheck_gl.cpp: In member function ‘virtual bool CheckFBO::readback(GLuint, GLuint, GLuint)’:

src/rendercheck_gl.cpp:1273: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’

src/rendercheck_gl.cpp:1277: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘GLuint’

a - obj/i386/release/rendercheck_gl.cpp.o

make -C src/3DFD/

ld: warning: in obj/i386/emurelease/3dfd.cu.o, file is not of required architecture

ld: warning: in /usr/local/cuda/lib/libcudart.dylib, file is not of required architecture

Undefined symbols:

"_main", referenced from:

start in crt1.10.6.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

make[1]: *** [../../bin/darwin/emurelease/3dfd] Error 1

make: *** [src/3DFD/Makefile.ph_build] Error 2[/codebox]







I typed emu=1 as written in the guide because I have no NVIDIA card.



I don't really know how to solve this problem. /sweat.gif' class='bbc_emoticon' alt=':sweat:' />



Every kind of help would be appreciated :rolleyes:



Thank you in advance.



Bye, Paolo

#1
Posted 02/27/2010 04:41 PM   
I found this solution but I didn't really understand how he solved it:

"...after pointing the gcc symbolic link int /Developer/usr/bin to gcc-4.0, compile your cuda projects with the -m32 flag added to all phases of the build: gcc compiles, nvcc compiles, and linking. Doing this fixed my snow leopard problems and everything is running for me now."

(from this forum: [url="http://forums.nvidia.com/index.php?showtopic=105608)"]http://forums.nvidia.com/index.php?showtopic=105608)[/url].

Can someone help me, please?

Thanks in advance to everyone.

Bye, Paolo.
I found this solution but I didn't really understand how he solved it:



"...after pointing the gcc symbolic link int /Developer/usr/bin to gcc-4.0, compile your cuda projects with the -m32 flag added to all phases of the build: gcc compiles, nvcc compiles, and linking. Doing this fixed my snow leopard problems and everything is running for me now."



(from this forum: http://forums.nvidia.com/index.php?showtopic=105608).



Can someone help me, please?



Thanks in advance to everyone.



Bye, Paolo.

#2
Posted 02/27/2010 05:04 PM   
I read now this thread and I'm trying to use these advices but they change only the type of error:


Fix 1:
NVCC is not compatible with gcc and g++ 4.2, but these are the default compilers on Snow Leopard and nvcc uses the defaults.
The solution is to make versions 4.0 the system defaults again (as was the case with Leopard)

To remove the symbolic links to versions 4.2 and re-create the links to versions 4.0 execute:

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc

sudo rm /usr/bin/g++
sudo ln -s /usr/bin/g++-4.0 /usr/bin/g++


Fix 2:
CUDA is not yet capable of 64bit development under OS X, but it looks like the compilers now default to creating 64bit code.
To prevent that, the parameter -m32 needs to be passed to all compilers (gcc, g++ and nvcc).

In order to build the CUDA SDK samples on SL, the following adjustments are needed to the SDKs common make file:

Edit /Developer/GPU Computing/C/common/common.mk

The lines
NVCCFLAGS :=
CXXFLAGS := $(CXXWARN_FLAGS)
CFLAGS := $(CWARN_FLAGS)

Need to be changed to
NVCCFLAGS := -m32
CXXFLAGS := -m32 $(CXXWARN_FLAGS)
CFLAGS := -m32 $(CWARN_FLAGS)



now mi error is:
[codebox]make emu=1
make -C src/3DFD/
ld: warning: in ../../lib/libcutil_i386.a, file is not of required architecture
make -C src/alignedTypes/
ld: warning: in ../../lib/libcutil_i386.a, file is not of required architecture
Undefined symbols:
"_cutDeleteTimer", referenced from:
_main in alignedTypes.cu.o
"_cutGetTimerValue", referenced from:
void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o
void runTest<RGBA32>(int, int)in alignedTypes.cu.o
void runTest<RGB32>(int, int)in alignedTypes.cu.o
void runTest<LA32>(int, int)in alignedTypes.cu.o
void runTest<unsigned int>(int, int)in alignedTypes.cu.o
void runTest<RGBA8>(int, int)in alignedTypes.cu.o
void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o
void runTest<unsigned short>(int, int)in alignedTypes.cu.o
void runTest<unsigned char>(int, int)in alignedTypes.cu.o
"_cutStartTimer", referenced from:
void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o
void runTest<RGBA32>(int, int)in alignedTypes.cu.o
void runTest<RGB32>(int, int)in alignedTypes.cu.o
void runTest<LA32>(int, int)in alignedTypes.cu.o
void runTest<unsigned int>(int, int)in alignedTypes.cu.o
void runTest<RGBA8>(int, int)in alignedTypes.cu.o
void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o
void runTest<unsigned short>(int, int)in alignedTypes.cu.o
void runTest<unsigned char>(int, int)in alignedTypes.cu.o
"_cutCreateTimer", referenced from:
_main in alignedTypes.cu.o
"_cutResetTimer", referenced from:
void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o
void runTest<RGBA32>(int, int)in alignedTypes.cu.o
void runTest<RGB32>(int, int)in alignedTypes.cu.o
void runTest<LA32>(int, int)in alignedTypes.cu.o
void runTest<unsigned int>(int, int)in alignedTypes.cu.o
void runTest<RGBA8>(int, int)in alignedTypes.cu.o
void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o
void runTest<unsigned short>(int, int)in alignedTypes.cu.o
void runTest<unsigned char>(int, int)in alignedTypes.cu.o
"_cutStopTimer", referenced from:
void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o
void runTest<RGBA32>(int, int)in alignedTypes.cu.o
void runTest<RGB32>(int, int)in alignedTypes.cu.o
void runTest<LA32>(int, int)in alignedTypes.cu.o
void runTest<unsigned int>(int, int)in alignedTypes.cu.o
void runTest<RGBA8>(int, int)in alignedTypes.cu.o
void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o
void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o
void runTest<unsigned short>(int, int)in alignedTypes.cu.o
void runTest<unsigned char>(int, int)in alignedTypes.cu.o
"_cutCheckCmdLineFlag", referenced from:
_main in alignedTypes.cu.o
_main in alignedTypes.cu.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [../../bin/darwin/emurelease/alignedTypes] Error 1
make: *** [src/alignedTypes/Makefile.ph_build] Error 2
[/codebox]


I will try to do any other thing to fix this thing.

If anyone has something to say, please write it here. Thanks, Bye
I read now this thread and I'm trying to use these advices but they change only the type of error:





Fix 1:

NVCC is not compatible with gcc and g++ 4.2, but these are the default compilers on Snow Leopard and nvcc uses the defaults.

The solution is to make versions 4.0 the system defaults again (as was the case with Leopard)



To remove the symbolic links to versions 4.2 and re-create the links to versions 4.0 execute:



sudo rm /usr/bin/gcc

sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc



sudo rm /usr/bin/g++

sudo ln -s /usr/bin/g++-4.0 /usr/bin/g++





Fix 2:

CUDA is not yet capable of 64bit development under OS X, but it looks like the compilers now default to creating 64bit code.

To prevent that, the parameter -m32 needs to be passed to all compilers (gcc, g++ and nvcc).



In order to build the CUDA SDK samples on SL, the following adjustments are needed to the SDKs common make file:



Edit /Developer/GPU Computing/C/common/common.mk



The lines

NVCCFLAGS :=

CXXFLAGS := $(CXXWARN_FLAGS)

CFLAGS := $(CWARN_FLAGS)



Need to be changed to

NVCCFLAGS := -m32

CXXFLAGS := -m32 $(CXXWARN_FLAGS)

CFLAGS := -m32 $(CWARN_FLAGS)







now mi error is:

[codebox]make emu=1

make -C src/3DFD/

ld: warning: in ../../lib/libcutil_i386.a, file is not of required architecture

make -C src/alignedTypes/

ld: warning: in ../../lib/libcutil_i386.a, file is not of required architecture

Undefined symbols:

"_cutDeleteTimer", referenced from:

_main in alignedTypes.cu.o

"_cutGetTimerValue", referenced from:

void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

void runTest<RGBA32>(int, int)in alignedTypes.cu.o

void runTest<RGB32>(int, int)in alignedTypes.cu.o

void runTest<LA32>(int, int)in alignedTypes.cu.o

void runTest<unsigned int>(int, int)in alignedTypes.cu.o

void runTest<RGBA8>(int, int)in alignedTypes.cu.o

void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

void runTest<unsigned short>(int, int)in alignedTypes.cu.o

void runTest<unsigned char>(int, int)in alignedTypes.cu.o

"_cutStartTimer", referenced from:

void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

void runTest<RGBA32>(int, int)in alignedTypes.cu.o

void runTest<RGB32>(int, int)in alignedTypes.cu.o

void runTest<LA32>(int, int)in alignedTypes.cu.o

void runTest<unsigned int>(int, int)in alignedTypes.cu.o

void runTest<RGBA8>(int, int)in alignedTypes.cu.o

void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

void runTest<unsigned short>(int, int)in alignedTypes.cu.o

void runTest<unsigned char>(int, int)in alignedTypes.cu.o

"_cutCreateTimer", referenced from:

_main in alignedTypes.cu.o

"_cutResetTimer", referenced from:

void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

void runTest<RGBA32>(int, int)in alignedTypes.cu.o

void runTest<RGB32>(int, int)in alignedTypes.cu.o

void runTest<LA32>(int, int)in alignedTypes.cu.o

void runTest<unsigned int>(int, int)in alignedTypes.cu.o

void runTest<RGBA8>(int, int)in alignedTypes.cu.o

void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

void runTest<unsigned short>(int, int)in alignedTypes.cu.o

void runTest<unsigned char>(int, int)in alignedTypes.cu.o

"_cutStopTimer", referenced from:

void runTest<RGBA32_2>(int, int)in alignedTypes.cu.o

void runTest<RGBA32>(int, int)in alignedTypes.cu.o

void runTest<RGB32>(int, int)in alignedTypes.cu.o

void runTest<LA32>(int, int)in alignedTypes.cu.o

void runTest<unsigned int>(int, int)in alignedTypes.cu.o

void runTest<RGBA8>(int, int)in alignedTypes.cu.o

void runTest<RGBA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGB32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<LA32_misaligned>(int, int)in alignedTypes.cu.o

void runTest<RGBA8_misaligned>(int, int)in alignedTypes.cu.o

void runTest<unsigned short>(int, int)in alignedTypes.cu.o

void runTest<unsigned char>(int, int)in alignedTypes.cu.o

"_cutCheckCmdLineFlag", referenced from:

_main in alignedTypes.cu.o

_main in alignedTypes.cu.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

make[1]: *** [../../bin/darwin/emurelease/alignedTypes] Error 1

make: *** [src/alignedTypes/Makefile.ph_build] Error 2

[/codebox]





I will try to do any other thing to fix this thing.



If anyone has something to say, please write it here. Thanks, Bye

#3
Posted 02/27/2010 05:57 PM   
All resolved.

To see the solution, look at the post: NVIDIA Forums > CUDA GPU Computing > CUDA on Mac OS X > Instructions for making CUDA 2.3 work on Snow Leopard, How to fix permissions and nvcc linker errors

[topic="105940"]CLICK HERE[/topic] to see the solution.

This thread can be CLOSED.

Thanks to everyone.
All resolved.



To see the solution, look at the post: NVIDIA Forums > CUDA GPU Computing > CUDA on Mac OS X > Instructions for making CUDA 2.3 work on Snow Leopard, How to fix permissions and nvcc linker errors



[topic="105940"]CLICK HERE[/topic] to see the solution.



This thread can be CLOSED.



Thanks to everyone.

#4
Posted 03/01/2010 09:19 PM   
Scroll To Top