【问题标题】:Installing Torch7 with Luarocks on Windows with mingw build error在 Windows 上使用 Luarocks 安装 Torch7 并出现 mingw 构建错误
【发布时间】:2015-02-01 07:36:40
【问题描述】:

我按照说明 here 使用 Mingw 从头开始​​设置 Lua 和 Luarocks。一切正常,我能够安装岩石,包括需要编译的岩石,如 LuaSocket。

我按照Torch7 页面上的说明通过 luarocks 安装 Torch。但它无法构建。我不明白为什么。

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

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.

【问题讨论】:

标签: lua mingw luarocks torch


【解决方案1】:

该命令看起来基本正确,但我认为 cmake 命令需要-G "MSYS Makefiles" 选项才能使用 mingw 而不是 VS。您可能还需要提取最新的 Torch 版本,因为它包含修复了 mingw 的一些编译问题的 several changes

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

【讨论】:

    【解决方案2】:

    cmake 似乎使用 Visual Studio 9 2008,但它“错误地”使用 mingw32-make.exe 而不是……nmake.exe。 在执行luarocks 命令之前,您可以在同一控制台中运行此命令:"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"(适应您的 Visual Studio 路径)。现在,cmake 应该使用 nmake

    【讨论】:

      猜你喜欢
      • 2019-12-02
      • 2021-01-28
      • 2020-01-13
      • 1970-01-01
      • 1970-01-01
      • 2016-08-12
      • 1970-01-01
      • 2015-06-17
      • 2018-12-07
      相关资源
      最近更新 更多