# Nvidia CUDA OpenCL Examples Missing Libraries

**URL:** <https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496>\
**Category:** CUDA Setup and Installation\
**Created:** [June 24, 2015, 6:00pm UTC](https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496 "2015-06-24T18:00:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masab](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Masab](https://forums.developer.nvidia.com/u/Masab)\
**Post date:** [June 24, 2015, 6:00pm UTC](https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496/1 "2015-06-24T18:00:49Z")

</div>

Hi all,

I downloaded one of the OpenCL examples from Nvidia’s website, VectorAdd  
[https://developer.nvidia.com/opencl](https://developer.nvidia.com/opencl)

However, when I try to make in _oclVectorAdd/NVIDIA GPU Computing SDK/OpenCL/src/oclVectorAdd_, I get the following error:  
/usr/bin/ld: cannot find -lshrutil\_x86\_64  
collect2: error: ld returned 1 exit status  
make: \*\*\* […/…/…//OpenCL//bin//linux/release/oclVectorAdd] Error 1

Any ideas on how to fix this? This problem seems to occur with all the OpenCL examples.

Thanks

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [June 24, 2015, 6:33pm UTC](https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496/2 "2015-06-24T18:33:01Z")

</div>

Even though they appear to be independent, these OpenCL sample codes are not really maintained as independently buildable projects. They were extracted from the NVIDIA GPU Computing SDK, back when that SDK was still shipping (in CUDA 4.2 timeframe and before).

The easiest way to “fix” it in my opinion is to download the CUDA 4.2 SDK from here:

[url][https://developer.nvidia.com/cuda-toolkit-42-archive[/url]](https://developer.nvidia.com/cuda-toolkit-42-archive%5B/url%5D)

You _only_ need the SDK, not the toolkit or driver.

Download the SDK, unzip/install it, and then go to the top level OpenCL directory in the SDK and execute make from there. Since this isn’t really a supported sequence, you may have to fix things up along the way. Read the documentation that gets installed with the SDK.

---

<div class="post-metadata">

**Author:** ![Masab](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Masab](https://forums.developer.nvidia.com/u/Masab)\
**Post date:** [June 24, 2015, 8:03pm UTC](https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496/3 "2015-06-24T20:03:11Z")

</div>

So it did make successfully from the top level OpenCL directory.

However, it still has not created any executables anywhere. I do see that it formed an obj folder for each benchmark, in which there is another folder named release, which contains object (.o) files.

How should I try to run a specific benchmark now?

Thanks again.

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [June 24, 2015, 8:32pm UTC](https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496/4 "2015-06-24T20:32:19Z")

</div>

The built executables are placed in:

SDK\_ROOT/OpenCL/bin/linux/release

where SDK\_ROOT is whatever path you used when installing the SDK.

---

<div class="post-metadata">

**Author:** ![Masab](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Masab](https://forums.developer.nvidia.com/u/Masab)\
**Post date:** [June 25, 2015, 6:44pm UTC](https://forums.developer.nvidia.com/t/nvidia-cuda-opencl-examples-missing-libraries/38496/5 "2015-06-25T18:44:11Z")

</div>

ok that worked!

thank you very much!
