title: collect2: error: ld returned 1 exit status (-lcudnn)
body: <h3>Edit 1</h3>
  
  <p>I forgot to mention that I want to use the theano library.</p>
  
  <p>After I reached out to the admin, the cudnn modules were provided by them. However, I am still getting the same error.</p>
  
  <pre><code>$ module load devel/cudnn/10.2
  $ python -c "import theano"
  Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
  /pfs/work7/workspace/scratch/ul_dco32-conda-0/conda/envs/my_env/bin/../lib/
  gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../
  x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lcudnn
  collect2: error: ld returned 1 exit status
  
  Mapped name None to device cuda: Tesla V100-SXM2-32GB (0000:3A:00.0)
  </code></pre>
  
  <pre><code>$ vi $HOME/.theanorc
  [global]
  floatX = float32
  device = cuda
  
  [cuda]
  root=$CUDA_HOME/bin
  
  [dnn]
  include_path=$CUDA_HOME/include
  library_path=$CUDA_HOME/lib64
  
  [lib]
  cnmem=1
  </code></pre>
  
  <p>So, most probably, I have a link problem, however, I can't find it where.</p>
  
  <h3>Problem</h3>
  
  <p>I am struggling with <code>ld: cannot find -lcudnn</code>.</p>
  
  <h3>Description</h3>
  
  <p>I want to use Cuda and CuDnn for my project. I am working in a cluster, Cuda is installed in the cluster already (p.s. I don't have root permissions). So I copy the Cuda files into my local folder and install Cudnn as instructed on the official website. However, ld cannot find <code>libcudnn.so</code>.</p>
  
  <pre><code>$ lsb_release -a
  Description:    Red Hat Enterprise Linux Server release 7.7 (Maipo)
  Release:        7.7
  </code></pre>
  
  <h3>What I tried</h3>
  
  <pre><code>$ ld -lcudnn --verbose
  attempt to open //usr/x86_64-redhat-linux/lib64/libcudnn.so failed
  attempt to open //usr/x86_64-redhat-linux/lib64/libcudnn.a failed
  attempt to open //usr/lib64/libcudnn.so failed
  attempt to open //usr/lib64/libcudnn.a failed
  attempt to open //usr/local/lib64/libcudnn.so failed
  attempt to open //usr/local/lib64/libcudnn.a failed
  attempt to open //lib64/libcudnn.so failed
  attempt to open //lib64/libcudnn.a failed
  attempt to open //usr/x86_64-redhat-linux/lib/libcudnn.so failed
  attempt to open //usr/x86_64-redhat-linux/lib/libcudnn.a failed
  attempt to open //usr/local/lib/libcudnn.so failed
  attempt to open //usr/local/lib/libcudnn.a failed
  attempt to open //lib/libcudnn.so failed
  attempt to open //lib/libcudnn.a failed
  attempt to open //usr/lib/libcudnn.so failed
  attempt to open //usr/lib/libcudnn.a failed
  ld: cannot find -lcudnn
  </code></pre>
  
  <p>If I add the library path of <code>libcudnn.so</code> manually</p>
  
  <pre><code>$ ld -L "$CUDA_HOME/lib64" -lcudnn
  attempt to open /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so succeeded
  -lcudnn (/home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so)
  librt.so.1 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found librt.so.1 at /usr/lib64/librt.so.1
  libpthread.so.0 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found libpthread.so.0 at /usr/lib64/libpthread.so.0
  libdl.so.2 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found libdl.so.2 at /usr/lib64/libdl.so.2
  libstdc++.so.6 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found libstdc++.so.6 at /usr/lib64/libstdc++.so.6
  libm.so.6 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found libm.so.6 at /usr/lib64/libm.so.6
  libgcc_s.so.1 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found libgcc_s.so.1 at /usr/lib64/libgcc_s.so.1
  libc.so.6 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found libc.so.6 at /usr/lib64/libc.so.6
  ld-linux-x86-64.so.2 needed by /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64/libcudnn.so
  found ld-linux-x86-64.so.2 at /usr/lib64/ld-linux-x86-64.so.2
  ld: warning: cannot find entry symbol _start; not setting start address
  </code></pre>
  
  <p>Here is my <code>LD_LIBRARY_PATH</code></p>
  
  <pre><code>$ echo $LD_LIBRARY_PATH
  /home/ul/ul_student/ul_dco32/pkg/cuda/10.2/lib64
  </code></pre>
  
  <p>ld somehow ignores <code>LD_LIBRARY_PATH</code>. Since I do not have the root permissions, I cannot either create a symbolic link or make changes in <code>ldconfig</code>. So, setting <code>LD_LIBRARY_PATH</code> is the only way I can fix it.</p>
  
  <p>Thanks for your help.</p>