0

I am trying to include the cutil.h file.

So I tried the following make file:

BINDIR = ./ # places compiled binary in current directory
EXECUTABLE := test

CCFILES := main.c
CUFILES := cudaFunctions.cu

# an ugly part - setting rootdir for CUDA SDK makefile
# look for common.mk - I don't know where SDK installs it on Linux -
# and change ROOTDIR accordingly 
ROOTDIR := /home/dan/NVIDIA_GPU_Computing_SDK/C/common

include $(ROOTDIR)/../common/common.mk

However I get two types of errors when I turn to run it. The first one being permissions:
mkdir: cannot create directory `/release': Permission denied

So I went under su and tried it again and got:
make: *** No rule to make target obj/x86_64/release/cudaFunctions.cu.o', needed by ./'. Stop.

The main.c file was originally a main.cu file. I changed it to follow the example but still same error.

Any ideas why I'm getting this error?

Community
  • 1
  • 1
Dan
  • 1,041
  • 1
  • 12
  • 32

1 Answers1

3

common.mk is not meant to work this way -- it is just meant to be used for CUDA SDK samples and libraries.

If you just want to use the CUTIL library, then instead build CUTIL using the makefile in the common directory. Then copy the CUTIL headers and libs into your project and #include and link to them as you would with any library.

Note though that CUTIL is not meant to be used outside of the CUDA SDK -- it is just a convenience library used in the SDK samples. It is not supported by NVIDIA.

harrism
  • 26,505
  • 2
  • 57
  • 88
  • You're saying I have to build the CUTIL with the make file then copy the headers over? i thought I could link the header files if I just copied them as a .h file? – Dan Mar 01 '12 at 22:47
  • 1
    Whether you copy them or not is up to you -- you just have to add the right `-I` path to your compilation to include the headers, and you have to add the right `-L` path for library locations, and then `-lcutil` to link the library. This is not CUDA-specific, BTW, it's the same as for any C/C++ library. – harrism Mar 02 '12 at 01:08