Error - couldn't find header files, after building PyTorch from source

username: Loud_BoomBox
cooked: <p>Hi all,<br>
I have been trying to make a C++ extension for Pytorch for a project of mine.<br>
I have setup a conda environment and built pytorch and torchvision from source.</p>
<p>Here are the dependencies and packages installed in the conda environment:</p>
<pre><code class="lang-auto"># packages in environment at /home/balaji5199/anaconda3/envs/cuda_en:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
blas                      1.0                         mkl  
brotlipy                  0.7.0           py38h27cfd23_1003  
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2021.1.19            h06a4308_1  
certifi                   2020.12.5        py38h06a4308_0  
cffi                      1.14.5           py38h261ae71_0  
chardet                   4.0.0           py38h06a4308_1003  
cmake                     3.19.6               h973ab73_0  
cryptography              3.3.1            py38h3c74f83_1  
cudatoolkit               10.2.89              hfd86e86_1  
cudnn                     7.6.5                cuda10.2_0  
dataclasses               0.8                pyh6d0b6a4_7  
expat                     2.2.10               he6710b0_2  
future                    0.18.2                   py38_1  
idna                      2.10               pyhd3eb1b0_0  
intel-openmp              2020.2                      254  
krb5                      1.18.2               h173b8e3_0  
ld_impl_linux-64          2.33.1               h53a641e_7  
libcurl                   7.71.1               h20c2e04_1  
libedit                   3.1.20191231         h14c3975_1  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.1.0                hdf63c60_0  
libssh2                   1.9.0                h1ba5d50_1  
libstdcxx-ng              9.1.0                hdf63c60_0  
libuv                     1.40.0               h7b6447c_0  
lz4-c                     1.9.3                h2531618_0  
magma-cuda102             2.5.2                         1    pytorch
mkl                       2020.2                      256  
mkl-include               2020.2                      256  
mkl-service               2.3.0            py38he904b0f_0  
mkl_fft                   1.3.0            py38h54f3939_0  
mkl_random                1.1.1            py38h0573a6f_0  
ncurses                   6.2                  he6710b0_1  
ninja                     1.10.2           py38hff7bd54_0  
numpy                     1.19.2           py38h54aff64_0  
numpy-base                1.19.2           py38hfa32c7d_0  
nvcc_linux-64             10.2                h1a5f58c_12    conda-forge
openssl                   1.1.1j               h27cfd23_0  
pip                       21.0.1           py38h06a4308_0  
pycparser                 2.20                       py_2  
pyopenssl                 20.0.1             pyhd3eb1b0_1  
pysocks                   1.7.1            py38h06a4308_0  
python                    3.8.8                hdb3f193_4  
pyyaml                    5.4.1            py38h27cfd23_1  
readline                  8.1                  h27cfd23_0  
requests                  2.25.1             pyhd3eb1b0_0  
rhash                     1.4.1                h3c74f83_1  
sed                       4.8                  he412f7d_0    conda-forge
setuptools                52.0.0           py38h06a4308_0  
six                       1.15.0           py38h06a4308_0  
sqlite                    3.33.0               h62c20be_0  
tk                        8.6.10               hbc83047_0  
typing_extensions         3.7.4.3            pyha847dfd_0  
urllib3                   1.26.3             pyhd3eb1b0_0  
wheel                     0.36.2             pyhd3eb1b0_0  
xz                        5.2.5                h7b6447c_0  
yaml                      0.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.4.5                h9ceee32_0
</code></pre>
<p>When I try to run a code where I use PYBIND11 to extend a c++ code to pytorch I get the following error:</p>
<pre><code class="lang-auto">/usr/include/vector_functions.h:172:10: fatal error: vector_functions.hpp: No such file or directory
 #include "vector_functions.hpp"
          ^~~~~~~~~~~~~~~~~~~~~~
</code></pre>
<p>When I give the following command to check if the file is actually present I get the following result:</p>
<pre><code class="lang-auto">(cuda_en) balaji5199@balaji5199-Lenovo-Legion-Y730-15ICH:~/pytorch$ sudo find / -iname "vector_functions.hpp"
/usr/local/cuda-10.2/targets/x86_64-linux/include/vector_functions.hpp
find: ‘/run/user/1000/gvfs’: Permission denied
</code></pre>
<p>Here are all the environment variable values that have been set:</p>
<pre><code class="lang-auto">$PATH=/home/balaji5199/Desktop/Xilinx_vivado_2016_version/DocNav:/home/balaji5199/Desktop/Xilinx_vivado_2016_version/Vivado/2016.4/bin:/home/balaji5199/Desktop/Xilinx_vivado_2016_version/Vivado_HLS/2016.4/bin:/home/balaji5199/anaconda3/envs/cuda_en/bin:/home/balaji5199/anaconda3/condabin:/usr/local/cuda-10.2/bin:/usr/local/cuda-10.2/bin:/home/balaji5199/Desktop/Xilinx_vivado_2016_version/DocNav:/home/balaji5199/Desktop/Xilinx_vivado_2016_version/Vivado/2016.4/bin:/home/balaji5199/Desktop/Xilinx_vivado_2016_version/Vivado_HLS/2016.4/bin:/home/balaji5199/miniconda3/envs/new_cuda/bin:/home/balaji5199/miniconda3/condabin:/home/balaji5199/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/cuda/bin: No such file or directory

$LD_LIBRARY_PATH=/usr/local/cuda-10.2/targets/x86_64-linux/include
</code></pre>
<p>Can someone tell me where the problem is?</p>