I have a setup where torch is installed for all users:
$ which th
/usr/local/bin/th
But when I try to locally install a package with luarocks --local, (1) torch is not detected where it is and (2) after automatically compiling it, luarocks tries to install files… in the global directory where torch is! And unfortunately where I do not have writing rights.
$ luarocks install --local nngraph
Installing https://raw.githubusercontent.com/torch/rocks/master/nngraph-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/nngraph-scm-1.rockspec... switching to 'build' mode
Missing dependencies for nngraph:
torch >= 7.0
Using https://raw.githubusercontent.com/torch/rocks/master/torch-scm-1.rockspec... switching to 'build' mode
[...]
[100%] Built target luaT_static
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/cmake/torch/TorchExports.cmake
CMake Error at cmake_install.cmake:48 (FILE):
file INSTALL cannot copy file
"/tmp/luarocks_torch-scm-1-6869/torch7/build/CMakeFiles/Export/share/cmake/torch/TorchExports.cmake"
to "/usr/local/share/cmake/torch/TorchExports.cmake".
Something must be wrong with Torch's cmake files.
(btw they also mess up CMAKE_INSTALL_PREFIX and sometimes conflict with other cmake files when linking Torch in another project, but that my be because I did something wrong.)
Try
luarocks install --deps-mode=all --local nngraph
Most helpful comment
Try