0

My problem is that I cannot compile a CUDA example. I believe I've got CUDA 4.0 installed correctly ( I need the old version b/c I'm trying to run GPGPU-Sim). I downloaded an NVIDIA cuda sample, namely conjugateGradient. If I cd to it and run

make    

it doesn't work:

macair93278:7_CUDALibraries r8t$ cd conjugateGradient/
macair93278:conjugateGradient r8t$ ls
Makefile    main.cpp
macair93278:conjugateGradient r8t$ make
Makefile:36: findcudalib.mk: No such file or directory
make: *** No rule to make target `findcudalib.mk'.  Stop.

I've changed my path so that running

nvcc -V 

doesn't produce an error, but gives me the version. So I think that's right. Thanks for any help. -bb

travelingbones
  • 7,919
  • 6
  • 36
  • 43
  • Do you have that file anywhere on your system? Does the makefile have any vpath/VPATH entries that look like they should be finding that for you? – Etan Reisner Nov 20 '14 at 17:33
  • 1
    don't download the conjugate gradient example (or any example) by itself. That is the hard way to do it. Go back to the same nvidia website where you got CUDA 4.0 toolkit, and download the CUDA 4.0 SDK. Then install that and try building your samples from there. You will get findcudalib.mk and all the other files and libraries you will need. When you download a single sample like this, it really only works if you have the complete SDK framework already set up. – Robert Crovella Nov 20 '14 at 20:51

1 Answers1

0

findcudalib.mk is missing because the individual sample you downloaded is not designed to be a complete, standalone sample. It requires a framework of other files and probably other libraries that need to be built around it.

To fix this, download the CUDA 4.0 SDK (GPU Computing SDK) from here.

Install that package. Once you have installed it, and assuming your CUDA install is otherwise intact, you should be able to change into the toplevel directory and issue make. This will build all the samples. For convenience, you may wish to issue make -k.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • Thanks! I downloaded the old (4.0 SDK) and the new (6.5 sdk) version. Now I get a different error upon the `make`: `macair93278:samples r8t$ cd 0_Simple/UnifiedMemoryStreams/ macair93278:UnifiedMemoryStreams r8t$ ls Makefile Makefile-e NsightEclipse.xml UnifiedMemoryStreams.cu readme.txt` `macair93278:UnifiedMemoryStreams r8t$ make ld: library not found for -lgomp clang: error: linker command failed with exit code 1 (use -v to see invocation)` – travelingbones Nov 24 '14 at 18:26
  • Seems like you have a different question now. SO is not intended to be a forum or chat room. If you have a new question about a different issue, you should pose a new question. Were you able to successfully build the conjugateGradient sample code using `make -k` ? – Robert Crovella Nov 24 '14 at 18:33
  • No, I'm getting this error :P Thanks, I'll post a new question. – travelingbones Nov 24 '14 at 19:09
  • I've moved the second question to here: http://stackoverflow.com/questions/27112404/cant-compile-cuda-samples-ld-library-not-found-for-lgomp-clang-error-linke – travelingbones Nov 24 '14 at 19:16
  • This error has nothing to do with the conjugateGradient sample. Did you issue `make -k` ? That should cause make to build all the samples that can be correctly built. After that, you should check to see if the conjugateGradient sample was built correctly (the executable was created). – Robert Crovella Nov 24 '14 at 19:17