Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'cwrap' not found #47

Closed
pannous opened this issue Jun 23, 2014 · 7 comments
Closed

module 'cwrap' not found #47

pannous opened this issue Jun 23, 2014 · 7 comments

Comments

@pannous
Copy link

pannous commented Jun 23, 2014

Even after the successful installation of cwrap** and cleaning we cannot successfully manage to compile the project:

$ make
[ 3%] Built target TH
[ 44%] Built target luaT
[ 48%] Generating random.c
lua: random.lua:1: module 'cwrap' not found:
Failed loading module cwrap in LuaRocks rock cwrap scm-1

Any advice?

** cwrap installation successful:
$ luarocks --local --server=https://raw.github.com/torch/rocks/master install cwrap
Installing https://raw.github.com/torch/rocks/master/cwrap-scm-1.rockspec...
Using https://raw.github.com/torch/rocks/master/cwrap-scm-1.rockspec... switching to 'build' mode
Cloning into 'cwrap'...
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 8 (delta 0), reused 5 (delta 0)
Receiving objects: 100% (8/8), 9.80 KiB | 0 bytes/s, done.
Checking connectivity... done.
Updating manifest for $/.luarocks/lib/luarocks/rocks

cwrap scm-1 is now built and installed in $/.luarocks (license: BSD)

@soumith
Copy link
Member

soumith commented Jun 23, 2014

hey @pannous, it looks like the lua cant find the cwrap module, this happens when the path/cpath isn't set appropriately (i.e. maybe there's a lua pre-existing in the system that doesn't have the paths properly set).

The fastest way to get going with torch is to use the ezinstall scripts provided by us.

For a global system-wide install:
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash

For installing torch in /local
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | PREFIX=
/local bash

@soumith
Copy link
Member

soumith commented Jun 23, 2014

let me know if that doesn't help.

@pannous
Copy link
Author

pannous commented Jun 23, 2014

Wow, that was quick and 100% helpful

Well somehow the make file tried to execute the lua files:

[ 51%] Generating TensorMath.c
make[2]: /Users/me/ai/torch7/TensorMath.lua: Permission denied
[ 48%] Generating TensorMath.c
/Users/me/ai/torch7/TensorMath.lua: line 1: local: can only be used in a function

but adding a shebang
#!/usr/bin/env lua -lluarocks.loader
made it work!

Linking C shared module libtorch.so
[100%] Built target torch

Thanks!

@pannous pannous closed this as completed Jun 23, 2014
@ZhangChenyang
Copy link

Hi @soumith , I used the ezinstall you post but the path to gfortran cannot be found; while if I cmake under torch7/ it can be found, how can I make it work?

@ZhangChenyang
Copy link

Hi @pannous , I met the Permission Denied problem and cannot make it work, where you suggest to put that shebang into?

@pannous
Copy link
Author

pannous commented Jul 10, 2014

You have to put it on top of those two lua files which are affected,
I think one was Random.lua I forgot the other one

On Jul 10, 2014, at 12:24 AM, ZhangChenyang notifications@github.com wrote:

Hi @pannous , I met the Permission Denied problem and cannot make it work, where you suggest to put that shebang into?


Reply to this email directly or view it on GitHub.

@soumith
Copy link
Member

soumith commented Jul 10, 2014

@ZhangChenyang we just patched the ezinstall scripts and some cmake files to not depend on gfortran!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants