karpathy / neuraltalk2

Efficient Image Captioning code in Torch, runs on GPU
5.51k stars 1.26k forks source link

/torch/install/share/lua/5.1/hdf5/ffi.lua:56: ')' expected near '_close' at line 1436 #149

Open smartPiz opened 8 years ago

smartPiz commented 8 years ago

/torch/install/share/lua/5.1/hdf5/ffi.lua:56: ')' expected near '_close' at line 1436

trych commented 7 years ago

Have the same issue. Anybody knows what's going on? Did have neuraltalk2 up and running on an old computer a while back and I don't remember this issue.

tbornt commented 7 years ago

https://github.com/karpathy/neuraltalk2/issues/149

trych commented 7 years ago

@tbornt That link does not work. Did you maybe past the wrong link?

ItsThisGuyAgain commented 7 years ago

I also am having this problem (but with torch-rnn). Any help?

ItsThisGuyAgain commented 7 years ago

Nevermind, here's a fix.

pudepiedj commented 7 years ago

Unfortunately the ffi.lua edit fix doesn't work for me. I went through much the same sequence which led others here and solved the HDF5 location issue but it then threw up a "')' expected near '_close' at line 1466" error. I edited the @tbornt fix into ffi.lua but then it gave me this: In file included from :330: :1:9: error: macro name must be an identifier

define ‘_Nullable ‘

Followed by the original ')' expected ... error.

There are various posts about this but I haven't found any answers that seem definitive. Can anybody help?

ProbonoBonobo commented 7 years ago

Same issue. Help.

ProbonoBonobo commented 7 years ago

Could anyone confirm or deny if the incorrect hdf5 version number below ("0-0") is significant? Could this be the source of the error? (The installed version, from brew, is 1.10.0-patch1. I am curious if the name might be breaking some regex somewhere.)


argcheck
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

cudnn
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

cunn
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

cutorch
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

cwrap
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

dok
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

env
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

gnuplot
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

graph
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

hdf5
   0-0 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

image
   1.1.alpha-0 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

lua-cjson
   2.1devel-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

luaffi
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

luafilesystem
   1.6.3-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

nn
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

nngraph
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

nnx
   0.1-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

optim
   1.0.5-0 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

paths
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

penlight
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

sundown
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

sys
   1.1-0 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

threads
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

torch
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

totem
   0-0 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

trepl
   scm-1 (installed) - /Users/kz/torch/install/lib/luarocks/rocks

xlua
   1.0-0 (installed) - /Users/kz/torch/install/lib/luarocks/rocks
chidg commented 7 years ago

@pudepiedj Make sure you don't have any web formatting artifacts in the text you paste (such as 'smart quotes'). I had the same issue and from the text you've posted it looks like you have smart quotes around _Nullable. Here's my code for line 44 of ~/torch/install/share/lua/5.1/hdf5/ffi.lua which works for me: local process = io.popen("gcc -D '_Nullable=' -E " .. headerPath) -- TODO pass -I.

robertshearing commented 7 years ago

I was having the same problem but none of the fixes worked for me. I'm on MacOS and I managed to fix it by downgrading my Command Line Tools to v7.2. Refer to this post: https://github.com/torch/cutorch/issues/522 for instructions.

DmitryKey commented 6 years ago

Hello,

Had the same issue and fix by @chidg has helped. Thanks for sharing! In deep learning world the most adoring part is manual fixing the library source code.