torch / qtlua

Lua interface to QT library
Other
206 stars 73 forks source link

Building qtlua: ‘LUA_PATHSEP’ was not declared in this scope #40

Open NataliaDiaz opened 7 years ago

NataliaDiaz commented 7 years ago

Is there any alternative to fix the install of qtlua without going backwards and doing: TORCH_LUA_VERSION=LUA51 ./install.sh instead of TORCH_LUA_VERSION=LUA52 ./install.sh ? Issue described here: https://github.com/torchnet/torchnet/issues/84 :

When doing make in first installation options in https://github.com/LuaDist/qtlua I get:

../configure --with-lualib-lib lualibconfigure: WARNING: you should use --build, --host, --target checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for lualib-g++... no checking for lualib-c++... no checking for lualib-gpp... no checking for lualib-aCC... no checking for lualib-CC... no checking for lualib-cxx... no checking for lualib-cc++... no checking for lualib-cl.exe... no checking for lualib-FCC... no checking for lualib-KCC... no checking for lualib-RCC... no checking for lualib-xlC_r... no checking for lualib-xlC... no checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... Invalid configuration `lualib': machine `lualib' not recognized configure: error: /bin/bash ../build/config.sub lualib failed natalia@tim-ThinkStation-P710:~/qtlua/bld$ ../configure --with-lualib-lib lualibconfigure: WARNING: you should use --build, --host, --target checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for lualib-g++... no checking for lualib-c++... no checking for lualib-gpp... no checking for lualib-aCC... no checking for lualib-CC... no checking for lualib-cxx... no checking for lualib-cc++... no checking for lualib-cl.exe... no checking for lualib-FCC... no checking for lualib-KCC... no checking for lualib-RCC... no checking for lualib-xlC_r... no checking for lualib-xlC... no checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... Invalid configuration `lualib': machine `lualib' not recognized configure: error: /bin/bash ../build/config.sub lualib failed natalia@tim-ThinkStation-P710:~/qtlua/bld$ ../configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking how to print strings... printf checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for qmake-qt4... /usr/bin/qmake-qt4 checking for moc-qt4... /usr/bin/moc-qt4 checking for uic-qt4... /usr/bin/uic-qt4 checking for rcc-qt4... no checking for rcc4... no checking for rcc... /usr/bin/rcc checking Qt install bin path... /usr/bin checking Qt spec to use for the host system... -spec linux-g++ checking whether we can build a simple Qt app... ok, looks like Qt 4 checking for the DEFINES to use with Qt... -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED checking for the CFLAGS to use with Qt... -D_REENTRANT checking for the CXXFLAGS to use with Qt... -D_REENTRANT checking for the INCPATH to use with Qt... -I /usr/share/qt4/mkspecs/linux-g++ -I /usr/include/qt4/QtUiTools -I /usr/include/qt4/QtCore -I /usr/include/qt4/QtGui -I /usr/include/qt4/QtXml -I /usr/include/qt4 checking for the LDFLAGS to use with Qt... -Wl,-O1 checking for the LIBS to use with Qt... -L/usr/lib/x86_64-linux-gnu -lQtXml -lQtGui -lQtCore -lQtUiTools -lpthread checking lua.h usability... no checking lua.h presence... no checking for lua.h... no configure: error: can not find lua.h; try --with-lua* arguments

Running ~/qtlua/bld$ ../configure gives:

... checking for qmake-qt4... /usr/bin/qmake-qt4 checking for moc-qt4... /usr/bin/moc-qt4 checking for uic-qt4... /usr/bin/uic-qt4 checking for rcc-qt4... no checking for rcc4... no checking for rcc... /usr/bin/rcc checking Qt install bin path... /usr/bin checking Qt spec to use for the host system... -spec linux-g++ checking whether we can build a simple Qt app... ok, looks like Qt 4 checking for the DEFINES to use with Qt... -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED checking for the CFLAGS to use with Qt... -D_REENTRANT checking for the CXXFLAGS to use with Qt... -D_REENTRANT checking for the INCPATH to use with Qt... -I /usr/share/qt4/mkspecs/linux-g++ -I /usr/include/qt4/QtUiTools -I /usr/include/qt4/QtCore -I /usr/include/qt4/QtGui -I /usr/include/qt4/QtXml -I /usr/include/qt4 checking for the LDFLAGS to use with Qt... -Wl,-O1 checking for the LIBS to use with Qt... -L/usr/lib/x86_64-linux-gnu -lQtXml -lQtGui -lQtCore -lQtUiTools -lpthread checking lua.h usability... no checking lua.h presence... no checking for lua.h... no configure: error: can not find lua.h; try --with-lua* arguments

When doing make in second installation options in https://github.com/LuaDist/qtlua I get:

[...][ 37%] Building CXX object CMakeFiles/qtlua.dir/src/QtLua/moc_qtluatablegridmodel.cxx.o [ 38%] Building CXX object CMakeFiles/qtlua.dir/src/moc_qtluaqtlib.cxx.o [ 39%] Linking CXX shared library libqtlua.so [ 39%] Built target qtlua Scanning dependencies of target global [ 40%] Building CXX object CMakeFiles/global.dir/examples/cpp/value/global.cc.o [ 41%] Linking CXX executable global libqtlua.so: undefined reference to `lua_tonumber' libqtlua.so: undefined reference to `luaL_loadbuffer' libqtlua.so: undefined reference to `lua_pcall' libqtlua.so: undefined reference to `lua_lessthan' libqtlua.so: undefined reference to `lua_call' libqtlua.so: undefined reference to `lua_equal' libqtlua.so: undefined reference to `lua_objlen' collect2: error: ld returned 1 exit status CMakeFiles/global.dir/build.make:100: recipe for target 'global' failed make[2]: *** [global] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/global.dir/all' failed make[1]: *** [CMakeFiles/global.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2

I have also tried all parameters indicated in: https://github.com/LuaDist/qtlua/blob/master/configure.ac

obtaining:

(...)
checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking build system type... Invalid configuration `lualib': machine `lualib' not recognized configure: error: /bin/bash ../build/config.sub lualib failed natalia@tim-ThinkStation-P710:~/qtlua/bld$ ../configure --with-lualib-lib lualib

Finally: luarocks install qtlua returns:

Installing https://raw.githubusercontent.com/torch/rocks/master/qtlua-scm-1.rockspec Cloning into 'qtlua'... remote: Counting objects: 169, done. remote: Compressing objects: 100% (163/163), done. remote: Total 169 (delta 11), reused 123 (delta 2), pack-reused 0 Receiving objects: 100% (169/169), 364.00 KiB | 591.00 KiB/s, done. Resolving deltas: 100% (11/11), done. Checking connectivity... done. cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUA=/home/natalia/torch/install/bin/lua -DLUA_BINDIR="/home/natalia/torch/install/bin" -DLUA_INCDIR="/home/natalia/torch/install/include" -DLUA_LIBDIR="/home/natalia/torch/install/lib" -DLUADIR="/home/natalia/torch/install/lib/luarocks/rocks/qtlua/scm-1/lua" -DLIBDIR="/home/natalia/torch/install/lib/luarocks/rocks/qtlua/scm-1/lib" -DCONFDIR="/home/natalia/torch/install/lib/luarocks/rocks/qtlua/scm-1/conf" && make -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found -- Found Qt4: /usr/bin/qmake (found suitable version "4.8.7", minimum required is "4.3.0") -- Lua: using information from luarocks -- Lua library guess (no info from luarocks): /home/natalia/torch/install/lib/liblua.so -- Looking for luaJIT_setmode in /home/natalia/torch/install/lib/liblua.so -- Looking for luaJIT_setmode in /home/natalia/torch/install/lib/liblua.so - not found -- Lua found /home/natalia/torch/install/bin/lua -- Found readline library -- Looking for rl_completion_matches -- Looking for rl_completion_matches - found -- Looking for include file fcntl.h -- Looking for include file fcntl.h - found -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for include file signal.h -- Looking for include file signal.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file errno.h -- Looking for include file errno.h - found -- Looking for include file sys/select.h -- Looking for include file sys/select.h - found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - found -- Looking for include file sys/types.h -- Looking for include file sys/types.h - found -- Looking for isatty -- Looking for isatty - found -- Looking for sigprocmask -- Looking for sigprocmask - found -- Looking for sigaction -- Looking for sigaction - found -- Looking for signal -- Looking for signal - found -- Looking for pthread_sigmask -- Looking for pthread_sigmask - not found -- Looking for XInitThreads -- Looking for XInitThreads - not found -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found -- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so -- Configuring done -- Generating done -- Build files have been written to: /tmp/luarocks_qtlua-scm-1-dY9RRt/qtlua/build [ 1%] Generating moc_qtluaengine.cxx [ 2%] Generating qtluaengine.moc Scanning dependencies of target libqtlua [ 3%] Building CXX object qtlua/CMakeFiles/libqtlua.dir/qtluautils.cpp.o /tmp/luarocks_qtlua-scm-1-dY9RRt/qtlua/qtlua/qtluautils.cpp: In function ‘const char* pushnexttemplate(lua_State*, const char*)’: /tmp/luarocks_qtlua-scm-1-dY9RRt/qtlua/qtlua/qtluautils.cpp:545:20: error: ‘LUA_PATHSEP’ was not declared in this scope while (*path == *LUA_PATHSEP) path++; /* skip separators */ ^ /tmp/luarocks_qtlua-scm-1-dY9RRt/qtlua/qtlua/qtluautils.cpp:547:21: error: ‘LUA_PATHSEP’ was not declared in this scope l = strchr(path, *LUA_PATHSEP); /* find next separator */ ^ qtlua/CMakeFiles/libqtlua.dir/build.make:72: recipe for target 'qtlua/CMakeFiles/libqtlua.dir/qtluautils.cpp.o' failed make[2]: *** [qtlua/CMakeFiles/libqtlua.dir/qtluautils.cpp.o] Error 1 CMakeFiles/Makefile2:85: recipe for target 'qtlua/CMakeFiles/libqtlua.dir/all' failed make[1]: *** [qtlua/CMakeFiles/libqtlua.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 Error: Build error: Failed building.

I am on Ubuntu 16 and my Lua version Lua 5.2.3