Home | Contents | Latest | Previous | Next

Re-using CUDA's Makefile

From: "andrew cooke" <andrew@...>

Date: Sun, 20 Jul 2008 16:45:44 -0400 (CLT)

I had problems with using the supplied Makefile to compile CUDA problems. 
The issue seems to have been just a missing trailing slash.  So here's a
summary, based on copying the matrixMul project to another location and
trying to compile it there.

- export verbose=1 turns on verbose details during compile
- export dbg=1 does a debug build

- export SRCDIR=... must contain a trailing slash or you'll get:
  No rule to make target `...cpp_o
- same with ROOTDIR which should be the cuda projects directory

So to compile outside the hierarchy:

- build the projects first in the hierarchy (builds support libs too)
- copy a Makefile from the projects (I used matrixMul)
- change the include at the end of the makefile to be
  include $(ROOTDIR)/../common/common.mk
- define:
  export SRCDIR=`pwd`/
  export ROOTDIR=/home/andrew/pkg/cuda/projects/
  (or wherever you've installed the projects)

If you also define
  export BINDIR=`pwd`/
then the output will be in the release subdirectory

Andrew

Comment on this post