error installing nn rock for Windows install

140 views
Skip to first unread message

Eric Prechtl

unread,
May 20, 2016, 11:02:15 PM5/20/16
to torch7
I have installed lua using the windows port provided at https://github.com/diz-vara/luajit-rocks

Everything seemed to go fine.  I downloaded the code to my C:\luajit-rocks folder and installed lua in my C:\luainstall folder.  I was able to successfully install torch with the luarocks install torch command.  However, the very next command I issued was luarocks install nn and it failed with the following messages:

rem=rem --[[

Missing dependencies for nn:
luaffi

Cloning into 'luaffifb'...
remote: Counting objects: 43, done.
remote: Compressing objects: 100% (42/42), done.
Receiving objects:  97% (42/43)   d 22 (delta 0), pack-reused 0eceiving objects:  93% (40/43)
Receiving objects: 100% (43/43), 153.31 KiB | 0 bytes/s, done.
Resolving deltas: 100% (4/4), done.
Checking connectivity... done.
cl /MD /O2 -c -Focall.obj -IC:/luainstall/include call.c -Idynasm
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

call.c
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(68) : warning C4273: 'luaopen_ffi' : inconsistent dll linkage
        C:/luainstall/include\lualib.h(35) : see previous definition of 'luaopen_ffi'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(361) : error C2061: syntax error : identifier 'complex_double'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(361) : error C2059: syntax error : ';'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(362) : error C2061: syntax error : identifier 'complex_float'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(362) : error C2059: syntax error : ';'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(363) : error C2061: syntax error : identifier 'mk_complex_double'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(363) : error C2059: syntax error : ';'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(363) : error C2059: syntax error : 'type'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(364) : error C2059: syntax error : 'bad suffix on number'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(366) : error C2061: syntax error : identifier 'mk_complex_float'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(366) : error C2059: syntax error : ';'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(366) : error C2059: syntax error : 'type'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(367) : error C2059: syntax error : 'bad suffix on number'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(442) : error C2061: syntax error : identifier 'check_complex_double'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(442) : error C2059: syntax error : ';'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(442) : error C2059: syntax error : 'type'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(443) : error C2061: syntax error : identifier 'check_complex_float'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(443) : error C2059: syntax error : ';'
c:\users\ericf\appdata\local\temp\luarocks_luaffi-scm-1-406\luaffifb\ffi.h(443) : error C2059: syntax error : 'type'
call.c(163) : error C2065: 'check_complex_double' : undeclared identifier
call.c(164) : error C2065: 'check_complex_float' : undeclared identifier

Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/luaffi-scm-1.rockspec - Build error: Failed compiling object call.obj



Clearly there's an error w/ the ffi.h header.  Can anyone see what I am doing wrong?  Is there a different rock on which nn depends that I must install first?

(I'm running Windows10, 64-bit)

Paul Wagner

unread,
Jun 2, 2016, 5:16:26 AM6/2/16
to torch7
I just ran into the same issue, but the patch here solved it for me: https://github.com/facebook/luaffifb/issues/10

I applied it simply by hitting ctrl-s immediately after the rocks installer had cloned the git repo, then patched the files directly at C:\Users\<username>\AppData\Local\Temp\luarocks_luaffi-scm-1-<pid>. Ignore the part about editing makefiles in the link above; it was not necessary in this case.

Hope this helps!

Eric Prechtl

unread,
Jun 2, 2016, 5:25:44 PM6/2/16
to torch7
Paul,

That worked.  Thank you!  I'm pretty sure I would never have thought to do that!
Reply all
Reply to author
Forward
0 new messages