Compiling examples PROBLEM

hi All

I am trying to install CUDA on my macbook with snow leopard 10.6.7 and NVIDIA GeForce 9400M. I follow the getting started guide for Mac OS X but when compiling the Examples (“make”) in the /Developer/GPU Computing/C directory I get the following error (both for 3.2 and 4.0). It seems to me that the make command does not really like my MPI installation, but I have no idea how to solve this issue.

/opt/local/include/mpich2/mpicxx.h:1889: warning: unused parameter ‘oldwin’
/opt/local/include/mpich2/mpicxx.h:1889: warning: unused parameter ‘keyval’
/opt/local/include/mpich2/mpicxx.h:1889: warning: unused parameter ‘ex’
ld: warning: in obj/i386/release/simpleMPI.cu.o, file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in …/…/lib/libcutil_i386.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in …/…/…/shared//lib/libshrutil_i386.a, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
“_sum”, referenced from:
_main in simpleMPI.cpp.o
“_initData”, referenced from:
_main in simpleMPI.cpp.o
“_computeGPU”, referenced from:
_main in simpleMPI.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
ld: warning: in /opt/local/lib/libmpichcxx.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libpmpich.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libmpich.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libopa.a, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
“_MPI_Finalize”, referenced from:
_main in simpleMPI.cpp.o
“_MPI_Scatter”, referenced from:
_main in simpleMPI.cpp.o
“_MPI_Comm_size”, referenced from:
_main in simpleMPI.cpp.o
“_MPI_Comm_rank”, referenced from:
_main in simpleMPI.cpp.o
“_MPI_Init”, referenced from:
_main in simpleMPI.cpp.o
“_MPI_Reduce”, referenced from:
_main in simpleMPI.cpp.o
“_MPI_Abort”, referenced from:
_my_abort in simpleMPI.cpp.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can’t open input file: /var/folders/64/64RSjzx5GVOWYNxkioIjTE+++TI/-Tmp-//ccs062il.out (No such file or directory)
make[1]: *** […/…/bin/darwin/release/simpleMPI] Error 1
make: *** [src/simpleMPI/Makefile.ph_build] Error 2
Jan-Decas-MacBook:C jandeca$

Many thanks and best regards

Jan

Hi Jan,

I just installed the newest Cuda 4.0 on my Macbook Pro running Snow Leopard 10.6.6 and NVIDIA GeForce 9400M. I noticed that it was producing i386 code (32 bit code) so I investigated. The solution was to type (from the “C” directory you type “make” in, per the getting started instructions):

make clean
make x86_64=1

This makes 64 bit libraries and example programs. I think you should try this. If your MPI installation is 64 bit, then perhaps Cuda needs to be 64 bit as well for them to play nice. (I think the reason for this strangeness comes from the fact that Mac OS X has a 32 bit kernel, and NVIDIA’s makefile uses “uname” to determine the correct architecture, but doesn’t get the hint to cross-compile and produce 64 bit code instead by realizing its snow leopard. Although there is mention of snow leopard in the makefile, so maybe there is a mistake in the makefile, since you’d expect the 64 bit build to be the default. I really can’t say. I just know that the above approach seems to work.)

-Shaun