Installing moonscript via luarocks on Windows

1.4k views Asked by At

When I try to install moonscript through luarocks, the process errors out in installing the dependencies for moonscript, saying that "cl" isn't an installed / recognized program.

C:\Users\Kingdaro>luarocks install moonscript
Installing http://luarocks.org/repositories/rocks/moonscript-0.2.4-1.src.rock...


Missing dependencies for moonscript:
lpeg >= 0.10, ~= 0.11
alt-getopt >= 0.7


7-Zip 9.10 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-12-22

Processing archive: lpeg-0.12.tar.gz

Extracting  lpeg-0.12.tar

Everything is Ok

Size:       245760
Compressed: 66649

7-Zip 9.10 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-12-22

Processing archive: lpeg-0.12.tar

Extracting  lpeg-0.12
Extracting  lpeg-0.12\makefile
Extracting  lpeg-0.12\HISTORY
Extracting  lpeg-0.12\test.lua
Extracting  lpeg-0.12\re.lua
Extracting  lpeg-0.12\lpeg.html
Extracting  lpeg-0.12\re.html
Extracting  lpeg-0.12\lpeg-128.gif
Extracting  lpeg-0.12\lptypes.h
Extracting  lpeg-0.12\lpcap.h
Extracting  lpeg-0.12\lpcap.c
Extracting  lpeg-0.12\lpcode.h
Extracting  lpeg-0.12\lpcode.c
Extracting  lpeg-0.12\lpprint.h
Extracting  lpeg-0.12\lpprint.c
Extracting  lpeg-0.12\lptree.h
Extracting  lpeg-0.12\lptree.c
Extracting  lpeg-0.12\lpvm.h
Extracting  lpeg-0.12\lpvm.c

Everything is Ok

Folders: 1
Files: 18
Size:       220385
Compressed: 245760
cl /MD /O2 -c -Folpcap.obj -IC:/Program Files (x86)/Lua/5.1/include lpcap.c
'cl' is not recognized as an internal or external command,
operable program or batch file.

Error: Failed installing dependency: http://luarocks.org/repositories/rocks/lpeg
-0.12-1.src.rock - Build error: Failed compiling object lpcap.obj

I'm not sure what to do here; I've been googling a solution for the past couple of days but couldn't find anything relevant. If it helps, I'm using the Lua 5.1.4 installation provided by Lua for Windows.

2

There are 2 answers

0
ichramm On BEST ANSWER

From MSDN:

cl.exe is a tool that controls the Microsoft C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio.

You should run luarocks install inside the Visual Studio Command Prompt.

I tried to install moonscript without Visual Studio and found that moonscript does not have a binary distribution.

Anyway, I found the binary package for each of moonscript's dependencies, the installation procedure is the follwing:

luarocks install lpeg 0.10-1           # this is the one that failed first
luarocks install luafilesystem 1.6.0-1 # this one failed after installing lpeg

But the following:

luarocks install moonscript

Can only be done within the Visual Studio Command Prompt unless you manually download a binary package.

0
Etan Reisner On

cl is the compiler that is part of Visual Studio. That failure is happening because luarocks is attempting to build lpeg as a dependency. You either need to find a way to get luarocks to install a pre-built lpeg (which I assume it would have done if one existed in its database) or you need to get a copy of visual studio (I believe some versions are free).