-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win64 installation #10
base: master
Are you sure you want to change the base?
Changes from all commits
897c041
3add215
26710cb
e9a2252
807e9b5
17a963c
9428013
1b277d7
21e8bb4
8f723a6
921ae9f
77aa68e
d1f2496
7e7c301
afafb03
f8f9e22
1c4179b
74a7f44
9f53d34
298f505
fd35804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
build/*.* | ||
build/CMakeFiles/2.8.12.2/CMakeASMCompiler.cmake | ||
build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake | ||
build/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake | ||
build/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_C.bin | ||
build/CMakeFiles/2.8.12.2/CMakeDetermineCompilerABI_CXX.bin | ||
build/CMakeFiles/2.8.12.2/CMakeRCCompiler.cmake | ||
build/CMakeFiles/2.8.12.2/CMakeSystem.cmake | ||
build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c | ||
build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.exe | ||
build/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.obj | ||
build/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp | ||
build/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.exe | ||
build/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.obj | ||
build/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.bin | ||
build/CMakeFiles/CheckTypeSize/SIZEOF_VOID_P.c | ||
build/CMakeFiles/cmake.check_cache | ||
build/CMakeFiles/CMakeDirectoryInformation.cmake | ||
build/CMakeFiles/CMakeError.log | ||
build/CMakeFiles/CMakeOutput.log | ||
build/CMakeFiles/CMakeRuleHashes.txt | ||
build/CMakeFiles/Makefile.cmake | ||
build/CMakeFiles/Makefile2 | ||
build/CMakeFiles/progress.marks | ||
build/CMakeFiles/TargetDirectories.txt | ||
build/luarocks/cmake_install.cmake | ||
build/luarocks/CMakeFiles/CMakeDirectoryInformation.cmake | ||
build/luarocks/CMakeFiles/progress.marks | ||
build/luarocks/Makefile | ||
build/luarocks/src/bin/luarocks.bat | ||
build/luarocks/src/bin/luarocks-admin.bat | ||
build/luarocks/src/luarocks/config.lua | ||
build/luarocks/src/luarocks/site_config.lua | ||
build/Makefile | ||
build/LUA_DEV | ||
bld07/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bld07/ is non-standard :-) fine with it personally, but I reckon it'd be cleaner to remove it, on the hwole |
||
x86/* | ||
x64/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,24 +33,43 @@ is free, it has no GUI, but it is just fine with CMake. | |
|
||
# Installation | ||
|
||
On Windows - use command prompt with appropritate environment (e.g. VS2013 Native Tools Command Prompt) | ||
|
||
```sh | ||
git clone https://github.com/torch/luajit-rocks.git | ||
git clone https://github.com/diz-vara/luajit-rocks.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For purposes of PR, I think this should point to torch, rather than diz-vara. |
||
cd luajit-rocks | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_INSTALL_PREFIX=/your/prefix | ||
``` | ||
Choose the destination - (e.g. d:/luainstall) - it will be '/your/prefix' | ||
|
||
Then under Unix systems: | ||
```sh | ||
cmake .. -DCMAKE_INSTALL_PREFIX=/your/prefix | ||
make install | ||
``` | ||
|
||
Under Windows: | ||
```sh | ||
nmake install | ||
cmake .. -DCMAKE_INSTALL_PREFIX=/your/prefix -DWITH_LUAJIT21=ON -G "NMake Makefiles" -DWIN32=1 | ||
nmake | ||
cmake -DCMAKE_INSTALL_PREFIX=/your/prefix -DWITH_LUAJIT21=ON -G "NMake Makefiles" -DWIN32=1 -P cmake_install.cmake | ||
``` | ||
|
||
Under Windows - remember to update your environment variables. Assuming that your/prefix is d:/luainstall : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make this a variable, rahter than d:/luatinstall. eg |
||
```sh | ||
set LUA_CPATH=d:\luainstall?.DLL;d:\luainstall\LIB\?.DLL;?.DLL | ||
set LUA_DEV=d:/luainstall | ||
set LUA_PATH=;;d:\luainstall\?;d:\luainstall\lua\?\init.lua;d:\luainstall\?.lua | ||
``` | ||
|
||
Then install packages you need: | ||
luarocks install torch | ||
luarocks install nn | ||
luarocks install nnx | ||
etc... | ||
|
||
|
||
Note: we do not recommend (nor we support) installation under Cygwin. | ||
|
||
## Additional CMake flags | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,16 @@ | |
#ifndef lua_h | ||
#define lua_h | ||
|
||
#ifdef WIN32 | ||
# ifndef LUA_WIN | ||
# define LUA_WIN | ||
# endif | ||
# ifndef _WIN32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would be cleaner to not mess wit hthe lua sourcecode I reckon? I think I'd prefer these in our CMakeLists perhaps? |
||
# define _WIN32 | ||
# endif | ||
#endif | ||
|
||
|
||
#include <stdarg.h> | ||
#include <stddef.h> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,21 @@ | |
#ifndef lua_h | ||
#define lua_h | ||
|
||
#ifdef WIN32 | ||
# ifndef LUA_WIN | ||
# define LUA_WIN | ||
# endif | ||
# ifndef _WIN32 | ||
# define _WIN32 | ||
# endif | ||
|
||
# if !defined LUA_LIB & !defined LUA_CORE & !defined luajit_c & !defined _LJ_ARCH_H & !defined _LJ_DEF_H & !defined _LJ_OBJ_H | ||
# pragma comment( lib, "libluajit.lib") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's better to use the linker options instead of #pragma. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I odnt know what this pragma does, but concur with the comment by Ark-kun, if that's indeed what this does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hughperkins this pragma just links with the library - but only in certain cases (if module is not a part of the 'core' itself). It can be moved to the options - if somebody will implement these conditions in CMake |
||
# endif | ||
|
||
#endif | ||
|
||
|
||
#include <stdarg.h> | ||
#include <stddef.h> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ | |
** In Windows, any exclamation mark ('!') in the path is replaced by the | ||
** path of the directory of the executable file of the current process. | ||
*/ | ||
|
||
#define LUA_BUILD_AS_DLL 1 | ||
|
||
#define LUA_LDIR "!\\lua\\" | ||
#define LUA_CDIR "!\\" | ||
#define LUA_PATH_DEFAULT \ | ||
|
@@ -135,7 +138,7 @@ | |
#define LUA_API __declspec(dllimport) | ||
#endif | ||
#else | ||
#define LUA_API extern | ||
#define LUA_API extern "C" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think we should be messing around wit hthe original lua source code? We can simply add extern "C" in our own c++ header files?
|
||
#endif | ||
|
||
#define LUALIB_API LUA_API | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ function builtin.run(rockspec) | |
"-l" .. (variables.MSVCRT or "m"), "-luser32") | ||
return ok, wrapname | ||
end | ||
elseif cfg.is_platform("win32") then | ||
elseif cfg.is_platform("win32") or cfg.is_platform('x64') then | ||
compile_object = function(object, source, defines, incdirs) | ||
local extras = {} | ||
add_flags(extras, "-D%s", defines) | ||
|
@@ -116,7 +116,8 @@ function builtin.run(rockspec) | |
def:write("EXPORTS\n") | ||
def:write("luaopen_"..name:gsub("%.", "_").."\n") | ||
def:close() | ||
local ok = execute(variables.LD, "-dll", "-def:"..deffile, "-out:"..library, dir.path(variables.LUA_LIBDIR, variables.LUALIB), unpack(extras)) | ||
-- diz --- local ok = execute(variables.LD, "-dll", "-def:"..deffile, "-out:"..library, dir.path(variables.LUA_LIBDIR, variables.LUALIB), unpack(extras)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we remove the dead code? |
||
local ok = execute(variables.LD, "-dll", "-out:"..library, dir.path(variables.LUA_LIBDIR, variables.LUALIB), unpack(extras)) | ||
local basedir = "" | ||
if name:find("%.") ~= nil then | ||
basedir = name:gsub("%.%w+$", "\\") | ||
|
@@ -127,6 +128,7 @@ function builtin.run(rockspec) | |
if ok and fs.exists(manifestfile) then | ||
ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..basedir..basename..".dll;2") | ||
end | ||
--- diz --- io.read() | ||
return ok | ||
end | ||
compile_wrapper_binary = function(fullname, name) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ rocks_trees = { | |
} | ||
|
||
rocks_servers = { | ||
[[https://raw.githubusercontent.com/diz-vara/rocks/master]], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer to remove this, for torch distribution |
||
[[https://raw.githubusercontent.com/torch/rocks/master]], | ||
[[https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master]] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,9 @@ rocks_trees = { | |
} | ||
|
||
rocks_servers = { | ||
[[https://raw.githubusercontent.com/torch/rocks/master]], | ||
[[https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master]] | ||
[[https://raw.githubusercontent.com/diz-vara/rocks/master]], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure we want this in official torch distribution? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hughperkins Not for official, certainly! I keep my repo in the list for some windows-specific changes (eg in luaffifb, imgraph). |
||
[[https://raw.githubusercontent.com/torch/rocks/master]], | ||
[[https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master]] | ||
} | ||
|
||
variables = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do simply: