Libraries not of required architecture when building SDK examples

Hi all,

I just installed Snow Leopard today. Then I downloaded version 2.3 of the CUDA driver (Snow Leopard version), toolkit and SDK from the webpage. When I run make from /Developer/SDKs/NVIDIA_CUDA_SDK_MACOSX/ I get:

(head-mac NVIDIA_CUDA_SDK_MACOSX) make
q - obj/release/bank_checker.cpp_o
q - obj/release/cmd_arg_reader.cpp_o
q - obj/release/cutil.cpp_o
q - obj/release/stopwatch.cpp_o
q - obj/release/stopwatch_linux.cpp_o
q - obj/release/multithreading.cpp_o
q - obj/release/paramgl.cpp_o
q - obj/release/param.cpp_o
make -C projects/alignedTypes/
ld: warning: in obj/release/alignedTypes.cu_o, file is not of required architecture
ld: warning: in /usr/local/cuda/lib/libcudart.dylib, file is not of required architecture
ld: warning: in …/…/lib/libcutil.a, 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/macosx/release/alignedTypes] Error 1
make: *** [projects/alignedTypes/Makefile.ph_build] Error 2
(head-mac NVIDIA_CUDA_SDK_MACOSX)

Thanks in advance for any help,

Anand

This is probably relevant:

(head-mac notes) gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646)

could you check these files?

uname -a

file alignedTypes.cu_o

file libcudart.dylib

can you make other sample projects?

Sure:

uname -a : Darwin sihpc03.zoo.ox.ac.uk 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386 i386

/Developer/SDKs/NVIDIA_CUDA_SDK_MACOSX/projects/alignedTypes/obj/release/alignedTypes.cu_o: Mach-O object i386

/usr/local/cuda/lib/libcudart.dylib: Mach-O dynamically linked shared library i386

I haven’t been able to build any sample projects.

Thanks,
Anand

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.

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.