Compile domoticz on Raspberry PI-3 memory problem

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Compile domoticz on Raspberry PI-3 memory problem

Post by waaren »

Because the precompiled Beta versions still fail on my system (Debian stretch, OpenSSL 1.1.0, Python 3.5.3) I compile from source on my backup / development PI-3 using:

Code: Select all

git clone https://github.com/domoticz/domoticz.git dev-domoticz
cd dev-domoticz
#
# Update to latest
#
git pull

#
# -DUSE_OPENSSL_STATIC="NO" because of problem with Evohome API
#
cmake -DUSE_OPENSSL_STATIC="NO" -DCMAKE_BUILD_TYPE=Beta CMakeLists.txt  

#
# Twice because of strange version number after first time
#
cmake -DUSE_OPENSSL_STATIC="NO" -DCMAKE_BUILD_TYPE=Beta CMakeLists.txt  

#
# to minimize amount of memory for GPU
#
raspi-config            
shutdown -r

#
# Free up memory as much as possible
#
fail2ban-client quit

#
# setup zram
#
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
echo 536870912 >/sys/devices/virtual/block/zram0/mem_limit
echo 1073741824 >/sys/devices/virtual/block/zram0/disksize
mkswap /dev/zram0
swapon -p 0 /dev/zram0
sysctl vm.swappiness=80

#
# attempt one
#
cd dev-domoticz
make

#
# attempt two because first one fails at the link step (use one CPU)
#
rm domoticz  // sometimes file exist with size 0
make -j1
(of course I did the preparation steps as described in the wiki)
This works and give me a working executable with working Python plugins and working Evohome. Probably because of the static linked libraries the size of the executable is about twice the size of the precompiled version.
One thing that does not work, is to compile with the debug option and that's one of the reasons I am very much interested in better ways to compile with this limited amount of memory.
Hope other forum members with same setup can share how they compile.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest