diff --git a/fblualib/build.sh b/fblualib/build.sh index 849bf5a..d0d73fb 100755 --- a/fblualib/build.sh +++ b/fblualib/build.sh @@ -31,5 +31,5 @@ for rock in $rocks; do cd $root/$rock # Unfortunately, luarocks doesn't like separating the "build" and # "install" phases, so we have to run as root. - sudo luarocks make rockspec/fb$rock-$version.rockspec + sudo ~/torch/install/bin/luarocks make rockspec/fb$rock-$version.rockspec done diff --git a/fblualib/ffivector/CMakeLists.txt b/fblualib/ffivector/CMakeLists.txt index bc9ad68..762ac2f 100644 --- a/fblualib/ffivector/CMakeLists.txt +++ b/fblualib/ffivector/CMakeLists.txt @@ -23,7 +23,7 @@ INCLUDE_DIRECTORIES( ${FOLLY_INCLUDE_DIR} ) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") SET(src FFIVector.cpp diff --git a/fblualib/mattorch/CMakeLists.txt b/fblualib/mattorch/CMakeLists.txt index e06736e..7dc44cf 100644 --- a/fblualib/mattorch/CMakeLists.txt +++ b/fblualib/mattorch/CMakeLists.txt @@ -35,7 +35,7 @@ INCLUDE_DIRECTORIES( ${MATIO_INCLUDE_DIR} ) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") SET(src MatTorch.cpp diff --git a/fblualib/python/CMakeLists.txt b/fblualib/python/CMakeLists.txt index 6e68b00..0e0be71 100644 --- a/fblualib/python/CMakeLists.txt +++ b/fblualib/python/CMakeLists.txt @@ -63,7 +63,7 @@ INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") SET(src Debug.cpp diff --git a/fblualib/python/Lib.cpp b/fblualib/python/Lib.cpp index 22d3b6e..390817d 100644 --- a/fblualib/python/Lib.cpp +++ b/fblualib/python/Lib.cpp @@ -187,7 +187,7 @@ const struct luaL_reg pythonFuncs[] = { {"dict", getDict}, {"import", getModule}, {"_check_no_refs", checkNoRefs}, - {nullptr, nullptr}, + {nullptr, nullptr}, }; } // namespace @@ -231,7 +231,7 @@ PythonInitializer::PythonInitializer() { std::mutex gPythonInitMutex; -} // namespace +//} // namespace extern "C" int LUAOPEN(lua_State* L) { reloadGlobal(); @@ -240,9 +240,8 @@ extern "C" int LUAOPEN(lua_State* L) { static PythonInitializer initializer; // only once, thread-safe lua_newtable(L); - luaL_register(L, nullptr, pythonFuncs); - - { +luaL_register(L, nullptr, pythonFuncs); +{ // numpy's import_array() doesn't appear to be thread-safe... std::lock_guard lock(gPythonInitMutex); @@ -253,7 +252,8 @@ extern "C" int LUAOPEN(lua_State* L) { // Initialization finished. Any Python references created so far are there // to stay until the module is unloaded. debugSetWatermark(); - } + } return 1; } +} // namespace diff --git a/fblualib/torch/CMakeLists.txt b/fblualib/torch/CMakeLists.txt index 1910f36..280fb4d 100644 --- a/fblualib/torch/CMakeLists.txt +++ b/fblualib/torch/CMakeLists.txt @@ -28,7 +28,7 @@ INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(${LUA_INCDIR}) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14") SET(src AsyncRNG.cpp diff --git a/install_all.sh b/install_all.sh index e78b227..57bce73 100755 --- a/install_all.sh +++ b/install_all.sh @@ -88,8 +88,11 @@ echo if [ $current -eq 1 ]; then git clone --depth 1 https://github.com/facebook/folly git clone --depth 1 https://github.com/facebook/fbthrift - git clone https://github.com/facebook/thpp - git clone https://github.com/facebook/fblualib + #error ubuntu16.04 + #git clone https://github.com/facebook/thpp + #add my thpp + git clone https://github.com/qinghuizhao/thpp + git clone https://github.com/qinghuizhao/fblualib git clone https://github.com/facebook/wangle else git clone -b v0.35.0 --depth 1 https://github.com/facebook/folly