#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 deniederrors then, usesudo sh clean.sh, but necesarily make sure the previous installation is cleaned - Switch directories
cd ~/torch/extra/luaffiband then run~/torch/install/bin/luarocks make - Again if you face
Permission deniederror, then runsudo ~/torch/install/bin/luarocks make - The main resaon for using
~/torch/install/bin/is because:LuaJIT21is installed in the first step of the build process- It is built directly into
/usr/local/lib/luarocks - If
~/torch/install/bin/luarocksis not specified, the build is lost to the torchinstall.shfile
- After doing this, go to
~/torch/install/lib/luarocks/rocksand check if the folderluaffiis built.- If yes, you are covered and can perform a clean install.
- Else, run
sudo sh clean.shagain in the base torch folder and re-build it.
- Now, switch to
~/torch/and then runinstall.shonce 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