#Dependency Bug Fix for nn package torch
(Note: This is the bug-fix i could found. If you find an easier way, please let me know in the comments below.)
During installation of torch on your computer or the GPU, you may possibly encounter a bug similar to this one:
Dependency missing for nn:
luaffi
Installing https://raw.githubusercontent.com/torch/rocks/master/luaffi-scm-1.rockspec ... switching to build mode
fatal error: unable to access 'https://raw.githubusercontent.com/torch/rocks/master/luaffi-scm-1.rockspec'
github.com: Could not resolve host 'github.com'
Installation failed
To fix the bug
- Perform a clean by running
sh clean.sh
- If you run into
Permission denied
errors then, usesudo sh clean.sh
, but necesarily make sure the previous installation is cleaned - Switch directories
cd ~/torch/extra/luaffib
and then run~/torch/install/bin/luarocks make
- Again if you face
Permission denied
error, then runsudo ~/torch/install/bin/luarocks make
- The main resaon for using
~/torch/install/bin/
is because:LuaJIT21
is installed in the first step of the build process- It is built directly into
/usr/local/lib/luarocks
- If
~/torch/install/bin/luarocks
is not specified, the build is lost to the torchinstall.sh
file
- After doing this, go to
~/torch/install/lib/luarocks/rocks
and check if the folderluaffi
is built.- If yes, you are covered and can perform a clean install.
- Else, run
sudo sh clean.sh
again in the base torch folder and re-build it.
- Now, switch to
~/torch/
and then runinstall.sh
once again.
Remember to run sudo ~/.bashrc
or sudo ~/.profile
for refreshing your environment variables.
Now, run th
and you should get a display like the one shown here.
Congratulations!!! You have successfully installed Torch.
@gupta-abhay
There is no file or directory luaffib in ~/torch/extra. There is a folder luaffifb.
After running clean.sh, the directory install will be removed right? How can we run ~/torch/install/bin/luarocks make?
Thanks and Regards