Conky: Unable to compile with BUILD_LUA

Created on 20 May 2016  路  21Comments  路  Source: brndnmtthws/conky

Hi

I'm trying to compile the latest build with BUILD_LUA_IMLIB2=ON, but I get 'Unable to find Lua 5.1.x' although it is installed.

dave@crux:~/conky/build$ cmake ../
CMake Error at cmake/ConkyPlatformChecks.cmake:263 (message):
  Unable to find Lua 5.1.x
Call Stack (most recent call first):
  CMakeLists.txt:37 (include)


-- Configuring incomplete, errors occurred!
See also "/home/dave/conky/build/CMakeFiles/CMakeOutput.log".
See also "/home/dave/conky/build/CMakeFiles/CMakeError.log".

dave@crux:~/conky/build$ dpkg-query -l '*lua*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                 Version                 Architecture            Description
+++-====================================-=======================-=======================-=============================================================================
ii  liblua5.1-0:amd64                    5.1.5-7.1               amd64                   Shared library for the Lua interpreter version 5.1
ii  liblua5.1-0-dev:amd64                5.1.5-7.1               amd64                   Development files for the Lua language version 5.1
un  liblua5.1-dev                        <none>                  <none>                  (no description available)
ii  liblua5.2-0:amd64                    5.2.3-1.1               amd64                   Shared library for the Lua interpreter version 5.2
ii  liblua5.2-dev:amd64                  5.2.3-1.1               amd64                   Development files for the Lua language version 5.2
ii  liblua50                             5.0.3-7                 amd64                   Main interpreter library for the Lua 5.0 programming language
ii  liblua50-dev                         5.0.3-7                 amd64                   Main interpreter library for Lua 5.0: static library and headers
ii  liblualib50                          5.0.3-7                 amd64                   Extension library for the Lua 5.0 programming language
ii  liblualib50-dev                      5.0.3-7                 amd64                   Extension library for Lua 5.0: static and headers
ii  libtolua++5.1-dev                    1.0.93-3                amd64                   extended tool to integrate C/C++ code with Lua (devel)
ii  libtolua-dev                         5.2.0-1                 amd64                   Tool to integrate C/C++ code with Lua - development files
un  lua                                  <none>                  <none>                  (no description available)
ii  lua5.1                               5.1.5-7.1               amd64                   Simple, extensible, embeddable programming language
ii  lua5.2                               5.2.3-1.1               amd64                   Simple, extensible, embeddable programming language
ii  lua50                                5.0.3-7                 amd64                   Small embeddable language with simple procedural syntax

dave@crux:~/conky/build$ locate "*/lua*.pc"
/usr/lib/pkgconfig/lua50.pc
/usr/lib/pkgconfig/lualib50.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua-5.1-c++.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua-5.1.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua5.1-c++.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua5.1.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua5.2.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua51-c++.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/lua51.pc


dave@crux:~/conky/build$ cmake --version
cmake version 3.0.2

dave@crux:~/conky/build$ cat /etc/debian_version 
8.4

dave@crux:~/conky/build$ uname -a
Linux crux 4.5.3 #1 SMP Sat May 7 10:44:05 NZST 2016 x86_64 GNU/Linux

All 21 comments

First check if you have a lua 5.1 interpreter run "lua5.1". Second install liblua5.1-dev

I'm having the same problem. Yes I have Lua 5.1 installed. I'm running out of ideas

Can confirm, same issue.

I've also tried to compile with lua support same error, anyone has a solution?

Which distro are we talking about - Please mention the distribution in use - each has it's own nuance - I am already using conky with lua 5.3 and tolua++ for 5.3 - on Arch Linux.

OP is on Linux crux ...

dive into the conky source folder - you need to find that location for lua5.1 - try and you will get an idea

    LDFLAGS="-llua5.1 -lm"

    LUA_CFLAGS="-I/usr/include/lua5.1"

    cmake \
        -D CMAKE_BUILD_TYPE=Release \
        -D CMAKE_C_FLAGS="${LUA_CFLAGS}" \
        -D CMAKE_CXX_FLAGS="${LUA_CFLAGS}" \
        -D CMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
        -D CMAKE_INSTALL_PREFIX=/usr \
        -D BUILD_WLAN=ON \
        -D BUILD_CURL=ON \
        -D BUILD_RSS=ON \
        -D BUILD_XDBE=ON \
        -D BUILD_XSHAPE=ON \
        -D BUILD_IMLIB2=ON \
        -D BUILD_ICONV=ON \
        -D BUILD_WEATHER_METAR=ON \
        -D BUILD_WEATHER_XOAP=ON \
        -D BUILD_LUA_CAIRO=ON \
        -D BUILD_LUA_IMLIB2=ON \
        -D BUILD_LUA_RSVG=ON \
        -D BUILD_NVIDIA=ON \
        .

    make install

I am using Debian stretch
bukva@abukva:~$ uname -a Linux abukva 4.8.0-2-amd64 #1 SMP Debian 4.8.15-2 (2017-01-04) x86_64 GNU/Linux

This issue also appears if you want to bind Cairo to Conky, so I'll comment another way to reproduce it here:

If I modify cmake/ConkyPlatformChecks.cmake adding:

# Check for Lua itself
if(WANT_TOLUA)
        # If we need tolua++, we must compile against Lua 5.1
#       pkg_search_module(LUA REQUIRED lua5.1 lua-5.1)
#       if(NOT LUA_VERSION VERSION_LESS 5.2.0)
#               message(FATAL_ERROR "Unable to find Lua 5.1.x")
##      endif(NOT LUA_VERSION VERSION_LESS 5.2.0)
#else(WANT_TOLUA)
        # Otherwise, use the most recent Lua version
        #pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua>=5.1)
        pkg_search_module(LUA REQUIRED lua5.3 lua-5.3 lua5.2 lua-5.2 lua>=5.1 lua51 lua5.1 lua-5.1)
endif(WANT_TOLUA)

No errors will be displayed except common dev warnings not regarding the modified file. Cmake will configure successfully, and make and make install will work without a problem. Also, Cairo will appear in Conky's bindings (conky -v).

However, using a Conky config file which requires Cairo will result in a segfault - core dumped. I have both Lua 5.1 and 5.3 installed, as well as tolua++. Using Arch Linux, too.

Everyone, please try again. I need to know if it is okay to close this. This might had been fixed already by commit eebc8c65 which contains lot of build fixes. It touched lua files too. Thanks.

I have the same problem (#627).

Don't cmake alone. See if this works.

cmake \
-DBUILD_LUA_CAIRO=ON \
-DBUILD_LUA_IMLIB2=ON \
-DBUILD_LUA_RSVG=ON \
-DBUILD_LUA_CAIRO=ON \
-DBUILD_LUA_CAIRO=ON \
-DBUILD_LUA_IMLIB2=ON \
-DBUILD_LUA_RSVG=ON \
-DBUILD_LUA_CAIRO=ON -DWANT_TOLUA=ON \
../ && make -j4

@lasers

Yes, that works, thank you.

I didn't realize I double-pasted the code above. You effing ran this...

cmake \
-DBUILD_LUA_CAIRO=ON
-DBUILD_LUA_CAIRO=ON \  <-- TWICE
-DBUILD_LUA_CAIRO=ON \  <-- THRICE
-DBUILD_LUA_CAIRO=ON \  <-- FOUR TIMES
-DBUILD_LUA_IMLIB2=ON \
-DBUILD_LUA_IMLIB2=ON \ <-- TWICE
-DBUILD_LUA_RSVG=ON \
-DBUILD_LUA_RSVG=ON \   <-- TWICE
-DWANT_TOLUA=ON \
../ && make -j4

No wonder why it's forcefully working now.

We can close this now after 2 years 3 months because this worked okay on my side, worked okay on your side too, and probably work okay on @su8's side too. Otherwise, I'm still closing this due to inactivity because it has been 1 year 3 months before my first comment here... and still nothing after two weeks.

Clearly I was putting the 'blind' into 'blind cut and paste'.

Bad news though: one does get the error message if one runs unadorned 'cmake', and/but tells the terminal GUI to build lua support. So isn't that still a bug?

@su8 can answer this better than me.

I encountered the error that is at issue in this thread. I did so just now, on Linux Mint 19.1 x64 Cinnamon, using today's version of the git repository, and with these cmake options

-DBUILD_LUA_CAIRO=ON
-DBUILD_LUA_IMLIB2=ON \
-DWANT_TOLUA=ON \

and with the lua5.1 package 5.1.5-8.1build2 and with liblua5.3-dev, which I discover that your 'installation' webpage now says one needs. I have this Linux kernel: 5.1.3-050103-generic.

@LinuxOnTheDesktop What error? I just tried this on LM19. Worked okay. Maybe you're missing build-essential and some -dev packages?

@lasers
Thanks for the reply and for doing the check.

    
CMakeError.log
CMakeOutput.log

The error message that I see is as follows.

-- Looking for clock_gettime
-- Looking for clock_gettime - found
CMake Error at cmake/ConkyPlatformChecks.cmake:333 (message):
  Unable to find Lua 5.1.x
Call Stack (most recent call first):
  CMakeLists.txt:36 (include)


-- Configuring incomplete, errors occurred!

The message goes on to direct me towards to two log files. I attach them.

    My install script checks for all these packages:

build-essential
cmake-curses-gui
g++
libaudclient-dev
libcairo2-dev
libcurl4-gnutls-dev
libcurl4-openssl-dev
libical-dev
libimlib2-dev
libircclient-dev
liblua5.1-dev
liblua5.3-dev
libmicrohttpd-dev
libmysqlclient-dev
libncurses5-dev
libpulse-dev
librsvg2-dev
libsystemd-dev
libtolua++5.1-dev
libtolua-dev
libx11-dev
libxdamage-dev
libxext-dev
libxft-dev
libxinerama-dev
libxml2-dev
libxmmsclient-dev
ncurses-dev
tolua++

aptitude search ~ilua returns this for me.

i A liblua5.2-0           - Shared library for the Lua interpreter version 5.2                    
i A liblua5.3-0           - Shared library for the Lua interpreter version 5.3                    
i   liblua5.3-dev         - Development files for the Lua language version 5.3                    
i A libluajit-5.1-2       - Just in time compiler for Lua - library version                       
i A libluajit-5.1-common  - Just in time compiler for Lua - common files

The command returns this for me:

i   liblua5.1-0                                                             - Shared library for the Lua interpreter version 5.1                               
i   liblua5.1-0-dev                                                         - Development files for the Lua language version 5.1                               
i   liblua5.2-0                                                             - Shared library for the Lua interpreter version 5.2                               
i A liblua5.2-dev                                                           - Development files for the Lua language version 5.2                               
i   liblua5.3-0                                                             - Shared library for the Lua interpreter version 5.3                               
i   liblua5.3-dev                                                           - Development files for the Lua language version 5.3                               
i A libluajit-5.1-2                                                         - Just in time compiler for Lua - library version                                  
i A libluajit-5.1-common                                                    - Just in time compiler for Lua - common files                                     
i   libtolua++5.1-dev                                                       - Extended tool to integrate C/C++ code with Lua                                   
i   libtolua-dev                                                            - Tool to integrate C/C++ code with Lua - development files                        
i A lua-bitop                                                               - fast bit manipulation library for the Lua language                               
i   lua-check                                                               - static analyzer and a linter for the Lua language                                
i A lua-expat                                                               - libexpat bindings for the Lua language                                           
i A lua-filesystem                                                          - luafilesystem library for the Lua language                                       
i A lua-json                                                                - JSON decoder/encoder for Lua                                                     
i A lua-lpeg                                                                - LPeg library for the Lua language                                                
i A lua-socket                                                              - TCP/UDP socket library for the Lua language                                      
i   lua5.1                                                                  - Simple, extensible, embeddable programming language    

I couldn't find line Unable to find Lua in the source code. I think you may not be on latest master as bb8723dd361d15be0077ab9270292b96572415e6 removes that line and others 4 months ago.

git rev-parse --short HEAD should return 2bfef11 (last commit).

Thanks, lasers. My mistake. I was indeed running an earlier branch. I can now build Conky (although I sill have problem #821 with the latest master version).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bunder2015 picture bunder2015  路  4Comments

txtsd picture txtsd  路  4Comments

leahneukirchen picture leahneukirchen  路  3Comments

zero77 picture zero77  路  3Comments

ghost picture ghost  路  4Comments