v17 Adding Rpi2 support to CMAKE build system
#1
Building / tuning Kodi for Rpi2 in <= Jarvis, with AUTOFOO build system, required changes to configure.ac based on

https://github.com/pilfs/patches/blob/ma...rget.patch

specifically turning on neon & cortex-a7 use, for example
Code:
    case $use_platform in
      raspberry-pi)
         target_platform=target_raspberry_pi
         use_neon=yes
         use_arch="arm"
         use_cpu="cortex-a7"
         use_hardcoded_tables="yes"
         use_openmax=no
         ARCH="arm"
in both
Code:
    kodi/configure.ac
    kodi/tools/depends/configure.ac
as well as some *flags changes.

It's worked well.

With krypton, using the CMAKE build system, where do those equivalent changes need to be made for RPi2 support?

Or is Rpi2 support built into Krypton already?
Reply
#2
Krypton already has support for rpi2 both in autotools and in cmake.
Cmake uses the settings from depends via the generated Toolchain.cmake


And moving this to rpi support forum.
Reply
#3
(2016-08-29, 20:56)wsnipex Wrote: Krypton already has support for rpi2 both in autotools and in cmake.
Cmake uses the settings from depends via the generated Toolchain.cmake

'generated' automatically? when I just configure & build kodi itself?

Or do I need to build the toolchain tandalone, some variant of

Develop PVR addons with new cmake build system

http://forum.kodi.tv/showthread.php?tid=...pid1934940

?

Need to dig around in here a bit I think.

> And moving this to rpi support forum.

Thanks
Reply
#4
read tools/depends/README
Reply
#5
@wsnipex

> read tools/depends/README

Unless I'm missing something, that doesn't mention anything about the CMAKE build.

Neither does
Code:
    ./docs/README.raspberrypi
The latter does mention
Code:
    platform=raspberry-pi2
Guessing/attempting
Code:
    cmake \
     -DPLATFORM=raspberry-pi \
     -DENABLE_INTERNAL_FFMPEG=1 \
     ...
    ../project/cmake/

     ...
    -- #---- CONFIGURATION ----#
    -- -- PATH config --
    -- Prefix: /usr/local/kodi
    -- Libdir: /usr/local/kodi/lib
    -- Bindir: /usr/local/kodi/bin
    -- Includedir: /usr/local/kodi/include
    -- Datarootdir: /usr/local/kodi/share
    -- Datadir: /usr/local/kodi/share
    -- MICROHTTPD enabled: Yes
    -- MYSQLCLIENT enabled: Yes
    -- SSH enabled: Yes
    -- XSLT enabled: Yes
    -- ALSA enabled: Yes
    -- UDEV enabled: Yes
    -- DBUS enabled: Yes
    -- AVAHI enabled: No
    -- SMBCLIENT enabled: No
    -- PULSEAUDIO enabled: No
    -- VDPAU enabled: No
    -- VAAPI enabled: No
    -- CEC enabled: Yes
    -- BLURAY enabled: Yes
    -- NFS enabled: Yes
    -- SDL enabled: No
    -- OPENGL enabled: Yes
    -- X enabled: Yes
    -- LIBDRM enabled: Yes
    -- XRANDR enabled: Yes
    --
    #--------------- Internal Variables -------------#
    ...
At this point arch config includes the FFMPEG_OPTS
Code:
    cat ../project/cmake/scripts/android/ArchSetup.cmake
        ...
        set(FFMPEG_OPTS --enable-cross-compile --cpu=cortex-a9 --arch=arm --target-os=linux --enable-neon
                        --disable-vdpau --cc=${CMAKE_C_COMPILER} --host-cc=${CMAKE_C_COMPILER}
                        --strip=${CMAKE_STRIP})
        ...
Build fails
Code:
    cmake --build . -- VERBOSE=1 -j$CORES

        ...
        [ 62%] Performing configure step for 'ffmpeg'
        cd /usr/local/src/kodi/build/build/ffmpeg/src/ffmpeg-build/ffmpeg-prefix/src/ffmpeg-build && PKG_CONFIG_LIBDIR=/lib/pkgconfig /usr/local/src/kodi/build/build/ffmpeg/src/ffmpeg/configure --prefix=/usr/local/src/kodi/build/build --extra-version=\"kodi-3.1.2-Krypton-Beta1\" --disable-devices --disable-doc --disable-ffplay --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-sdl --enable-gpl --enable-runtime-cpudetect --enable-postproc --enable-pthreads --enable-muxer=spdif --enable-muxer=adts --enable-muxer=asf --enable-muxer=ipod --enable-encoder=ac3 --enable-encoder=aac --enable-encoder=wmav2 --enable-protocol=http --enable-encoder=png --enable-encoder=mjpeg --pkg-config=/usr/bin/pkg-config --pkg-config-flags=--static --enable-cross-compile --cpu=OFF --arch=OFF --target-os= --cc=/usr/bin/gcc-6 --cxx=/usr/bin/g++ --ar=/usr/bin/ar --extra-cflags= --extra-cxxflags= "--extra-ldflags= -fuse-ld=gold" --enable-vdpau --enable-vaapi --enable-pic --enable-gnutls
        autoreconf: configure.ac: tracing
        Must specify target arch and OS when cross-compiling

        If you think configure made a mistake, make sure you are using the latest
        version from Git.  If the latest version fails, report the problem to the
        [email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
        [100%] Linking CXX static library libcrossguid.a
        /usr/bin/cmake -P CMakeFiles/crossguid.dir/cmake_clean_target.cmake
        Include the log file "config.log" produced by configure as this will help
        solve the problem.
        CMakeFiles/ffmpeg.dir/build.make:105: recipe for target 'ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure' failed
        make[5]: *** [ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure] Error 1
        make[5]: Leaving directory '/usr/local/src/kodi/build/build/ffmpeg/src/ffmpeg-build'
        CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ffmpeg.dir/all' failed
        make[4]: *** [CMakeFiles/ffmpeg.dir/all] Error 2
        make[4]: Leaving directory '/usr/local/src/kodi/build/build/ffmpeg/src/ffmpeg-build'
        Makefile:127: recipe for target 'all' failed
        make[3]: *** [all] Error 2
        make[3]: Leaving directory '/usr/local/src/kodi/build/build/ffmpeg/src/ffmpeg-build'
        CMakeFiles/ffmpeg.dir/build.make:116: recipe for target 'build/ffmpeg/src/ffmpeg-stamp/ffmpeg-build' failed
        make[2]: *** [build/ffmpeg/src/ffmpeg-stamp/ffmpeg-build] Error 2
        make[2]: Leaving directory '/usr/local/src/kodi/build'
        CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/ffmpeg.dir/all' failed
        make[1]: *** [CMakeFiles/ffmpeg.dir/all] Error 2
        make[1]: *** Waiting for unfinished jobs....
        ...
note the
Code:
    ... --cpu=OFF --arch=OFF ...
?

full log here:

https://gist.github.com/listsssl/be5201b...b5ed16f335
Reply
#6
looks like you are not cross compiling, but building natively on the rpi.
This is not really supported (yet) in the cmake build system.
Reply
#7
(2016-08-30, 17:50)wsnipex Wrote: looks like you are not cross compiling, but building natively on the rpi.
This is not really supported (yet) in the cmake build system.

Not exactly ...

I'm building in a debian-chroot (QEMU_CPU=cortex-a15), populated with Raspbian.

So, in the chroot

Code:
uname -m
    armv7l

gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/6/lto-wrapper
    Target: arm-linux-gnueabihf
    Configured with: ../src/configure -v --with-pkgversion='Raspbian 6.1.1-11+rpi1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
    Thread model: posix
    gcc version 6.1.1 20160802 (Raspbian 6.1.1-11+rpi1)

Fwiw, same setup I'd been using for Jarvis+autofoo
Reply
#8
Well, using QEMU is not cross-compiling from the build systems perspective.
Any reason you can't use our standard way of building? https://github.com/xbmc/xbmc/blob/master...aspberrypi
Oh and autotools stuff is still there as well btw.


if you want to play around with your method, start by commenting out the top 3 lines in project/cmake/scripts/rbpi/ArchSetup.cmake, then build like this:

cmake -DCORE_SYSTEM_NAME=rbpi -DCPU=cortex-a7 -DCMAKE_C_FLAGS="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" -DCMAKE_CXX_FLAGS="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4"
Reply
#9
> Well, using QEMU is not cross-compiling from the build systems perspective.

Understood

> Any reason you can't use our standard way of building? https://github.com/xbmc/xbmc/blob/master...aspberrypi
> Oh and autotools stuff is still there as well btw.

I've got jarvis+autofoo as an option.

autofoo's not the future.

I'm interested in getting the CMAKE build system working -- for linux x86_64 & rpi2 targets. with Krypton as a start.

I figured contributing what I can here moves the ball down the field.

> if you want to play around with your method, start by commenting out the top 3 lines in project/cmake/scripts/rbpi/ArchSetup.cmake, then build like this:
>> cmake -DCORE_SYSTEM_NAME=rbpi -DCPU=cortex-a7 -DCMAKE_C_FLAGS="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" -DCMAKE_CXX_FLAGS="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4"

I'll give that a try. I was headed in the direction of manually creating a toolchain.make. I'd only gotten as far as

Code:
SET(OS "")
SET(CPU "auto")
SET(PLATFORM "")

SET(CORE_SYSTEM_NAME rbpi)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)

set(CMAKE_C_COMPILER   /usr/bin/arm-linux-gnueabihf-gcc-6)
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++-6)
SET(CMAKE_AR           /usr/bin/arm-linux-gnueabihf-ar CACHE FILEPATH "Archiver")
SET(CMAKE_LINKER       /usr/bin/ld.gold CACHE FILEPATH "Linker")
SET(CMAKE_FIND_ROOT_PATH  /usr/local/kodi/armv7l-linux-gnueabihf  /usr  /usr /sysroot/usr)
SET(CMAKE_LIBRARY_PATH /usr/local/kodi/armv7l-linux-gnueabihf/lib:/usr/lib/arm-linux-gnueabihf:/lib/arm-linux-gnueabihf)
LIST(APPEND CMAKE_FIND_ROOT_PATH /opt/vc)
LIST(APPEND CMAKE_LIBRARY_PATH /opt/vc/lib)


#set(CMAKE_FIND_ROOT_PATH "...")
#set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(CMAKE_C_FLAGS " -O3 -pipe -D_FORTIFY_SOURCE=2 -fmessage-length=0 -fstack-protector -march=armv7-a  -mfpu=neon-vfpv4  -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -ftree-vectorize -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3  -isystem /usr/local/kodi/armv7l-linux-gnueabihf/include")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=gnu++11")
SET(CMAKE_CPP_FLAGS "${CMAKE_C_FLAGS}")

SET(ENV{CFLAGS}   ${CMAKE_C_FLAGS})
SET(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS})
SET(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS})
SET(ENV{LDFLAGS} "-L/usr/local/kodi/armv7l-linux-gnueabihf/lib  -L/usr/local/lib ")

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Still trying to figure out & vaildate those settings.
Reply
#10
creating a toolchain file is certainly possible, but shouldn't be needed.
Part from telling our buildsystem that your are building for rpi and setting the proper flags, there is not much difference to x86 linux building.
Once you figured out the needed settings, we could create a -D"target_raspberrypi", similar to what we have in autotools.
Reply
#11
>> if you want to play around with your method, start by commenting out the top 3 lines in project/cmake/scripts/rbpi/ArchSetup.cmake, then build like this:
>>> cmake -DCORE_SYSTEM_NAME=rbpi -DCPU=cortex-a7 -DCMAKE_C_FLAGS="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4" -DCMAKE_CXX_FLAGS="-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4"

> I'll give that a try.

with
Code:
    echo $CFLAGS
        -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a  -mfpu=neon-vfpv4  -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -Wno-psabi -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3  -isystem /usr/local/kodi/armv7l-linux-gnueabihf/include
    echo $CXXFLAGS
        -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a  -mfpu=neon-vfpv4  -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -Wno-psabi -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3  -isystem /usr/local/kodi/armv7l-linux-gnueabihf/include -std=gnu++11
    echo $CPPFLAGS
        -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a  -mfpu=neon-vfpv4  -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -Wno-psabi -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3  -isystem /usr/local/kodi/armv7l-linux-gnueabihf/include -D_FORTIFY_SOURCE=2
commenting out the 1st 3 lines of
Code:
    ../project/cmake/scripts/rbpi/ArchSetup.cmake
adding
Code:
    -DWITH_ARCH=armv7l
to avoid a config error
Code:
    ...
    -- Generator: Single-configuration: Release (Unix Makefiles)
    -- CMake Version: 3.5.2
    -- System type: Linux
    CMake Error at scripts/linux/ArchSetup.cmake:14 (message):
      Unknown CPU: armv7l
    Call Stack (most recent call first):
      scripts/common/ArchSetup.cmake:85 (include)
      CMakeLists.txt:72 (include)
    ...
config
Code:
cmake \
  -DPLATFORM=raspberry-pi2 \
  -DWITH_ARCH=armv7l \
  -DCMAKE_C_FLAGS="${CFLAGS}" \
  -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
  ...
returns
Code:
    ...
    -- #---- CONFIGURATION ----#
    -- -- PATH config --
    -- Prefix: /usr/local/kodi
    -- Libdir: /usr/local/kodi/lib
    -- Bindir: /usr/local/kodi/bin
    -- Includedir: /usr/local/kodi/include
    -- Datarootdir: /usr/local/kodi/share
    -- Datadir: /usr/local/kodi/share
    -- MICROHTTPD enabled: Yes
    -- MYSQLCLIENT enabled: Yes
    -- SSH enabled: Yes
    -- XSLT enabled: Yes
    -- ALSA enabled: Yes
    -- UDEV enabled: Yes
    -- DBUS enabled: Yes
    -- AVAHI enabled: No
    -- SMBCLIENT enabled: No
    -- PULSEAUDIO enabled: No
    -- VDPAU enabled: No
    -- VAAPI enabled: No
    -- CEC enabled: Yes
    -- BLURAY enabled: Yes
    -- NFS enabled: Yes
    -- SDL enabled: No
    -- OPENGL enabled: Yes
    -- X enabled: Yes
    -- LIBDRM enabled: Yes
    -- XRANDR enabled: Yes
    --
    #--------------- Internal Variables -------------#
    ...
    -- #---------------------------------------------#
    -- SYSTEM_LDFLAGS        :
    -- CMAKE_DL_LIBS         : dl
    -- CMAKE_C_FLAGS         : -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a  -mfpu=neon-vfpv4  -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -Wno-psabi -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3
    -- CMAKE_CXX_FLAGS       : -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -Wno-psabi -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -std=c++11
    -- CMAKE_EXE_LINKER_FLAGS:  -fuse-ld=gold
    -- #---------------------------------------------#
    ...
    -- Configuring done
    ...
now
Code:
    cmake --build . -- VERBOSE=1 -j4
is building again, with that ^^ config

(this takes a long while)

we'll see how that goes
Reply
#12
@wsnipex

building inside the chroot, I caught this
Code:
make[2]: Entering directory '/usr/local/src/kodi/build'
[ 14%] Building CXX object build/sse4/CMakeFiles/sse4.dir/CopyFrame.cpp.o
cd /usr/local/src/kodi/build/build/sse4 && /usr/bin/g++   -Dsse4_EXPORTS -I/usr/local/src/kodi -I/usr/local/src/kodi/addons/library.xbmc.addon -I/usr/local/src/kodi/lib -I/usr/local/src/kodi/lib/gtest/include -I/usr/local/src/kodi/xbmc -I/usr/local/src/kodi/xbmc/linux -I/usr/local/src/kodi/xbmc/cores/VideoPlayer -I/usr/local/src/kodi/build/build -I/usr/include/freetype2 -I/usr/local/src/kodi/build/build/cpluff/include -I/usr/local/src/kodi/build/build/libdvd/include -I/usr/include/python2.7 -I/usr/include/arm-linux-gnueabihf/python2.7 -I/usr/include/lzo -I/usr/local/src/kodi/build/build/include -I/usr/include/libxml2 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/local/include -I/usr/include/libdrm  -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -ftree-vectorize -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -std=c++11 -O3 -DNDEBUG -fPIC   -D_LINUX -DTARGET_POSIX -DTARGET_LINUX -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_STD__U16_STRING=1 -DHAVE_STD__U32_STRING=1 -DHAVE_CHAR16_T=1 -DHAVE_CHAR32_T=1 -DHAVE_STDINT_H=1 -DHAS_BUILTIN_SYNC_ADD_AND_FETCH=1 -DHAS_BUILTIN_SYNC_SUB_AND_FETCH=1 -DHAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_LOCALTIME_R=1 -DFFMPEG_VER_SHA=\"3.1.2-Krypton-Beta1\" -DUSE_STATIC_FFMPEG=1 -DHAVE_LIBMICROHTTPD=1 -DHAVE_MYSQL=1 -DHAVE_LIBSSH=1 -DHAVE_LIBXSLT=1 -DHAVE_ALSA=1 -DUSE_ALSA=1 -DHAVE_LIBUDEV=1 -DHAVE_DBUS=1 -DHAVE_LIBCEC=1 -DHAVE_LIBBLURAY=1 -DHAVE_LIBNFS=1 -DHAVE_OPENSSL=1 -DUSE_UPNP=1 -DHAVE_XBMC_NONFREE=1 -DHAVE_LIBGL=1 -DHAVE_X11=1 -DHAVE_LIBXRANDR=1 -DHAVE_LIBEGL=1 -DBIN_INSTALL_PATH=\"/usr/local/kodi/lib/kodi\" -DINSTALL_PATH=\"/usr/local/kodi/share/kodi\" -msse4.1 -std=c++11 -o CMakeFiles/sse4.dir/CopyFrame.cpp.o -c /usr/local/src/kodi/xbmc/linux/sse4/CopyFrame.cpp
g++: error: unrecognized command line option ‘-msse4.1’
build/sse4/CMakeFiles/sse4.dir/build.make:65: recipe for target 'build/sse4/CMakeFiles/sse4.dir/CopyFrame.cpp.o' failed
make[2]: *** [build/sse4/CMakeFiles/sse4.dir/CopyFrame.cpp.o] Error 1
I didn't enable SSE* use.

I suspect it's pulled from /proc/cpuinfo, which, in this case reports flags for the host's HW,
Code:
cat /proc/cpuinfo | grep ^flags
    flags           : fpu vme de pse ... sse sse2 ... sse4a ...
on RPI2 hardware
Code:
cat /proc/cpuinfo  | grep sse
    (empty)
in configure.ac I see
Code:
...
use_sse4=no
if test "$ARCH" = "x86_64-linux" || test "$ARCH" = "i486-linux"; then
  SAVE_CFLAGS="$CFLAGS"
  CFLAGS="-msse4.1"
  AC_COMPILE_IFELSE(
    [AC_LANG_SOURCE([int foo;])],
    [ use_sse4=yes
      USE_SSE4=1],
    [ use_sse4=no
      USE_SSE4=0])
  CFLAGS="$SAVE_CFLAGS"
fi
...
and in
Code:
grep "if(SSE"  ./project/cmake/modules/FindSSE.cmake | grep TRUE
   if(SSE2_TRUE)
   if(SSE3_TRUE OR SSSE3_TRUE)
   if(SSE41_TRUE)
   if(SSE2_TRUE)
   if(SSE3_TRUE)
   if(SSE41_TRUE)
I could flag each of those as boolean =0.

Is there a better place to turn off SSE use?

Although I'm not sure it's just a disable.

These

SSE2NEON.h : A porting guide and header file to convert SSE intrinsics to their ARM NEON equivalent
http://codesuppository.blogspot.com/2015...-file.html

From ARM NEON to Intel SSE- the automatic porting solution, tips and tricks
https://software.intel.com/en-us/blogs/2...and-tricks

suggest to me that some porting is required to keep the arm NEON equivalent headers in use (don't know yet if they already are)
Reply
#13
seems the FindSSE module need to be fixed.

quick hack patch for you:
Code:
diff --git a/project/cmake/modules/FindSSE.cmake b/project/cmake/modules/FindSSE.cmake
index 62a248f..5051a53 100644
--- a/project/cmake/modules/FindSSE.cmake
+++ b/project/cmake/modules/FindSSE.cmake
@@ -1,7 +1,7 @@
# Check if SSE instructions are available on the machine where
# the project is compiled.

-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+if(CMAKE_SYSTEM_NAME MATCHES "sdsfsdfxx")
    exec_program(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO)

    string(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO})
Reply
#14
[align=justify][quote='wsnipex' pid='2404915' dateline='1472591917']
seems the FindSSE module need to be fixed.

> quick hack patch for you:

Code:
-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+if(CMAKE_SYSTEM_NAME MATCHES "sdsfsdfxx")

thanks. looks like it needs a bit more maybe

Code:
    ...
-    if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+    if(CMAKE_SYSTEM_NAME MATCHES "XXXXX")
    ...
    else()
-       set(SSE2_FOUND   true  CACHE BOOL "SSE2 available on host")
+       set(SSE2_FOUND   false CACHE BOOL "SSE2 available on host")
       set(SSE3_FOUND   false CACHE BOOL "SSE3 available on host")
       set(SSSE3_FOUND  false CACHE BOOL "SSSE3 available on host")
       set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host")
    endif()
    ...
A build having set
Code:
-DSSE2_TRUE:BOOLEAN=0 \
-DSSE3_TRUE:BOOLEAN=0 \
-DSSE41_TRUE:BOOLEAN=0 \
-DSSE2_TRUE:BOOLEAN=0 \
-DSSE3_TRUE:BOOLEAN=0 \
-DSSE41_TRUE:BOOLEAN=0 \

on cmake config, just failed. NOT fully equivalent to your suggestion ...

also need to
Code:
sed -i '/sse4/d' ../project/cmake/treedata/linux/subdirs.txt

after config. if not, STILL fails with
Code:
...
/usr/bin/make -f build/sse4/CMakeFiles/sse4.dir/build.make build/sse4/CMakeFiles/sse4.dir/depend
make[2]: Entering directory '/usr/local/src/kodi/build'
cd /usr/local/src/kodi/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/src/kodi/project/cmake /usr/local/src/kodi/xbmc/linux/sse4 /usr/local/src/kodi/build /usr/local/src/kodi/build/build/sse4 /usr/local/src/kodi/build/build/sse4/CMakeFiles/sse4.dir/DependInfo.cmake --color=
Dependee "/usr/local/src/kodi/build/build/sse4/CMakeFiles/sse4.dir/DependInfo.cmake" is newer than depender "/usr/local/src/kodi/build/build/sse4/CMakeFiles/sse4.dir/depend.internal".
Dependee "/usr/local/src/kodi/build/build/sse4/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/usr/local/src/kodi/build/build/sse4/CMakeFiles/sse4.dir/depend.internal".
Scanning dependencies of target sse4
make[2]: Leaving directory '/usr/local/src/kodi/build'
/usr/bin/make -f build/sse4/CMakeFiles/sse4.dir/build.make build/sse4/CMakeFiles/sse4.dir/build
make[2]: Entering directory '/usr/local/src/kodi/build'
[ 14%] Building CXX object build/sse4/CMakeFiles/sse4.dir/CopyFrame.cpp.o
cd /usr/local/src/kodi/build/build/sse4 && /usr/bin/g++   -Dsse4_EXPORTS -I/usr/local/src/kodi -I/usr/local/src/kodi/addons/library.xbmc.addon -I/usr/local/src/kodi/lib -I/usr/local/src/kodi/lib/gtest/include -I/usr/local/src/kodi/xbmc -I/usr/local/src/kodi/xbmc/linux -I/usr/local/src/kodi/xbmc/cores/VideoPlayer -I/usr/local/src/kodi/build/build -I/usr/include/freetype2 -I/usr/local/src/kodi/build/build/cpluff/include -I/usr/local/src/kodi/build/build/libdvd/include -I/usr/include/python2.7 -I/usr/include/arm-linux-gnueabihf/python2.7 -I/usr/include/lzo -I/usr/local/src/kodi/build/build/include -I/usr/include/libxml2 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/local/include -I/usr/include/libdrm  -O3 -pipe -fmessage-length=0 -fstack-protector -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -mtune=cortex-a7 -mcpu=cortex-a7 -ftree-vectorize -Wno-psabi -Wa,-mno-warn-deprecated -Wno-deprecated-declarations -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -std=c++11 -O3 -DNDEBUG -fPIC   -D_LINUX -DTARGET_POSIX -DTARGET_LINUX -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_STD__U16_STRING=1 -DHAVE_STD__U32_STRING=1 -DHAVE_CHAR16_T=1 -DHAVE_CHAR32_T=1 -DHAVE_STDINT_H=1 -DHAS_BUILTIN_SYNC_ADD_AND_FETCH=1 -DHAS_BUILTIN_SYNC_SUB_AND_FETCH=1 -DHAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_LOCALTIME_R=1 -DFFMPEG_VER_SHA=\"3.1.2-Krypton-Beta1\" -DUSE_STATIC_FFMPEG=1 -DHAVE_LIBMICROHTTPD=1 -DHAVE_MYSQL=1 -DHAVE_LIBSSH=1 -DHAVE_LIBXSLT=1 -DHAVE_ALSA=1 -DUSE_ALSA=1 -DHAVE_LIBUDEV=1 -DHAVE_DBUS=1 -DHAVE_LIBCEC=1 -DHAVE_LIBBLURAY=1 -DHAVE_LIBNFS=1 -DHAVE_OPENSSL=1 -DUSE_UPNP=1 -DHAVE_XBMC_NONFREE=1 -DHAVE_LIBGL=1 -DHAVE_X11=1 -DHAVE_LIBXRANDR=1 -DHAVE_LIBEGL=1 -DBIN_INSTALL_PATH=\"/usr/local/kodi/lib/kodi\" -DINSTALL_PATH=\"/usr/local/kodi/share/kodi\" -msse4.1 -std=c++11 -o CMakeFiles/sse4.dir/CopyFrame.cpp.o -c /usr/local/src/kodi/xbmc/linux/sse4/CopyFrame.cpp
g++: error: unrecognized command line option ‘-msse4.1’
build/sse4/CMakeFiles/sse4.dir/build.make:65: recipe for target 'build/sse4/CMakeFiles/sse4.dir/CopyFrame.cpp.o' failed
make[2]: *** [build/sse4/CMakeFiles/sse4.dir/CopyFrame.cpp.o] Error 1
make[2]: Leaving directory '/usr/local/src/kodi/build'
CMakeFiles/Makefile2:4013: recipe for target 'build/sse4/CMakeFiles/sse4.dir/all' failed
make[1]: *** [build/sse4/CMakeFiles/sse4.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CC      libavfilter/vf_hue.o
src/libavfilter/vf_hue.c:1:0: warning: switch -mcpu=cortex-a7 conflicts with -march=armv7-a switch
/*
Restarting with the mod'd patch as above
Reply
#15
https://github.com/xbmc/xbmc/pull/10372 should hopefully fix the sse issue.
Reply

Logout Mark Read Team Forum Stats Members Help
Adding Rpi2 support to CMAKE build system0