0

I am trying to install omxplayer for my raspi, but as it is so slow, I wish to do it on my Ubuntu 11.10 desktop. I have followed the instructions for setting up a cross compiler as described here (note, crosstools did not work for me). It mentions how to run it as such:

Now you should be able to compile you cmake programs as easy as executing you cmake with this extra flag -D CMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake

But this does not help me as I have never used cmake. If I have a standard installation like so:

./configure
make
make install

Where does -D CMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake fit into all that? Do I just change both occurrences of make to cmake =P I wish people would consider us noob programmers when answering these questions. This one poster made my blood boil with his response. I have included the omxplayer Makefile.include file, which I presume is where I have to make some serious changes, as well as my cross compilation .cmake file, could somebody describe to me what changes I have to make and how they correspond to each other.

Makefile.include:

USE_BUILDROOT=0
FLOAT=hard

ifeq ($(USE_BUILDROOT), 1)
BUILDROOT   :=/opt/xbmc-bcm/buildroot
SDKSTAGE    :=$(BUILDROOT)/output/staging
TARGETFS    :=$(BUILDROOT)/output/target
TOOLCHAIN   :=$(BUILDROOT)/output/host/usr/
HOST            :=arm-unknown-linux-gnueabi
SYSROOT     :=$(BUILDROOT)/output/host/usr/arm-unknown-linux-gnueabi/sysroot
else
BUILDROOT   :=/opt/bcm-rootfs
SDKSTAGE    :=/opt/bcm-rootfs
TARGETFS    :=/opt/bcm-rootfs
TOOLCHAIN   :=/home/dc4/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/
HOST        :=arm-linux-gnueabihf
#SYSROOT        :=$(TOOLCHAIN)/arm-bcm2708hardfp-linux-gnueabi/sysroot
SYSROOT     :=/opt/bcm-rootfs
endif

JOBS=7

CFLAGS          := -isystem$(PREFIX)/include
CXXFLAGS        := $(CFLAGS)
CPPFLAGS        := $(CFLAGS)
LDFLAGS         := -L$(BUILDROOT)/lib
LD                  := $(TOOLCHAIN)/bin/$(HOST)-ld --sysroot=$(SYSROOT)
CC                  := $(TOOLCHAIN)/bin/$(HOST)-gcc --sysroot=$(SYSROOT)
CXX         := $(TOOLCHAIN)/bin/$(HOST)-g++ --sysroot=$(SYSROOT)
OBJDUMP         := $(TOOLCHAIN)/bin/$(HOST)-objdump
RANLIB          := $(TOOLCHAIN)/bin/$(HOST)-ranlib
STRIP               := $(TOOLCHAIN)/bin/$(HOST)-strip
AR                  := $(TOOLCHAIN)/bin/$(HOST)-ar
CXXCP           := $(CXX) -E
PATH                := $(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)

CFLAGS          += -pipe -mfloat-abi=$(FLOAT) -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -g -mstructure-size-boundary=32 -mno-sched-prolog
LDFLAGS         += -L$(SDKSTAGE)/lib -L$(SDKSTAGE)/usr/lib -L$(SDKSTAGE)/opt/vc/lib/ -Lpcre/build
#INCLUDES       += -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2
INCLUDES        += -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -Ifreetype2/include

raspi.cmake:

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /mnt/UEF/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /mnt/UEF/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH /mnt/UEF/rootfs)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Community
  • 1
  • 1
puk
  • 16,318
  • 29
  • 119
  • 199

2 Answers2

1

Use Openembedded for OMXPlayer to compile, it's the easiest way to get things compiled without worrying too much on flag setting .

meta-raspberrypi is available here https://github.com/martiert/meta-raspberrypi.

Learn some basics of OE Then begin your work.

To be simple in my existing project, I tried it and I'm successful.

After setting the configuration, run the make called "omxplayer."

Otherwise, if you're not good enough in "OE," just try to understand BB file called "OMXPlayer."

http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/recipes-multimedia/omxplayer/omxplayer_git.bb?h=master

And try to cross-compile individually by checking dependencies.

ADDITION If you're unfamiliar with open-embedded Go for BUildroot Its an more easy then OE.

git clone https://github.com/nezticle/RaspberryPi-BuildRoot.git

cd RaspberryPi-BuildRoot

make raspberrypi_defconfig

make menuconfig

here Location: │
│ -> Package Selection for the target │
│ -> Raspberry Pi

Here, OMXPlayer will be enabled.

Finally:

make

The resulting package will be in output folder.

Community
  • 1
  • 1
vinay hunachyal
  • 3,781
  • 2
  • 20
  • 31
0

Does omxplayer have a CMakeLists.txt?

Then run this:

cd omxplayer
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake
make
make install

No configure, no Makefile hackery.

steveire
  • 10,694
  • 1
  • 37
  • 48
  • There is **no** `CMakeLists.txt` file. Do I run the above to generate it, or only if the file already exists? – puk Dec 02 '13 at 07:56
  • You run that command if it exists. As it does not exist, you don't use cmake to build omxplayer. So, you're asking the wrong question already :). – steveire Dec 02 '13 at 08:28
  • Basically I'm up poops creek without a paddle? – puk Dec 02 '13 at 08:45