• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
rpi3 Buster Compile Error

Using a clean rp3 Buster install, the Manual's Installation guide for Debian Buster was used to install the apt sources and libmbed*.deb packages.  The library installation required apt --fix-broken install  to complete:

pi@raspberrypi:~ $ sudo apt-get install dialog
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libmbedtls12 : Depends: libmbedx509-0 (>= 2.14) but 2.6.0-1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
pi@raspberrypi:~ $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 87.0 kB of archives.
After this operation, 13.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 hlzmel/fsmg/raspbian/raspbian buster/main armhf libmbedx509-0 armhf 2.16.0-1 [87.0 kB]
Fetched 87.0 kB in 2s (50.0 kB/s)  
Reading changelogs... Done
(Reading database ... 152214 files and directories currently installed.)
Preparing to unpack .../libmbedx509-0_2.16.0-1_armhf.deb ...
Unpacking libmbedx509-0:armhf (2.16.0-1) over (2.6.0-1) ...
Setting up libmbedx509-0:armhf (2.16.0-1) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...

pi@raspberrypi:~ $ sudo apt-get install build-essential cmake git dialog libwiringx libwiringx-dev libpcap0.8-dev libmbedtls-dev liblua5.2-dev libluajit-5.1-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
build-essential is already the newest version (12.6).
cmake is already the newest version (3.13.4-1).
dialog is already the newest version (1.3-20190211-1).
git is already the newest version (1:2.20.1-2).
liblua5.2-dev is already the newest version (5.2.4-1.1).
libluajit-5.1-dev is already the newest version (2.1.0~beta3+dfsg-5.1).
libmbedtls-dev is already the newest version (2.16.0-1).
libpcap0.8-dev is already the newest version (1.8.1-6).
libwiringx is already the newest version (2.0-240-g4e620af).
libwiringx-dev is already the newest version (2.0-240-g4e620af).
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

pi@raspberrypi:~ $ git clone --depth 5 -b rewrite github.com/pilight/pilight.git
Cloning into 'pilight'...
warning: redirecting to github.com/pilight/pilight.git/
remote: Enumerating objects: 1157, done.
remote: Counting objects: 100% (1157/1157), done.
remote: Compressing objects: 100% (832/832), done.
remote: Total 1157 (delta 448), reused 690 (delta 318), pack-reused 0
Receiving objects: 100% (1157/1157), 2.57 MiB | 343.00 KiB/s, done.
Resolving deltas: 100% (448/448), done.
pi@raspberrypi:~ $ cd pilight/

The build fails on #include <luajit-2.0/lua.h> yet the library seems to be installed OK.  Any suggestions?
pi@raspberrypi:~/pilight $ sudo ./setup.sh

│ pilight configuration options                                                                  │
│ ┌────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │[*] WEBSERVER                  enable the built-in webserver                                │ │
│ │[*] WEBSERVER_HTTPS            enable webserver ssl protocol                                │ │
│ │[*] EVENTS                     enable the eventing functionality                            │ │
│ │[ ] ZWAVE                      enable Z-Wave support                                        │ │
│ │[ ] IR                         enable IR remotes support                                    │ │
│ │[*] PILIGHT_UNITTEST           build pilight unittests                                      │ │
│ │[*] PROTOCOL_ALECTO_WS1700     support for the Alecto WS1700 protocol                       │ │
│ │[*] PROTOCOL_ALECTO_WSD17      support for the Alecto WSD 17 protocol                       │ │
│ │[*] PROTOCOL_ALECTO_WX500      support for the Alecto WX500 protocol                        │ │
│ │[*] PROTOCOL_AURIOL            support for the Auriol weather station protocol              │ │
│ └────↓(+)────────────────────────────────────────────────────────────────────────────10%─────┘ │
│                                                                                                │
│           < Save and Install >      <Cancel and Install>      <      Abort       >             │

mkdir: cannot create directory ‘build’: File exists
-- Looking for libpcap - found (/usr/lib/arm-linux-gnueabihf/libpcap.so)
-- Looking for libwiringx - found (/usr/lib/libwiringx.so)
-- Looking for libmbedtls - found (/usr/lib/arm-linux-gnueabihf/libmbedtls.so)
-- Looking for libmbedcrypto - found (/usr/lib/arm-linux-gnueabihf/libmbedcrypto.so)
-- Looking for libmbedx509 - found (/usr/lib/arm-linux-gnueabihf/libmbedx509.so)
-- Looking for libluajit - found (/usr/lib/arm-linux-gnueabihf/libluajit-5.1.so)

Manually compiling and installing pilight will also clear all module folders:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/pilight/build
Scanning dependencies of target pilight
[  0%] Building C object CMakeFiles/pilight.dir/libs/avrdude/avrgpio.c.o
In file included from /home/pi/pilight/libs/avrdude/../pilight/config/settings.h:12,
                from /home/pi/pilight/libs/avrdude/avrgpio.c:37:
/home/pi/pilight/libs/avrdude/../pilight/config/../lua_c/lua.h:12:10: fatal error: luajit-2.0/lua.h: No such file or directory
#include <luajit-2.0/lua.h>
compilation terminated.
make[2]: *** [CMakeFiles/pilight.dir/build.make:110: CMakeFiles/pilight.dir/libs/avrdude/avrgpio.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:440: CMakeFiles/pilight.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
I don't know. It should work like this.
~ # dpkg --get-selections | grep lua
libluajit-5.1-2:armhf                           install
libluajit-5.1-common                            install
libluajit-5.1-dev:armhf                         install
luajit                                          install
Thanks, I have a close library match.  liblua5.2-dev:armhf and lua5.1 are additional.

root@raspberrypi:/home/pi/pilight# dpkg --get-selections | grep lua
liblua5.2-0:armhf                install
liblua5.2-dev:armhf                install
libluajit-5.1-2:armhf                install
libluajit-5.1-common                install
libluajit-5.1-dev:armhf                install
lua5.1                        install
luajit                        install
Thanks, issue resolved  Smile

Compilation completes when the #includes revision number within pilight/libs/pilight/lua_c/lua.h is changed from luajit-2.0 to luajit-2.1

#include <luajit-2.1/lua.h>
#include <luajit-2.1/lualib.h>
#include <luajit-2.1/lauxlib.h>
Good catch!
The include version number issue (luajit-2.0 vs luajit-2.1) is still broken on the staging branch. Are there any plans to get this fixed?
No, because that would imply me having to change my whole compilation procedure for just a cosmetic fix. If you are manually compiling you ought to know what you are doing. If you can implemented an autodetect feature, i'm very willing to implement it.
Maybe you could at least add a comment in the installation section on the website as probably every user of Buster wanting to build from source will stumble upon this. It looks like this can't be automatically resolved by giving libluajit-5.1-dev a specific version as there is only one available and that already has the changed library paths:

root@switchbox:/home/pi/pilight# apt policy libluajit-5.1-dev
 Installed: 2.1.0~beta3+dfsg-5.1
 Candidate: 2.1.0~beta3+dfsg-5.1
 Version table:
*** 2.1.0~beta3+dfsg-5.1 500
       500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
       100 /var/lib/dpkg/status

I'll try and look into something automated as it would be great to have also build from source work out of the box. Btw: I'm not sure if it would be an option to leave out the library path completely and just include the headers by filename. I have seen that as suggestion for other projects dealing with the same issue as well.
The manual already states:
Quote:We try to provide as many options as possible for you to keep up-to-date with the latest developments. Compiling C software requires some level of expertise, which we cannot and will not provide. This means that no support is given if any issues occur with manually compiling pilight.
And because it's not a high priority for me, i will leave it as is at the moment.

If some user can provide me with a proper fix, i will of course apply it.
Ran into this issue too on Rapbian Buster (Lite). Managed to work around it with:
sudo ln -s /usr/include/luajit-2.1 /usr/include/luajit-2.0

It's not a fix though. Leaving this here for people that need it.

Possibly Related Threads...
Thread Author Replies Views Last Post
  ERROR: The Broadcom 2835 GPIO 0 is not set to output mode stuckinger 10 1,672 05-07-2019, 09:11 PM
Last Post: curlymo
  v8.1.3 compile error without https fourty2 3 893 11-21-2018, 08:02 PM
Last Post: fourty2
  Assert error in v8.1.3-nightly-d2ee2d0d Ulrich.Arnold 4 920 10-24-2018, 09:28 PM
Last Post: curlymo
  How to compile pilight for your OpenWRT Router frenchie71 4 4,255 11-11-2017, 03:29 PM
Last Post: frenchie71
  [solved] Webgui 404-Error PT-Biker 2 1,302 11-11-2017, 09:49 AM
Last Post: PT-Biker
  Error installing pilight AMWN 2 1,904 11-02-2017, 10:09 PM
Last Post: AMWN
  Update Error latest Nightly Alex 13 5,087 09-11-2016, 02:51 PM
Last Post: Alex
  [split] pilight Error : pilight hangs in a loop Tommybear1979 5 2,515 07-01-2016, 08:27 AM
Last Post: Tommybear1979
  pilight Error : default_sa_restorer_v2 & CPU High Tommybear1979 5 3,024 06-30-2016, 07:36 AM
Last Post: pilino1234
Bug json get request not working, error in documentation Jan 1 1,893 03-25-2016, 04:12 PM
Last Post: Jan

Forum Jump:

Browsing: 1 Guest(s)