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

github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYufei Ren <yren@us.ibm.com>2016-07-28 18:53:43 +0300
committerYufei Ren <yren@us.ibm.com>2016-07-28 18:53:43 +0300
commit4ddeadbe1e14b28a092699ba2c19b0f6b9eda861 (patch)
tree8b18974983eb4045f0cb4bc663176e8438d1edcf
parent4eb4c5b6c6cf94badadebc8d5c39a1d470950036 (diff)
link ncurses explicitly
Met the following compile error when install torch7 in RHEL6.8. ... Installing Lua version: LUAJIT21 /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status make[2]: *** [exe/luajit-rocks/luajit-2.1/luajit] Error 1 make[1]: *** [exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit.dir/all] Error 2 make: *** [all] Error 2 ... Need to link libncurses explicitly.
-rw-r--r--luajit-2.1/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/luajit-2.1/CMakeLists.txt b/luajit-2.1/CMakeLists.txt
index cee0204..eac0894 100644
--- a/luajit-2.1/CMakeLists.txt
+++ b/luajit-2.1/CMakeLists.txt
@@ -165,6 +165,11 @@ if ( LUA_USE_LIBM )
list ( APPEND LIBS m )
endif ()
+CHECK_LIBRARY_EXISTS(ncurses printw "" LUA_USE_LIBNCURSES)
+if ( LUA_USE_LIBNCURSES )
+ list ( APPEND LIBS ncurses )
+endif ()
+
SET(CMAKE_THREAD_PREFER_PTHREAD TRUE)
FIND_PACKAGE(Threads)
IF(THREADS_FOUND)