# build optix with my makefile

**URL:** <https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282>\
**Category:** OptiX\
**Created:** [July 31, 2014, 11:19pm UTC](https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282 "2014-07-31T23:19:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@lang](https://forums.developer.nvidia.com/u/lang)\
**Post date:** [July 31, 2014, 11:19pm UTC](https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282/1 "2014-07-31T23:19:41Z")

</div>

Hi,

I want to build projects with Optix.  
For example, if I compile SDK sample1 without the original cmake,

$ nvcc -arch=sm\_20 -ptx -m64 draw\_color.cu -o draw\_color.ptx -I${DIR\_OPTIX}/include  
$ nvcc -arch=sm\_20 -c sample3.c -o sample3.o -I. -I${DIR\_OPTIX}/include  
$ nvcc -arch=sm\_20 -c sutil.c -o sutil.o -I. -I${DIR\_OPTIX}/include  
$ nvcc -arch=sm\_20 sutil.o sample3.o -o sample3 -L${DIR\_OPTIX}/lib64 -L/usr/local/cuda-6.0/lib64/ -lcudart -loptix  
$ ./sample3  
./sample3: error while loading shared libraries: liboptix.so.1: cannot open shared object file: No such file or directory

What can I do?

---

<div class="post-metadata">

**Author:** ![crunchvfx](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@crunchvfx](https://forums.developer.nvidia.com/u/crunchvfx)\
**Post date:** [August 1, 2014, 2:37am UTC](https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282/2 "2014-08-01T02:37:36Z")

</div>

on linux? Make sure your LD\_LIBRARY\_PATH environment variable contains the directory where liboptix.so.1 lives, probably ${DIR\_OPTIX}/lib64

---

<div class="post-metadata">

**Author:** ![crunchvfx](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@crunchvfx](https://forums.developer.nvidia.com/u/crunchvfx)\
**Post date:** [August 1, 2014, 2:38am UTC](https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282/3 "2014-08-01T02:38:57Z")

</div>

on linux? Make sure your LD\_LIBRARY\_PATH environment variable contains the directory where liboptix.so.1 lives, probably ${DIR\_OPTIX}/lib64

---

<div class="post-metadata">

**Author:** ![lang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@lang](https://forums.developer.nvidia.com/u/lang)\
**Post date:** [August 1, 2014, 3:18am UTC](https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282/4 "2014-08-01T03:18:01Z")

</div>

> [@crunchvfx](#):
>
> on linux? Make sure your LD\_LIBRARY\_PATH environment variable contains the directory where liboptix.so.1 lives, probably ${DIR\_OPTIX}/lib64

Thanks a lot! It works now.  
By the way, I used CUDPP but forgot to change LD\_LIBRARY\_PATH. But that didn’t bring any error?

Edit: just found CUDPP uses .a

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [June 14, 2022, 9:11pm UTC](https://forums.developer.nvidia.com/t/build-optix-with-my-makefile/34282/5 "2022-06-14T21:11:54Z")

</div>

Closed on June 14, 2022, 9:11pm UTC


