niessner / Opt

Opt DSL
Other
254 stars 68 forks source link

Runtime compilation doesn't respect environment variables for include paths #141

Open lakinwecker opened 5 years ago

lakinwecker commented 5 years ago

The image warping example builds just fine, but it won't run. It has this error: I updated ../shared/make_template.inc to point to my install of CUDA and I updated LD_LIBRARY_PATH, and C_INCLUDE_PATH and CPLUS_INCLUDE_PATH to point to the CUDA includes and library directories respectively, but the example doesn't run:

~➜ ./image_warping 
width 512, height 512
numActivePixels: 101406
<buffer>:5:10: fatal error: 'cuda_runtime.h' file not found
#include <cuda_runtime.h>
         ^
compilation of included c code failed

It's probably not running clang with any of the environment variables I have set, and it's also not respecting the makefile.inc settings. How do I tell it where to find cuda during runtime?

lhoangan commented 5 years ago

Hi @lakinwecker have you found a way to overcome this problem? I've got exact the same problem as the installed path of cuda is not standard. I've tried to change all <cuda_runtime.h> to "cuda_runtime.h" but still no luck.

lakinwecker commented 5 years ago

@lhoangan No. I never did successfully work around it. I gave up trying to use Opt some time ago. It depends on too many things that are too old and I didn't feel like manually compiling old compilers to get it working.

mfratarcangeli commented 5 years ago

The issue happens when the installed version of cuda is different than 7.5. Opt.lib seems to have hard-coded the path to cuda 7.5, however, and this is not configurable hence the error.

I found a workaround by making a hard symlink to the installed version of cuda, i.e. run "cmd" with admin provileges and then write: mklink /J "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1"

(note change 10.1 to the version that you have currently installed; also the second path may slightly change on your system, so double-check it)

lhoangan commented 5 years ago

For future reference, update $CUDA_HOME (for Linux) and $CUDA_PATH (for Windows) works for me

lakinwecker commented 5 years ago

Good to know.