CUDA installation on mac El-Capitan

I ran cudnn installation through “luarocks install cudnn”

Then i tried to run version checking by:
th -lcudnn -e “print(cudnn.version)”

And i got the following:

Found Environment variable CUDNN_PATH = /usr/local/cuda/lib
could not load cudnn, skipping
/Users/elik/torch/install/share/lua/5.1/cudnn/ffi.lua:1592: dlopen(/usr/local/cuda/lib, 5): no suitable image found. Did find:
/usr/local/cuda/lib: not a file
stack traceback:
[C]: in function ‘load’
/Users/elik/torch/install/share/lua/5.1/cudnn/ffi.lua:1592: in main chunk
[C]: in function ‘require’
/Users/elik/torch/install/share/lua/5.1/cudnn/init.lua:4: in main chunk
[C]: in function ‘require’
…elik/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:48: in function <…elik/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:48>
[C]: in function ‘xpcall’
…elik/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:48: in main chunk
[C]: at 0x0106531bd0
nil

When I tried to run my program i got:

/Users/elik/torch/install/bin/luajit: /Users/elik/torch/install/share/lua/5.1/trepl/init.lua:384: /Users/elik/torch/install/share/lua/5.1/trepl/init.lua:384: /Users/elik/torch/install/share/lua/5.1/cudnn/ffi.lua:1603: 'libcudnn (R5) not found in library path.
Please install CuDNN from https://developer.nvidia.com/cuDNN
Then make sure files named as libcudnn.so.5 or libcudnn.5.dylib are placed in
your library load path (for example /usr/local/lib , or manually add a path to LD_LIBRARY_PATH)

Alternatively, set the path to libcudnn.so.5 or libcudnn.5.dylib
to the environment variable CUDNN_PATH and rerun torch.
For example: export CUDNN_PATH = “/usr/local/cuda/lib64/libcudnn.so.5”

stack traceback:
[C]: in function ‘error’
/Users/elik/torch/install/share/lua/5.1/trepl/init.lua:384: in function ‘require’
models/nin_bn.lua:12: in main chunk
[C]: in function ‘dofile’
train256.lua:125: in main chunk
[C]: in function ‘dofile’
…elik/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x010750fbd0

Any help with this issue please?