diff --git a/CMakeLists.txt b/CMakeLists.txt index d59be62e..156172a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") # why? see http://stackoverflow.com/questions/20858911/lua-open-returns-null-using-luajit/20875342#20875342 OPTION(USE_LUAJIT "Link with luajit.so. Wont work on Mac. Faster on linux" OFF) endif() -message("USE_LUAJIT ${USE_LUAJIT}") FIND_PACKAGE(Torch REQUIRED) # you need to run source ~/torch/install/bin/torch-activate if this line # gives an error diff --git a/build.sh b/build.sh index 74cbf1aa..5493537c 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,7 @@ if [[ x${TORCH_INSTALL} == x ]]; then { exit 1 } fi -if [[ x${{USE_LUAJIT}} == x ]]; then { USE_LUAJIT=ON; } fi +if [[ x${USE_LUAJIT} == x ]]; then { USE_LUAJIT=ON; } fi if [[ x${CYTHON} != x ]]; then { python setup.py cython_only || exit 1; } fi (cd cbuild; cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_LUAJIT=${USE_LUAJIT} -DCMAKE_INSTALL_PREFIX=${TORCH_INSTALL} && make -j 4 install) || exit 1 python setup.py install || exit 1 diff --git a/src/nnWrapper.cpp b/src/nnWrapper.cpp index 68b7e8cd..65b9d41d 100644 --- a/src/nnWrapper.cpp +++ b/src/nnWrapper.cpp @@ -24,16 +24,13 @@ using namespace std; lua_State *luaInit() { #ifndef _WIN32 -// cout << "luaInit" << endl; #ifdef USE_LUAJIT #define LUALIBNAME "libluajit" #else #define LUALIBNAME "libPyTorchLua" #endif - cout << "lua libname " << LUALIBNAME << endl; void *hdl = dlopen(LUALIBNAME ".so", RTLD_NOW | RTLD_GLOBAL); if(hdl == 0) { -// //cout << "Failed to load libPyTorchLua.so, trying dylib..." << endl; hdl = dlopen(LUALIBNAME ".dylib", RTLD_NOW | RTLD_GLOBAL); } if(hdl == 0) { @@ -41,11 +38,7 @@ lua_State *luaInit() { cout << dlerror() << endl; throw runtime_error(string("Couldnt load " LUALIBNAME ".so or " LUALIBNAME ".dylib") + dlerror()); } else { -////// cout << "loaded lua library" << endl; } -// void *err = dlopen("libpaths.so", RTLD_NOW | RTLD_GLOBAL); -// void *err = dlopen("libluajit.so", RTLD_NOW | RTLD_GLOBAL); -// cout << "err " << (long)err << endl; #endif diff --git a/src/nnWrapper.jinja2.cpp b/src/nnWrapper.jinja2.cpp index a0ba0b0b..a50f65f7 100644 --- a/src/nnWrapper.jinja2.cpp +++ b/src/nnWrapper.jinja2.cpp @@ -24,16 +24,13 @@ using namespace std; lua_State *luaInit() { #ifndef _WIN32 -// cout << "luaInit" << endl; #ifdef USE_LUAJIT #define LUALIBNAME "libluajit" #else #define LUALIBNAME "libPyTorchLua" #endif - cout << "lua libname " << LUALIBNAME << endl; void *hdl = dlopen(LUALIBNAME ".so", RTLD_NOW | RTLD_GLOBAL); if(hdl == 0) { -// //cout << "Failed to load libPyTorchLua.so, trying dylib..." << endl; hdl = dlopen(LUALIBNAME ".dylib", RTLD_NOW | RTLD_GLOBAL); } if(hdl == 0) { @@ -41,11 +38,7 @@ lua_State *luaInit() { cout << dlerror() << endl; throw runtime_error(string("Couldnt load " LUALIBNAME ".so or " LUALIBNAME ".dylib") + dlerror()); } else { -////// cout << "loaded lua library" << endl; } -// void *err = dlopen("libpaths.so", RTLD_NOW | RTLD_GLOBAL); -// void *err = dlopen("libluajit.so", RTLD_NOW | RTLD_GLOBAL); -// cout << "err " << (long)err << endl; #endif