{"action":"created","issue":{"url":"https://api.github.com/repos/torch/torch7/issues/287","labels_url":"https://api.github.com/repos/torch/torch7/issues/287/labels{/name}","comments_url":"https://api.github.com/repos/torch/torch7/issues/287/comments","events_url":"https://api.github.com/repos/torch/torch7/issues/287/events","html_url":"https://github.com/torch/torch7/pull/287","id":94177862,"number":287,"title":"Add support for compilation on Windows using mingw32","user":{"login":"pkulchenko","id":77071,"avatar_url":"https://avatars.githubusercontent.com/u/77071?v=3","gravatar_id":"","url":"https://api.github.com/users/pkulchenko","html_url":"https://github.com/pkulchenko","followers_url":"https://api.github.com/users/pkulchenko/followers","following_url":"https://api.github.com/users/pkulchenko/following{/other_user}","gists_url":"https://api.github.com/users/pkulchenko/gists{/gist_id}","starred_url":"https://api.github.com/users/pkulchenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkulchenko/subscriptions","organizations_url":"https://api.github.com/users/pkulchenko/orgs","repos_url":"https://api.github.com/users/pkulchenko/repos","events_url":"https://api.github.com/users/pkulchenko/events{/privacy}","received_events_url":"https://api.github.com/users/pkulchenko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2015-07-09T23:54:07Z","updated_at":"2015-08-21T06:05:17Z","closed_at":"2015-07-10T04:25:02Z","pull_request":{"url":"https://api.github.com/repos/torch/torch7/pulls/287","html_url":"https://github.com/torch/torch7/pull/287","diff_url":"https://github.com/torch/torch7/pull/287.diff","patch_url":"https://github.com/torch/torch7/pull/287.patch"},"body":"This patch enables Torch7 compilation on Windows using mingw32 (or tdm-gcc with msys/msys2).\r\n\r\nThe steps needed:\r\n\r\n1. Install `torch/cwrap` and `torch/paths`\r\n2. Run the following commands:\r\n\r\n```\r\ncmake -E make_directory build\r\ncd build\r\ncmake .. -G \"MSYS Makefiles\" -DCMAKE_BUILD_TYPE=Release -DLUALIB=lua51.dll -DLUA_INCDIR=\"%LUA_INCDIR%\" -DLUA_LIBDIR=\"%LUA_LIBDIR%\" -DLUA=\"%LUA%\"\r\nmake\r\n```\r\n\r\nRelated ticket: #150. I've tested this under Windows 8.1 using msys2 and tdm-gcc-4.8, but it should work with other versions and configurations of mingw."},"comment":{"url":"https://api.github.com/repos/torch/torch7/issues/comments/133298202","html_url":"https://github.com/torch/torch7/pull/287#issuecomment-133298202","issue_url":"https://api.github.com/repos/torch/torch7/issues/287","id":133298202,"user":{"login":"diz-vara","id":10057306,"avatar_url":"https://avatars.githubusercontent.com/u/10057306?v=3","gravatar_id":"","url":"https://api.github.com/users/diz-vara","html_url":"https://github.com/diz-vara","followers_url":"https://api.github.com/users/diz-vara/followers","following_url":"https://api.github.com/users/diz-vara/following{/other_user}","gists_url":"https://api.github.com/users/diz-vara/gists{/gist_id}","starred_url":"https://api.github.com/users/diz-vara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diz-vara/subscriptions","organizations_url":"https://api.github.com/users/diz-vara/orgs","repos_url":"https://api.github.com/users/diz-vara/repos","events_url":"https://api.github.com/users/diz-vara/events{/privacy}","received_events_url":"https://api.github.com/users/diz-vara/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T06:05:17Z","updated_at":"2015-08-21T06:05:17Z","body":"@cgravier: the latest question (difference bw cwrap and paths installation)\nis clear: cwrap does not require the compilation - and does not depend on\nCMake generator switch.\n\nAs for the paths: in Windows Cmake uses Visual Studio generator by default.\nTo change it, I use 'cmake.cmd' that is located somewhere it the PATH above\nthe cmake.exe - and it calls\ncmake.exe with the proper -G flag ( -G \"MSYS Makefiles\" or -G \"MinGW\nMakefiles\" in your case).\n\nI can't tell about MSYS (or MinGW) - I use VS with NMake.\nMay be, it is a question of command prompt settings?\nhttp://www.cmake.org/cmake/help/v3.1/generator/MSYS%20Makefiles.html\n\n\n\n\nOn Thu, Aug 20, 2015 at 11:02 PM, cgravier <notifications@github.com> wrote:\n\n> More info: I tried the installation of cwraps and paths using the rock\n> server https://github.com/torch/rocks\n>\n> It happens that cwrap can be successfully installed (at least that what\n> luarocks client outputs) while paths cannot be installed.\n>\n> cwrap :\n>\n> C:\\Users\\Fafhrd>luarocks --local --server=https://raw.github.com/torch/rocks/master install cwrap\n> Installing https://raw.github.com/torch/rocks/master/cwrap-scm-1.rockspec...\n> Using https://raw.github.com/torch/rocks/master/cwrap-scm-1.rockspec... switching to 'build' mode\n> Cloning into 'cwrap'...\n> remote: Counting objects: 8, done.\n> remote: Compressing objects: 100% (7/7), done.\n> remote: Total 8 (delta 0), reused 5 (delta 0), pack-reused 0\n> Receiving objects: 100% (8/8), 10.31 KiB, done.\n> Updating manifest for C:/Users/Fafhrd/AppData/Roaming/luarocks/lib/luarocks/rocks\n> No existing manifest. Attempting to rebuild...\n> cwrap scm-1 is now built and installed in C:/Users/Fafhrd/AppData/Roaming/luarocks (license: BSD)\n>\n> C:\\Users\\Fafhrd>luarocks --local --server=https://raw.github.com/torch/rocks/master install paths\n> Installing https://raw.github.com/torch/rocks/master/paths-scm-1.rockspec...\n> Using https://raw.github.com/torch/rocks/master/paths-scm-1.rockspec... switching to 'build' mode\n> Cloning into 'paths'...\n> remote: Counting objects: 10, done.\n> remote: Compressing objects: 100% (9/9), done.\n> remote: Total 10 (delta 0), reused 4 (delta 0), pack-reused 0\n> Receiving objects: 100% (10/10), 12.83 KiB, done.\n> cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release\n>  -DLUALIB=lua53.dll -DLUA_INCDIR=\"C:/Program Files (x86)/lua/5.3/include/\" -DLUA\n> _LIBDIR=\"C:/Program Files (x86)/lua/5.3/bin/\" -DLUADIR=\"C:/Users/Fafhrd/AppData/\n> Roaming/luarocks/lib/luarocks/rocks/paths/scm-1/lua\" -DLIBDIR=\"C:/Users/Fafhrd/A\n> ppData/Roaming/luarocks/lib/luarocks/rocks/paths/scm-1/lib\" -DCMAKE_INSTALL_PREF\n> IX=\"C:/Users/Fafhrd/AppData/Roaming/luarocks/lib/luarocks/rocks/paths/scm-1\" &&\n> mingw32-make\n>\n> -- Building for: Visual Studio 10 2010\n> -- The C compiler identification is MSVC 16.0.40219.1\n> -- The CXX compiler identification is MSVC 16.0.40219.1\n> -- Check for working C compiler using: Visual Studio 10 2010\n> -- Check for working C compiler using: Visual Studio 10 2010 -- works\n> -- Detecting C compiler ABI info\n> -- Detecting C compiler ABI info - done\n> -- Check for working CXX compiler using: Visual Studio 10 2010\n> -- Check for working CXX compiler using: Visual Studio 10 2010 -- works\n> -- Detecting CXX compiler ABI info\n> -- Detecting CXX compiler ABI info - done\n> -- Detecting CXX compile features\n> -- Detecting CXX compile features - done\n> -- Configuring done\n> -- Generating done\n> CMake Warning:\n>   Manually-specified variables were not used by the project:\n>\n>     CMAKE_BUILD_TYPE\n>\n>\n> -- Build files have been written to: C:/Users/Fafhrd/AppData/Local/Temp/luarocks\n> _paths-scm-1-474/paths/build\n> mingw32-make: *** No targets specified and no makefile found.  Stop.\n>\n> Error: Build error: Failed building.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/torch/torch7/pull/287#issuecomment-133155370>.\n>\n"}}