Skip to contentSkip to conversation

Cross compilation - Could not find lua libs

DISCUSSION Jean-Fabien Arnaud 3 participants 3 messages Jun 8, 2016 – Jun 16, 2016

lore
Share & tools
lore
#0 lore raw

Hello
I would like to compile https://github.com/sbernard31/lualwm2m with a poky toolchain, but it can not find lua library and i do not know why. Lua 5.1 is installed, and I have no problem to compile with the « default » gcc.

$:~/build_arm$ cmake -DCMAKE_C_COMPILER=/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc ../lualwm2m/
-- The C compiler identification is GNU 4.8.2
-- Check for working C compiler: /opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: /opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find Lua51 (missing: LUA_LIBRARIES) (found version "5.1.5")
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindLua51.cmake:76 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:3 (find_package)
$:~/build_arm$ cmake ../lualwm2m/
-- The C compiler identification is GNU 4.8.4
-- 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
-- Found Lua51: /usr/lib/x86_64-linux-gnu/liblua5.1.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.1.5")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jf/build_arm

I hope i am publishing on the good ML, if anybody can tell me what am I doing wrong ?

Thank you
Jean Fabien

#1 lore raw

Hello,

in my experience it was also necessary to specify things like CMAKE_FIND_ROOT_PATH, otherwise cmake didn't find libraries in the poky SDK sysroot (also see cmake cross-compiling documentation). Here's what I've been using for cross-compiling with a poky SDK installed to /opt/poky/<version>:

source /opt/poky/<version>/environment-setup-*

cmake <srcdir> \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_VERSION=1 \
-DCMAKE_FIND_ROOT_PATH=/opt/poky/<version>/sysroots/<target> \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY

Another important detail is that the poky SDK must include all the *-dev packages needed.

Regards,

Daniel

#2 lore raw
In reply to Jean-Fabien Arnaud
Quoted 7 lines · Jean-Fabien Arnaud

Hello

I would like to compile https://github.com/sbernard31/lualwm2m with a poky toolchain, but it can not find lua library and i do not know why.

Lua 5.1 is installed, and I have no problem to compile with the « default » gcc.

lua should also be added to your SDK and Lua is in another layer in meta-openembedded. So add that layer to your project
as well as to one of images and then do -cpopulate_sdk <image> this should hopefully add needed lua dev libs and headers
to your SDK.

Quoted 78 lines


$:~/build_arm$ cmake
-DCMAKE_C_COMPILER=/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
../lualwm2m/

-- The C compiler identification is GNU 4.8.2

-- Check for working C compiler:
/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc

-- Check for working C compiler:
/opt/poky/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):

Could NOT find Lua51 (missing: LUA_LIBRARIES) (found version "5.1.5")

Call Stack (most recent call first):

/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315
(_FPHSA_FAILURE_MESSAGE)

/usr/share/cmake-2.8/Modules/FindLua51.cmake:76
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)

CMakeLists.txt:3 (find_package)

$:~/build_arm$ cmake ../lualwm2m/

-- The C compiler identification is GNU 4.8.4

-- 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

-- Found Lua51:
/usr/lib/x86_64-linux-gnu/liblua5.1.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "5.1.5")

-- Configuring done

-- Generating done

-- Build files have been written to: /home/jf/build_arm

I hope i am publishing on the good ML, if anybody can tell me what am I doing wrong ?

Thank you

Jean Fabien

--
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky