title: Unable to find Torch header files using nvcc
body: <p>I'm trying to call some CUDA code from luaJIT (Torch) but I'm running into compiling issues. nvcc seems unable to find my Torch header files. I have CUDA 6.5 and gcc 4.4.7.</p>
  
  <pre><code>nvcc -o im2col -I/deep/u/ibello/torch/include im2col.cu    
  In file included from /deep/u/ibello/torch/include/THC/THC.h:4,
                       from utils.h:6,
                       from im2col.cu:1:
      /deep/u/ibello/torch/include/THC/THCGeneral.h:4:23: error: THGeneral.h: No such file or directory
      /deep/u/ibello/torch/include/THC/THCGeneral.h:5:25: error: THAllocator.h: No such file or directory
      In file included from /deep/u/ibello/torch/include/THC/THC.h:7,
                       from utils.h:6,
                       from im2col.cu:1:
      /deep/u/ibello/torch/include/THC/THCStorage.h:4:23: error: THStorage.h: No such file or directory
      In file included from /deep/u/ibello/torch/include/THC/THC.h:9,
                       from utils.h:6,
                       from im2col.cu:1:
  </code></pre>
  
  <p>im2col.cu includes the following</p>
  
  <pre><code>#include "utils.h"
  #include "common.h"
  #include &lt;lua.h&gt;
  #include &lt;lauxlib.h&gt;
  #include &lt;lualib.h&gt;
  </code></pre>
  
  <p>where "utils.h" is</p>
  
  <pre><code>#ifndef CUNN_UTILS_H
  #define CUNN_UTILS_H
  
  extern "C" { #include &lt;lua.h&gt; }
  #include &lt;luaT.h&gt;
  #include &lt;THC/THC.h&gt;
  
  THCState* getCutorchState(lua_State* L);
  
  #endif
  </code></pre>
  
  <p>This is relatively weird since the mentioned files are indeed in the include location I gave to the compiler..</p>
  
  <pre><code>ls /deep/u/ibello/torch/include/THC
  THCAllocator.h  THCDeviceTensor.cuh       THCDeviceTensorUtils-inl.cuh  THC.h                    THCReduce.cuh     THCTensorConv.h  THCTensorMath.h
  THCApply.cuh    THCDeviceTensor-inl.cuh   THCDeviceUtils.cuh            THCReduceAll.cuh         THCStorageCopy.h  THCTensorCopy.h  THCTensorRandom.h
  THCBlas.h       THCDeviceTensorUtils.cuh  THCGeneral.h                  THCReduceApplyUtils.cuh  THCStorage.h      THCTensor.h      THCTensorSort.h
  </code></pre>
  
  <p>Any ideas about what I'm doing wrong?</p>
  
  <p>Thx in advance!</p>