Set right cuDNN path when building torch from source

I copy cudnn to my customized folder, since I don’t have enough right to cp them to $CUDA_HOME.

I tried to set the path in CMakeLists.txt

set(CUDNN_LIBRARY_PATH /usr/local/cudnn-8.4.1/lib)
set(CUDNN_INCLUDE_PATH /usr/local/cudnn-8.4.1/include)

However, it doesn’t work.

That is what I set in my .bashrc file

# CUDNN
export CUDNN_HOME=/usr/local/cudnn-8.4.1
export LD_LIBRARY_PATH=${CUDNN_HOME}/lib:$LD_LIBRARY_PATH
export CPLUS_INCLUDE_PATH=${CUDNN_HOME}/include:$CPLUS_INCLUDE_PATH

Does anyone know how could I set the proper path?

Best
Max