在Windows上使用mingw构建错误在Luarocks上安装Torch7 [英] Installing Torch7 with Luarocks on Windows with mingw build error

查看:419
本文介绍了在Windows上使用mingw构建错误在Luarocks上安装Torch7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此处的说明进行操作,并从头开始设置Lua和Luarocks,明哥一切工作正常,我能够安装岩石,包括需要像LuaSocket这样进行编译的岩石.

I followed the instructions here and set up Lua and Luarocks from scratch, with Mingw. Everything worked fine and I was able to install rocks, including ones which require compiling like LuaSocket.

我按照 Torch7 页上的说明进行操作,以通过羽扇安装Torch.但是它无法构建.我不明白为什么.

I followed the instructions on the Torch7 page to install Torch via luarocks. But it fails building. I do not understand why.

这是控制台输出.我最好的猜测是,当我认为我希望它使用Mingw时,它与Building for: Visual Studio 9 2008有关.

Here is the console output. My best guess is that it has something to do with Building for: Visual Studio 9 2008 when I think I want it to use Mingw.

PS C:\WINDOWS\system32> luarocks --server=https://raw.githubusercontent.com/torch/rocks/master install torch
Installing https://raw.githubusercontent.com/torch/rocks/master/torch-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/torch-scm-1.rockspec... switching to 'build' mode

Missing dependencies for torch:
paths >= 1.0
cwrap >= 1.0

Using https://raw.githubusercontent.com/torch/rocks/master/paths-scm-1.rockspec... switching to 'build' mode
Cloning into 'paths'...
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 0), reused 6 (delta 0)R
Receiving objects: 100% (10/10), 12.24 KiB | 0 bytes/s, done.
Checking connectivity... done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUALIB=lua51.dll -DLUA_INCDIR="C:/Pro
gram Files (x86)/Lua/5.1/include/" -DLUA_LIBDIR="C:/Program Files (x86)/Lua/5.1/" -DLUADIR="C:\Program Files (x86)\LuaRo
cks\systree/lib/luarocks/rocks/paths/scm-1/lua" -DLIBDIR="C:\Program Files (x86)\LuaRocks\systree/lib/luarocks/rocks/pat
hs/scm-1/lib" -DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\LuaRocks\systree/lib/luarocks/rocks/paths/scm-1" && mingw32
-make

-- Building for: Visual Studio 9 2008
-- The C compiler identification is MSVC 15.0.30729.1
-- The CXX compiler identification is MSVC 15.0.30729.1
-- Check for working C compiler using: Visual Studio 9 2008
-- Check for working C compiler using: Visual Studio 9 2008 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 9 2008
-- Check for working CXX compiler using: Visual Studio 9 2008 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_BUILD_TYPE


-- Build files have been written to: C:/Users/Daniel/AppData/Local/Temp/luarocks_paths-scm-1-1059/paths/build
mingw32-make: *** No targets specified and no makefile found.  Stop.

Error: Failed installing dependency: https://raw.githubusercontent.com/torch/rocks/master/paths-scm-1.rockspec - Build e
rror: Failed building.

推荐答案

该命令看起来基本上是正确的,但是我认为cmake命令需要-G "MSYS Makefiles"选项才能使用mingw而不是VS.您可能还需要拉出最新的割炬版本,因为它包含一些更改 mingw的编译问题.

The command looks mostly correct, but I think the cmake command needs -G "MSYS Makefiles" option to use mingw instead of VS. You may also need to pull the most recent torch version as it includes several changes that fix some compilation issues with mingw.

请注意,我尚未使用LuaRocks测试更改,并且不确定如何将其他选项传递给它,但是您应该能够手动运行相同的命令以获得所需的结果(我从命令行对其进行了编译).

Note that I haven't tested the changes with LuaRocks and not sure how to pass that additional option to it, but you should be able to run the same command manually to get the desired result (I compiled it from the command line).

这篇关于在Windows上使用mingw构建错误在Luarocks上安装Torch7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆