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

lua/5.2/hdf5/ffi.lua:56: expected 'static const int' on line 208 | #47

Closed
nicolasH opened this issue Dec 12, 2015 · 3 comments
Closed

Comments

@nicolasH
Copy link

Hello

I am trying to use neuraltalk2 which depends on torch and on this project, and when I try to run
require('hdf5') in the torch interpreter, I run into the error bellow. I have followed the various install procedures on OSX and Ubuntu 14.04 and end up with the same error.

I lack any lua experience, so I do not see where to go from here. I believe I have the latest version of the hdf5 library:

"Warning: homebrew/science/hdf5-1.8.16 already installed"

Here is the error, followed by a list of the version of the various packages installed.

th> require('hdf5')
.../lua-extra/torch/install/share/lua/5.2/trepl/init.lua:383: .../lua-extra/torch/install/share/lua/5.2/hdf5/ffi.lua:56: expected 'static const int' on line 208
stack traceback:
.../lua-extra/torch/install/share/lua/5.2/trepl/init.lua:500: in function <.../lua-extra/torch/install/share/lua/5.2/trepl/init.lua:493>
[C]: in function 'error'
.../lua-extra/torch/install/share/lua/5.2/trepl/init.lua:383: in function 'require'
[string "_RESULT={require('hdf5')}"]:1: in main chunk
[C]: in function 'xpcall'
.../lua-extra/torch/install/share/lua/5.2/trepl/init.lua:650: in function 'repl'
...xtra/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: in ?

I have h5py (2.5.0) (python 2.7)

~ lua -v
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio

~ luarocks list

Installed rocks:

argcheck
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

cwrap
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

dok
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

env
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

fftw3
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

gnuplot
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

graph
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

graphicsmagick
1.scm-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

hdf5
0-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

image
1.1.alpha-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

itorch
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

lbase64
20120807-3 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

lua-cjson
2.1.0-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

luabitop
1.0.2-2 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

luacrypto
0.3.2-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

luaffi
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

luafilesystem
1.6.3-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

lzmq
0.4.3-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

nn
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

nngraph
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

nnx
0.1-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

optim
1.0.5-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

paths
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

penlight
1.3.2-2 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

signal
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

sundown
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

sys
1.1-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

threads
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

torch
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

totem
0-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

trepl
scm-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

uuid
0.2-1 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

xlua
1.0-0 (installed) - /Users/niko/workspace/lua-extra/torch/install/lib/luarocks/rocks

Any idea where to go from here to fix that error?

Thanks a lot,

Nicolas

@d11
Copy link
Contributor

d11 commented Dec 12, 2015

Hi, torch-hdf5 (and torch generally) requires LuaJIT (for its FFI features) rather than the PUC-Rio Lua, which it looks like you're running here. You probably want to be running the interpreter with 'th', as detailed here: http://torch.ch/docs/getting-started.html. It won't work with 'lua'.

@d11 d11 closed this as completed Dec 12, 2015
@soumith
Copy link
Contributor

soumith commented Dec 15, 2015

this is a luaffifb bug, where you can use ffi with vanilla lua. We'll isolate and fix the bug in the next couple of days.

@d11
Copy link
Contributor

d11 commented Dec 15, 2015

Ahh, I see! Thanks for the info.

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