Kodi Community Forum

Full Version: Compiling Kodi fo rRaspberry PI 2 and 3 B+
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Thanks for taking the time to read this thread.

I have had zero issues with insataling KODI on raspberry pi using raspbian, openELEC and so forth. But these installs do not support the ability to minimize KODI. For a project I am working, yes I am new to compiling and I a bit stuck. I am using Ubuntu 14.04 LTS 64BIT and I am following the instructions in the readme. The goal is to add x11 support which I believe will add the minimize functionality. My build directory is under the user home directory call carproject (~/carproject). Most of my issues up to the now have been fixed by adding sudo to the front of the command. The problem is when I run the make command it finishes with two error codes, 1 and 2. presumably the 2 is caused by the 1. Trouble shooting these errors is a bit over my head as I am new to compiling. Below I have the instructions I am following from the XBMC README file and the output of the make command. These are the last lines where the error messages occur. Any help in resolving this issue is greatly appreciated.

Thank you for your time.

Paul
Code:
-----------------------------------------------------------------------------
2. Building Kodi for the Raspberry Pi
-----------------------------------------------------------------------------
The following steps were tested with Ubuntu 14.04 x64. (Note that building on
a 32 bit machine requires slightly different setting).
The following commands build for newer Rapberry Pi 2 generation. In order to
build for the first Raspberry Pi, the commands have to be adapted to use
`--with-platform=raspberry-pi` instead of `--with-platform=raspberry-pi2`.

    $ sudo apt-get install git autoconf curl g++ zlib1g-dev libcurl4-openssl-dev gawk gperf libtool autopoint swig default-jre

    $ sudo git clone https://github.com/raspberrypi/tools

    $ sudo cp -r tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64 /opt

    $ sudo git clone https://github.com/raspberrypi/firmware

    $ sudo mkdir -p /opt/bcm-rootfs/opt

    $ sudo cp -r firmware/opt/vc /opt/bcm-rootfs/opt

    $ sudo mkdir -p /opt/xbmc-bcm

    $ sudo chmod 777 /opt/xbmc-bcm

    $ sudo git clone https://github.com/xbmc/xbmc

    $ cd xbmc/tools/depends

    $ sudo ./bootstrap

    $ PATH="$PATH:/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin" \
       sudo ./configure --host=arm-linux-gnueabihf \

--prefix=/opt/xbmc-bcm/xbmc-dbg \
--with-toolchain=/usr/local/bcm-gcc/arm-bcm2708hardfp-linux-gnueabi/sysroot \
--with-firmware=/opt/bcm-rootfs \
--with-platform=raspberry-pi2 \
--build=i686-linux

$ sudo make <-- this is as far as I get.
    $ cd ../..

    CONFIG_EXTRA="--with-platform=raspberry-pi2 \
       --enable-libcec --enable-player=omxplayer \
       --enable-x11 --disable-xrandr --disable-openmax \
       --disable-optical-drive --disable-dvdcss --disable-joystick \
       --disable-crystalhd --disable-vtbdecoder --disable-vaapi \
       --disable-vdpau --enable-alsa" \
       sudo make -C tools/depends/target/xbmc
   
    $ sudo make
    $ sudo make install
 
Code:
make[3]: Entering directory `/home/homemythtv/carproject/xbmc/tools/depends/native/JsonSchemaBuilder/i686-linux-native'
/usr/bin/g++ -DPACKAGE_NAME=\"JsonSchemaBuilder\" -DPACKAGE_TARNAME=\"jsonschemabuilder\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"JsonSchemaBuilder\ 1.0\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jsonschemabuilder\" -DVERSION=\"1.0\" -I.   -I/opt/xbmc-bcm/xbmc-dbg/i686-linux-gnu-native/include  -O2 -std=c++11 -I/opt/xbmc-bcm/xbmc-dbg/i686-linux-gnu-native/include  -MT JsonSchemaBuilder.o -MD -MP -MF .deps/JsonSchemaBuilder.Tpo -c -o JsonSchemaBuilder.o JsonSchemaBuilder.cpp
JsonSchemaBuilder.cpp: In function âvoid print_version(std::ifstream&, std::ofstream&)â:
JsonSchemaBuilder.cpp:33:82: error: no matching function for call to âregex_replace(std::string&, std::regex, const char [1])â
     out << regex_replace(line, regex("(\\s+)?JSONRPC_VERSION\\s+|(\\s+)?#.*"), "");
                                                                                  ^
JsonSchemaBuilder.cpp:33:82: note: candidates are:
In file included from /usr/include/c++/4.8/regex:62:0,
                 from JsonSchemaBuilder.cpp:25:
/usr/include/c++/4.8/bits/regex.h:2162:5: note: template<class _Out_iter, class _Bi_iter, class _Rx_traits, class _Ch_type> _Out_iter std::regex_replace(_Out_iter, _Bi_iter, _Bi_iter, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type)
     regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
     ^
/usr/include/c++/4.8/bits/regex.h:2162:5: note:   template argument deduction/substitution failed:
JsonSchemaBuilder.cpp:33:82: note:   deduced conflicting types for parameter â_Bi_iterâ (âstd::basic_regex<char>â and âconst char*â)
     out << regex_replace(line, regex("(\\s+)?JSONRPC_VERSION\\s+|(\\s+)?#.*"), "");
                                                                                  ^
In file included from /usr/include/c++/4.8/regex:62:0,
                 from JsonSchemaBuilder.cpp:25:
/usr/include/c++/4.8/bits/regex.h:2182:5: note: template<class _Rx_traits, class _Ch_type> std::basic_string<_Ch_type> std::regex_replace(const std::basic_string<_Ch_type>&, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type)
     regex_replace(const basic_string<_Ch_type>& __s,
     ^
/usr/include/c++/4.8/bits/regex.h:2182:5: note:   template argument deduction/substitution failed:
JsonSchemaBuilder.cpp:33:82: note:   mismatched types âconst std::basic_string<_Ch_type>â and âconst char [1]â
     out << regex_replace(line, regex("(\\s+)?JSONRPC_VERSION\\s+|(\\s+)?#.*"), "");
                                                                                  ^
make[3]: *** [JsonSchemaBuilder.o] Error 1
make[3]: Leaving directory `/home/homemythtv/carproject/xbmc/tools/depends/native/JsonSchemaBuilder/i686-linux-native'
make[2]: *** [i686-linux-native/JsonSchemaBuilder] Error 2
make[2]: Leaving directory `/home/homemythtv/carproject/xbmc/tools/depends/native/JsonSchemaBuilder'
make[1]: *** [JsonSchemaBuilder] Error 2
make[1]: Leaving directory `/home/homemythtv/carproject/xbmc/tools/depends/native'
make: *** [native/.installed-i686-linux-native] Error 2
1) Use pastebin-like site to post your logs and large outputs to avoid filling forum db with unneeded cruft.
2) Building kodi for rpi x11 is possible, it was done, but while it will add the posibility to minimize it will kill hardware video decoding, making kodi unusable for higher resolution video,
you certainly won't be able to play fullhd.
3) Use a newer ubuntu (try 16.04), current Leia master needs newer gcc (because of lack of proper <regex> implementation in gcc < 4.9 , ubuntu 14.04 has 4.8.2)
Thanks for the reply asavah.

I will try this on 16.04. in the future I will post logs using a paste bin, haven't had a need to use one before but it makes complete sense. Mainly I will be using this build of KODI to play audio.

Again thank you for your time.

Paul
update

I tried my build with 16.04 and I am still getting errors.

Log and output information

Thank you for your time.

Paul
I'm getting closer but still not getting the build to complete. I even built a new install of 16.04 LTS desktop.

I fond this error in the config.log but my searches to correct did not provide a solution.

Code:
g++: error: unrecognized command line option '-V'

This link is to paste Ubuntu

last portion of Make output and config.log

https://paste.ubuntu.com/p/cFbr3x5Bc4/


Thanks helping.

Paul
(2018-06-22, 00:04)proy2018 Wrote: [ -> ]g++: error: unrecognized command line option '-V'
That's not the real error, the real error is:
Code:

configure:6119: /usr/bin/gcc -c -fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -pipe -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations -isystem/opt/bcm-rootfs/opt/vc/include -isystem/opt/bcm-rootfs/opt/vc/include/interface/vcos/pthreads -isystem/opt/bcm-rootfs/opt/vc/include/interface/vmcs_host/linux -Og -g -D_DEBUG conftest.c >&5 gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead gcc: error: unrecognized argument in option '-mabi=aapcs-linux' gcc: note: valid arguments to '-mabi=' are: ms sysv gcc: error: unrecognized command line option '-mfloat-abi=hard' gcc: error: unrecognized command line option '-mfpu=neon-vfpv4' gcc: error: unrecognized command line option '-mvectorize-with-neon-quad'

Which comes from your failure to read the guide on github.

From your log:

Code:
./configure blah --with-toolchain=/usr/local/bcm-gcc/arm-bcm2708hardfp-linux-gnueabi/sysroot blah

Which is obvously wrong, you are pointing configure to the sysroot , not to the toolchain.

Crosscompiling ain't easy and you should have some knowledge of native compiling and troubleshooting before you start.

Which guide are you following? I see you are mixing a few of them without understanding wtf you are doing.

Try following this, verbatim.
https://github.com/xbmc/xbmc/blob/master...aspberrypi

And even the guide on github is outdated, eg ubuntu 14.04 is of no use now.
okay, please don't be rude, I am trying to learn and at least I am asking for guidance and posting my progress, even if it is a small steps. I was able to correct two of the errors during the build process. I am not asking for anyone to do this for me. I am asking for help and to be pointed in the right direction. I have done multiple Google searches that have pointed me in many different directions, with no success. That was before I decided to post. Everyone is a novice when they start out. 

I was following the read me from the github clone on my system. The file called is located in the docs folder and is called README.raspberrypi. This looked like a good place to start. I was following section 2 step by step. For reference here is the document. https://paste.ubuntu.com/p/dvvWf6hydf/

After my last post I was able to find out that the error message wasn't the true error,  but had not been able to look at log file since then.

Thank you for bring the github guide to my attention, I'll be sure to read it. None of my searches for compiling Kodi mentioned this document.

I will follow the instruction on the link you posted and post an update. Although it does look just like the one I was following. I do thank you for taking the time to help me as I know that help is voluntary. Please remember not everyone is brilliant their first go.

thank you.

Paul
The document you linked is exactly the same as the guide on github ... yet you are NOT following it, the commands you posted in your first post
are not present there, and some of them make no sense.
The configure command is also different.

> Please remember not everyone is brilliant their first go.
> okay, please don't be rude
I don't see where I was rude, however to avoid offending you I will simply refrain from providing further pointers and/or help to you.
Sorry if I offended you by ask you to not be rude, but that is how your post read.  Emotion and inflection is lost in text, my apologies.

With the exception of adding sudo and then later just running everything as sudo su. I only changed the following --disable-x11 to --enable-x11. But I never got that far in the script.

New build 16.04 desktop.

sudo update and then upgrade followed by a reboot.

Created a project directory in the home folder called myproject then CD myproject

Started opened the document in notepad++ then following the document using cut and paste to avoid mistakes. in notepad++ I "checked off" each line after it was run.

I will remove the myproject directory and subdirectories and start again.

Maybe the sun will shine on me today.

Thanks for you help.

Paul
Followed the instruction verbatim and still am getting errors.

https://paste.ubuntu.com/p/Zb2VJTMwHx/

Code:
| #include <ac_nonexistent.h>
configure:5149: result: /home/builder/myproject2/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -E
configure:5169: /home/builder/myproject2/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -E  conftest.c
configure:5169: $? = 0
configure:5183: /home/builder/myproject2/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>

I have looked up ac_nonexistent.h and found in a forum post that this is a check to make sure the config script is correct.

https://unix.stackexchange.com/questions...existent-h

Yes, I am aware they are compiling a different program but the error message is the same.
I've tested building kodi for rpi by following the readme.
It almost works, I've submitted a PR to kodi git with 2 small changes needed to succesfully build Kodi on Ubuntu 16.04 x64.

The updated guide https://github.com/asavah/xbmc/blob/3db4...aspberrypi now works as is.

Yet again you fail to see the real error.

This is the real error:
Code:
make[3]: Entering directory '/home/builder/myproject2/xbmc/tools/depends/target/libxkbcommon/raspberry-pi2-release'
YACC src/xkbcomp/parser.c
./build-aux/ylwrap: line 176: yacc: command not found

Code:
sudo apt-get install bison
fixes it.
I've added it to the package list.
Thank you for the help. I did find the reference to bison yesterday but it would not install. when running apt-get install bison it would try to connect to http://us.archive.ubuntu.com but would time out. Because the forum posts I found referencing bison were old, some very old. I figured it was possibly dead. Seeing as this time it did work, maybe it was a DNS issue with a dead or bad archive server. Bison is now installed and I am building again.
The updates worked and I was able to make a successful build Kodi build for raspberry PI on Ubuntu 16.04 desktop. Next step get it installed on the raspberry pi itself.

thanks

Paul
Well here is an update. after many attempts I have failed to get the source compiled for the raspberry PI on Ubuntu to install on the PI itself. So I moved to compiling on the raspberry pi. I am almost there I got past some missing links and other error message and needed dependencies. I am stuck on what I believe is the last error message. cannot find -lpthreads I know it is a missing link. running find /lib -name "*pthread*"   I have the files. running the following command finds the entry point.

Code:
root@raspberrypi:/home/pi/mykodiproject/xbmc/build# nm /lib/arm-linux-gnueabihf/libpthread.so.0 | grep "pthread_create"
00006364 t __pthread_create_2_1
00006364 T pthread_create@@GLIBC_2.4
root@raspberrypi:/home/pi/mykodiproject/xbmc/build#

but my error logs shows that it can't find it, but where is it looking for it?

https://paste.ubuntu.com/p/R6nmdPP9rS/

find / -name "*cmake_link_script*"  returns no results, thought I might be able to see where it's looking in this file. the search yields no results.

Where is the complier looking for these links?

Thanks for your help.

Paul
it's been a busy week but I had time to break down the error log. I found the file link.txt and it is the only tangible file in the error log which has this entry.

Code:
/usr/bin/c++  -fPIC -O3 -DNDEBUG  -shared -Wl,-soname,libp8-platform.so.2 -o libp8-platform.so.2.1.0 CMakeFiles/p8-platform.dir/src/util/StringUtils.cpp.o -lpthread

CMakeFiles/p8-platform.dir/src/util/StringUtils.cpp.o is a compiled file nothing to see in that file.

both libp8-platform.so.2 and libp8-platform.so.2.1.0 are on my system in this folder /usr/lib/arm-linux-gnueabihf/ and the project folder /platform/debian/tmp/usr/lib/arm-linux-gnueabihf

Still struggling a bit, but I am trying to understand the line of code above.

okay -f -O are passed to sub processes
-DNDEBUG type of debug command
-shared create shared library
-Wl are comma separated options to the linker
followed by files used.

Am I on the right path?
Pages: 1 2