Kodi Community Forum
v19 Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
+---- Thread: v19 Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. (/showthread.php?tid=351221)

Pages: 1 2 3 4 5 6


Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - kent_b - 2020-01-24

There has been some interest in a guide for building Kodi 19 natively on the Raspberry Pi 4. Since I'm going through a fresh build, I will go ahead and copy in the commands with a few notes as the process goes along.

DISCLAIMER: This is a rough guide to building *alpha* software. It works at the time/date of this post. There is no guarantee these directions will be accurate in the future. There is also no guarantee this alpha software will function reliably right now. Even things that work today might break again along the way before the entire package ready for release. It's alpha software - and this is a rough guide offered by a noob to getting it built. If you need/want a reliable media player, stick with Leia for now.

Real Documentation: Team Kodi maintains reasonably thorough documentation in each branch's repo to build on several platforms. Unfortunately the Raspbian instructions don't cover building on the pi. For that, we are instead pointed to directions for building on Ubutu and for building on general Linux. Both documents are good to look at. The Ubutu docs primarily cover needed dependencies while the Linux doc also covers the meat of building Kodi. My notes here are mostly a quickie cheat sheet of commands from those docs. 

Build environment: We are assuming the build will be done *on* a Raspberry Pi 4+ running Raspbian Buster (with Kodi built on X11/gles). These instructions may or may not be relevant to other environments. To prepare, first noobs is used to install Raspbian (I'm doing a setup with the desktop). Obviously, Raspbian needs to be updated (sudo apt-get update && sudo apt-get full-upgrade). Then build tools are installed (sudo apt-get install cmake cmake-doc ninja-build). The system should be ready to start installing dependencies and build Kodi.

Most of the dependencies listed on the Ubutu page are also available on Raspbian/Debian - but some of them fail. I install these available packages first ... for no real good reason.
Code:
sudo apt-get install debhelper autoconf automake autopoint gettext autotools-dev cmake curl default-jre doxygen gawk gcc gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libshairplay-dev libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev libtool libudev-dev libva-dev libvdpau-dev libvorbis-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev lsb-release python3-dev python3-pil rapidjson-dev swig  unzip uuid-dev yasm zip zlib1g-dev

Then separately install some additional dependencies that either are not listed on the Ubutu page or have a different package name in Raspbian/Ubutu.
Code:
sudo apt-get install libmariadb-dev ccache clang-format liblirc-dev libsndio-dev libcap-dev libcec-dev libavahi-core-dev libunistring-dev

Now things should be set to prepare the directories and build. The linux directions clone Kodi's source directory right into the pi user home directory. I don't like that, so first create a src directory to hold everything (this is where the documentation builds binary addons later anyhow, so it works out well).

Create the source directory and clone the master branch into it.
Code:
mkdir src
cd src
git clone https://github.com/xbmc/xbmc kodi
Then create a build directory and use cmake to configure the build for X11/gles.  One thing to note is that this config sets flags to internally pre-compile two dependencies: FMT and FLATBUFFERS.
Code:
mkdir kodi-build
cd kodi-build
cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DX11_RENDER_SYSTEM=gles -DENABLE_INTERNAL_FMT=ON -DENABLE_INTERNAL_FLATBUFFERS=ON
As long as all the dependencies have installed correctly, the configuration should complete reasonably quickly with no errors. If there are errors, check to see if there were problems installing any of the dependencies listed above. If all the dependencies installed without error, maybe something has changed and additional dependencies need to be resolved.

Once the configuration is complete, now it's time to build.
Code:
cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)
This takes around two hours (give or take) and spits out a lot of text. At the end, there should be an executable binary called xodi-x11 in the build directory. If not, look at the text output for errors.

If so, try to run it.
Code:
./kodi-x11
Assuming that command launches Kodi, go ahead and exit, then install Kodi properly.
Code:
sudo make install
With that, it should be possible to launch Kodi from the command line by typing "kodi" and the program should appear along with VLC on the desktop's application launcher.

Binary Addons: Kodi initially compiles without the extra binary addons - which need to be built separately if any are desired. The Linux build documentation has a good section on building them. One thing to bear in mind is that some will require additional dependencies (either libraries or other Kodi addons) and not all are compatible with the Raspberry Pi. Check the addon's platforms.txt file if you aren't sure.


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - User 450372 - 2020-04-25

Hello, I wanted to build Kodi according to your manual, I get an errorCMake Error at cmake/modules/FindSpdlog.cmake:59 (find_package):
Code:
  Could not find a configuration file for package "spdlog" that is compatible
  with requested version "1.5.0".

  The following configuration files were considered but not accepted:

    /usr/lib/arm-linux-gnueabihf/cmake/spdlog/spdlogConfig.cmake, version: 1.3.1

Call Stack (most recent call first):
  cmake/scripts/common/Macros.cmake:366 (find_package)
  cmake/scripts/common/Macros.cmake:380 (find_package_with_ver)
  CMakeLists.txt:173 (core_require_dep)
I understand that it requires a new version of libspdlog, but I don’t understand how to install it, help, thanks


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - asavah - 2020-04-25

Add -DENABLE_INTERNAL_SPDLOG=ON to your cmake line.


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - User 450372 - 2020-04-25

(2020-04-25, 00:47)asavah Wrote: Add -DENABLE_INTERNAL_SPDLOG=ON to your cmake line.

Yes, it worked, thanks, but it happened 92%:
Code:
/usr/bin/ccache /usr/bin/ranlib videorenderers.a
make[2]: Leaving directory '/home/pi/kodi-src/kodi-build'
[ 92%] Built target videorenderers
make[1]: Leaving directory '/home/pi/kodi-src/kodi-build'
make: *** [Makefile:141: all] Error 2
Does anyone know what this is?


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - User 450372 - 2020-04-25

UPD: when I started again with sudo rights
Code:
/usr/bin/ccache /usr/bin/ranlib linuxsupport.a
make[2]: Leaving directory '/home/pi/kodi-src/kodi-build'
[ 91%] Built target linuxsupport
make[1]: Leaving directory '/home/pi/kodi-src/kodi-build'
make: *** [Makefile:141: all] Error 2



RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - asavah - 2020-04-25

You need to provide a much larger portion of the build output. To avoid cluttering the forum with crap use a pastebin-like site.
Due to the build being parallel the actual error happened much earlier.

Edit: no need to use sudo for building. it's only needed for install step.


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - User 450372 - 2020-04-25

(2020-04-25, 16:46)asavah Wrote: You need to provide a much larger portion of the build output. To avoid cluttering the forum with crap use a pastebin-like site.
Due to the build being parallel the actual error happened much earlier.

Edit: no need to use sudo for building. it's only needed for install step.

What specific logfile do I need to provide?


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - asavah - 2020-04-25

Not a log but the output of cmake --build command containing the actual error.


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - User 450372 - 2020-04-25

(2020-04-25, 17:05)asavah Wrote: Not a log but the output of cmake --build command containing the actual error.

https://paste.kodi.tv/ipalofaruh.kodi
This is the output of re-build.
What do I need to delete to start the process anew, and how is output to a file?


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - asavah - 2020-04-25

That's enough
the actual error is
Code:
cd /home/pi/kodi-src/kodi-build/build/windowing/X11 && /usr/bin/ccache /usr/bin/c++ -DHAS_NEON -I/home/pi/kodi-src/kodi -I/home/pi/kodi-src/kodi/lib -I/home/pi/kodi-src/kodi/xbmc -I/home/pi/kodi-src/kodi/xbmc/platform/linux -I/home/pi/kodi-src/kodi/xbmc/cores/VideoPlayer -I/home/pi/kodi-src/kodi-build/build -I/home/pi/kodi-src/kodi-build/build/include -I/home/pi/kodi-src/kodi/xbmc/platform/posix -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/python3.7 -I/usr/include/samba-4.0 -I/usr/include/libxml2 -I/usr/include/arm-linux-gnueabihf -I/home/pi/kodi-src/kodi-build/build/cores/RetroPlayer/messages -I/usr/include/freetype2 -I/usr/include/fribidi -I/home/pi/kodi-src/kodi-build/build/libdvd/include -I/usr/include/lzo -I/usr/include/libdrm -DPLATFORM_SETTINGS_FILE=x11.xml -Wall -O3 -DNDEBUG -s -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE -DHAVE_LINUX_MEMFD=1 -DHAVE_LINUX_DMA_BUF=1 -DHAVE_MKOSTEMP=1 -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -DHAS_POSIX_NETWORK -DHAS_LINUX_NETWORK -DHAS_BUILTIN_SYNC_ADD_AND_FETCH=1 -DHAS_BUILTIN_SYNC_SUB_AND_FETCH=1 -DHAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP=1 -DHAVE_INOTIFY=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_INTTYPES_H=1 -DHAS_ALSA=1 -DHAS_AVAHI=1 -DHAS_ZEROCONF=1 -DHAVE_LIBBLURAY=1 -DHAVE_LIBBLURAY_BDJ=1 -DHAVE_LIBCEC=1 -DHAS_DBUS=1 -DHAVE_LCMS2=1 -DHAS_LIRC=1 -DHAS_WEB_SERVER=1 -DHAS_WEB_INTERFACE=1 -DHAS_FILESYSTEM_NFS=1 -DHAS_AIRPLAY=1 -DHAS_PULSEAUDIO=1 -DHAS_PYTHON=1 -DHAS_FILESYSTEM_SMB=1 -DHAS_SNDIO=1 -DHAVE_LIBUDEV=1 -DHAVE_LIBXSLT=1 -DHAVE_LIBVA=1 -DFFMPEG_VER_SHA=\"4.2.2-Matrix-Alpha1\" -DUSE_STATIC_FFMPEG=1 -I/usr/include/fribidi -DSPDLOG_FMT_EXTERNAL -DSPDLOG_DEBUG_ON -DSPDLOG_NO_ATOMIC_LEVELS -DSPDLOG_ENABLE_PATTERN_PADDING -DHAS_EGL=1 -DHAVE_X11=1 -DHAVE_LIBXRANDR=1 -DHAS_GLES=3 -DHAS_MARIADB=1 -DHAS_UPNP=1 -DHAS_DVD_DRIVE -DHAS_CDDA_RIPPER -DHAS_AIRTUNES=1 -DBIN_INSTALL_PATH=\"/usr/local/lib/kodi\" -DINSTALL_PATH=\"/usr/local/share/kodi\" -std=c++14 -o CMakeFiles/windowing_X11.dir/XRandR.cpp.o -c /home/pi/kodi-src/kodi/xbmc/windowing/X11/XRandR.cpp In file included from /home/pi/kodi-src/kodi/xbmc/windowing/X11/GLContextEGL.cpp:18: /home/pi/kodi-src/kodi/xbmc/windowing/X11/GLContextEGL.h:16:10: fatal error: EGL/eglextchromium.h: No such file or directory #include <EGL/eglextchromium.h>

it's a missing include file.
A package is missing in @kent_b 's how to ...
Code:
sudo apt install libegl1-mesa-dev



RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - mmhere - 2020-06-15

This was weird.  I have some single letter environment variables defined that act as shortcuts to various network paths.

One of these, M={a_network_path} caused the ffmpeg build step to fail.  It complained that it couldn't find the network path stored in M.

To get the build completed, (this was during the `cmake --build . -- VERBOSE=1 -j4` step), I first did:

unset M

then rebuilt.

It is continuing to build now so we'll see what happens.

Weird that the build assumes certain vars like that, and doesn't unset then set them for its own purposes.

Perhaps I should go read:  https://github.com/xbmc/xbmc/blob/master/docs/README.Linux.md
(mentioned above)

---

To clarify, these network paths are merely shortcuts to help me navigate my local mounts during normal daily work.  They are completely unrelated to anything having to do with building Kodi 19 on Buster on an RPi4 (8GB model).  They just bled into the build environment from my everyday environment.  I could have neutered my normal shell ~/.*rc files that set these, but did not want to do that.  I just unset the var that I saw causing the build to seek an irrelevant network path.  (None of those network paths are mounted nor necessary on this RPi4 for purposes of this build.)


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - asavah - 2020-06-15

(2020-06-15, 01:53)mmhere Wrote: Weird that the build assumes certain vars like that, and doesn't unset then set them for its own purposes.
This M var comes from ffmpeg's makefiles, not Kodi's, file a bug against ffmpeg if you care so much.


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - noggin - 2020-06-22

An update from a Pi 4B user running Raspberry Pi OS

I also had to install libdrm-dev and libgtest-dev to get the CMAKE configuration process to complete.

(I had started with a Lite build and then upgraded to the Desktop in case that's significant)


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - wsnipex - 2020-06-22

gtest is optional, use -DENABLE_TESTING=OFF to disable


RE: Notes on compiling v19 alpha on the Raspberry Pi 4+ and Raspbian Buster. - noggin - 2020-06-22

(2020-06-22, 13:49)wsnipex Wrote: gtest is optional, use -DENABLE_TESTING=OFF to disable

Yep - I guess because that flag isn't in the example in the first post I got round it by installing gtest rather than by disabling it in the cmake config.