package.path problem after update.sh

已查看 49 次
跳至第一个未读帖子

Daniel Galvez

未读,
2015年11月26日 22:52:372015/11/26
收件人 torch7
Hi everyone,

I recently needed to update my old paths package to get paths.iterdirs. To do this, I ran "update.sh", which seems to update the git submodules located in the ~/torch/pkg directory. Afterwards, I checked, and it is true that the updated "~/torch/pkg/paths/init.lua" does contain "paths.iterdirs". (the git log confirms this as well. The package is up to date.)

However, at the torch repl "th", I couldn't call paths.iterdirs, and I found that the package.path variable in fact doesn't contain a "~/torch/pkg/?/init.lua" path pattern.

I ran this,
for path in package.path:gmatch("[^;]+") do
   
print(path)
end
which output this:
/Users/danielgalvez/.luarocks/share/lua/5.1/?.lua    
/Users/danielgalvez/.luarocks/share/lua/5.1/?/init.lua    
/Users/danielgalvez/torch/install/share/lua/5.1/?.lua    
/Users/danielgalvez/torch/install/share/lua/5.1/?/init.lua    
./?.lua    
/Users/danielgalvez/torch/install/share/luajit-2.1.0-alpha/?.lua    
/usr/local/share/lua/5.1/?.lua    
/usr/local/share/lua/5.1/?/init.lua    

I observed that ~/torch/install/?/init.lua matches ~/torch/install/paths/init.lua. However, this file is outdated, and does not contain the "paths.iterdirs()" function.

I know I can replace the existing "~/torch/install/paths/init.lua" with "~/torch/pkg/paths/init.lua" or change the package.path variable, but this feels wrong. I feel as though this should be updated automatically, especially since no one else seems to be having the same problem as me.

TL;DR: Is there a preferred way to add my updated packages to the path after a call to "update.sh"?

Daniel Galvez

未读,
2015年11月27日 01:02:582015/11/27
收件人 torch7
Ah, of course, update.sh only updates the packages' code, but does not rebuild the packages.

This worked for me:

cd torch/pkg/paths
luarocks make
rocks/
paths-scm-1.rockspec


luarocks make not only builds, but also puts the init.lua file onto the install/paths directory.

Why doesn't update.sh remake the updated modules automatically? It seems silly that you would want to update, but not rebuild from a user's point of view.

soumith

未读,
2015年11月28日 18:46:122015/11/28
收件人 torch7 on behalf of Daniel Galvez
Daniel.

./update.sh
./install.sh

That's the order I run the commands in. Maybe update.sh should have a trigger to ./install.sh

--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at http://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.

回复全部
回复作者
转发
0 个新帖子