CULA on Mac how to compile

Hi all,

Does anyone know how to add/link CULA using the makefiles that exist when CUDA 3.2 is installed? I’m not familiar with makefiles so it is very hard to work out where I need to add paths/link libraries etc.

Thanks,

You can solve this problem as follows:

1- Add verbose := 1 in the Makefile in the directory where the source is in. This shows how the whole gigantic compile process of CUDA is being done on the MAC OSX.
2- Copy and past the output to your own makefile and edit as you see fit.

I did mine this way: (notice I have added the CULA paths and libs)

########################################################################################

NVCC=/usr/local/cuda/bin/nvcc
NVCCFLAGS=-gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" -m32 --compiler-options

GPP=g++
GPPFLAGS1=-fPIC -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses
-Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function
GPPARCH=-arch i386
LINKAGE=-Xlinker -rpath

LIBPATH32=-L${CULA_LIB_PATH_32}
LIBPATH64=-L${CULA_LIB_PATH_64}

ROOTDIR=/Developer/GPU\ Computing/C
CUDA_INSTALL_PATH=/usr/local/cuda
INCLUDES=-I$(CUDA_INSTALL_PATH)/include -I$(ROOTDIR)/common/inc -I$(ROOTDIR)/…/shared/inc -I${CULA_INC_PATH}
LIBPATH=-L$(CUDA_INSTALL_PATH)/lib -L…/…/lib -L…/…/common/lib/darwin -L…/…/…/shared//lib $(LIBPATH32)

LIBS=-lcudart -lcula -lcublas

build64:
${GPP} $(GPPFLAGS1) $(GPPARCH) -fno-strict-aliasing $(INCLUDES) -DUNIX -O2 -o testCuda_gold.cpp.o -c testCuda_gold.cpp
${NVCC} $(NVCCFLAGS) -fno-strict-aliasing $(INCLUDES) -DUNIX -O2 -o testCuda.cu.o -c testCuda.cu
${GPP} -fPIC $(GPPARCH) -Xlinker -rpath $(CUDA_INSTALL_PATH)/lib -o testCuda testCuda_gold.cpp.o testCuda.cu.o $(LIBPATH) $(LIBS) $(LIBPATH) $(LIBS) -lcutil_i386 -lshrutil_i386 -cula

rm -fr *.o

########################################################################################

This may be ugly to some, but it works.