Compiling OpenCL examples

I’ve downloaded three of the OpenCL examples from

OpenCL | NVIDIA Developer

for x86_64 Linux. None of the examples compiles for me on Fedora 21.

There’s a Makefile in the OpenCL directory, which gives errors:

make[1]: Entering directory ‘/home/steck/Downloads/NVIDIA GPU Computing SDK/shared’
make[1]: *** No targets specified and no makefile found. Stop.

Trying the Makefile for particular sample code, in this case src/oclMultiThreads, gives:

/bin/ld: cannot find -lshrutil_x86_64
collect2: error: ld returned 1 exit status

Is there some other code to download before I can build these examples?

1 Like

Yes, you need other codes/libraries.

Download one of the old CUDA SDKs instead. Such as from here:

[url]https://developer.nvidia.com/cuda-toolkit-40[/url]

The SDK will include all needed source code and libraries, and the make process will be coherent with the directory structure.

Yes, in fact I’d downloaded that code the other day.

Unfortunately, it won’t compile for me on ny Fedora 21, which has gcc 4.9 installed.

1 Like

Exact the same problem with CUDA Toolkit 11.4.