Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cutorch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlvdmaaten <lvdmaaten@fb.com>2017-04-19 16:57:11 +0300
committerlvdmaaten <lvdmaaten@fb.com>2017-04-19 16:57:11 +0300
commit9ffa012afc3536dc935c7ad4e1c708a08baeef98 (patch)
treeb4c6bbefdbd1424006bfdc16f78115a56feebb1a /CMakeLists.txt
parent8f9a4facae515b9ded83c46366009eb3558eed26 (diff)
Make luaL_setfuncs detection more robust
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d1d0a0..8d3ece7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,20 @@ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/torch")
SET(src Storage.c init.c Tensor.c TensorMath.c TensorOperator.c torch/utils.c)
SET(luasrc init.lua Tensor.lua FFI.lua test/test.lua)
+set(CMAKE_REQUIRED_INCLUDES ${LUA_INCDIR})
+include(CheckCSourceCompiles)
+check_c_source_compiles("
+#include <lauxlib.h>
+int main()
+{
+ long i = sizeof(&luaL_setfuncs);
+ return 0;
+}
+" HAS_LUAL_SETFUNCS)
+if(HAS_LUAL_SETFUNCS)
+ add_definitions(-DHAS_LUAL_SETFUNCS)
+endif()
+
ADD_TORCH_WRAP(cudatensormathwrap TensorMath.lua)
ADD_TORCH_PACKAGE(cutorch "${src}" "${luasrc}")