Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to openFrameworks 0.10.1 #20

Open
MatthewScholefield opened this issue Jan 18, 2019 · 33 comments
Open

Upgrade to openFrameworks 0.10.1 #20

MatthewScholefield opened this issue Jan 18, 2019 · 33 comments

Comments

@MatthewScholefield
Copy link
Member

MatthewScholefield commented Jan 18, 2019

Someone asked about upgrading openFrameworks so I decided to create an issue here to do it. There currently isn't a clear process for how to upgrade this library, so we can try to develop one by documenting the problems we face while trying to do it. So far, here is the best idea of how to start:

  • Replace src/openframeworks with libs/openFrameworks/ inside the .tar.gz of the latest release
  • Try building (probably won't work)
  • Probably regenerate sources in CMakeLists.txt using a command like the following:
find src/openframeworks -name '*.c*' | sed -e "s/\.\/\(.*\)/    \"\${OF_ROOT_DIR}\/\\1\"/gm"
# This generates a bunch of lines like the following below which can be copied into the CMakeLists.txt to replace the old list of source files:
#     "${OF_ROOT_DIR}/src/openframeworks/app/ofBaseApp.cpp"
  • Try building again, and if it still fails post any errors
  • If it fails to compile because of libraries, they might need to be upgraded
@avilleret
Copy link
Member

actually I did the upgrade few weeks ago
it's only tested on Linux (ubuntu 18.04, doesn't work on archlinux yet)
and crosscompiling for raspberry pi seems to work fine (since yesterday)
Please have a look to the 0.10 branch

@avilleret
Copy link
Member

I also added a new ofnode_common.cmake file which groups some common lines of CMakelists.txt and openFrameworks.cmake

Basically I did what @MatthewScholefield describes : updating the source file with the ones from of 0.10.1 release then updating *.cmake with the new source and dependencies.

@gsautr
Copy link

gsautr commented Jan 23, 2019

So great to see this, thanks @avilleret - I'm also running 18.04 and have been following your guide how to create sysroot, though not managed yet. First thing is there seem to be issues with the libraries:

zlibg1-dev - misspelt, should be zlib1g-dev?
zlibg1 - also misspelt, zlib1g?
libmount - unknown, but set to libmount-dev
libusb-1.0 - also unknown, set to libusb-1.0-0

Then once steps are complete I try a build:

$ cmake ../of -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -GNinja -DCMAKE_SYSROOT='realpath "${PWD}/../sysroot"'

-- BCM include dir /home/parallels/ofnode/sysroot/opt/vc/include;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vmcs_host/linux;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vcos/pthreads
-- BCM lib bcm_host;vcos;vchiq_arm
-- Checking for module 'libcurl'
--   No package 'libcurl' found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  ofnode_common.cmake:236 (pkg_check_modules)
  CMakeLists.txt:4 (include)


-- Configuring incomplete, errors occurred!
See also "/home/parallels/ofnode/build-of-rpi/CMakeFiles/CMakeOutput.log".

Have tried adding libcurl-dev to the list of libraries, and double-checked libcurl4-openssl-dev. Any ideas?

@gsautr
Copy link

gsautr commented Jan 23, 2019

Silly mistake - libs were already installed so aptitude would skip over them - solution is to use "reinstall" alongside "install" to ensure everything is present:

sudo aptitude --download-only reinstall xorg-dev libgtk-3-dev libboost-filesystem-dev libboost-system-dev libboost-filesystem1.62.0 libboost-system1.62.0 libudev-dev libcairo2-dev libusb-1.0-0-dev libssl-dev libfreetype6-dev libfreetype6 libfontconfig1-dev libglu1-mesa-dev libmpg123-dev libopenal-dev libassimp-dev libopencv-dev libasound2-dev libsndfile1-dev gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcurl4-openssl-dev liburiparser-dev libpugixml-dev zlib1g-dev zlib1g libpng16-16 libasound2 libudev1 libglib2.0-0 libfreeimage-dev freeglut3-dev freeglut3 libx11-6 libxext6 libssl1.1 libselinux1 libpcre3 libmount-dev liblzma5 libxau6 libffi6 libxdmcp6 libbsd0 libblkid1 libdbus-1-3 libdrm2 libsystemd0 libuuid1 liblz4-1 libgcrypt20 libgpg-error0 libusb-1.0-0 libjpeg62-turbo libcurl3 libcurl-dev libxml2 libnghttp2-14 libidn2-0 librtmp1

Now getting an error for boost libraries though, all seem to be present

parallels@ubuntu:~/ofnode/build-of-rpi$ cmake ../ofApp -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -GNinja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot"`
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'bcm_host'
--   Found bcm_host, version 1
-- BCM include dir /home/parallels/ofnode/sysroot/opt/vc/include;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vmcs_host/linux;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vcos/pthreads
-- BCM lib bcm_host;vcos;vchiq_arm
-- Checking for module 'libcurl'
--   Found libcurl, version 7.52.1
CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.62.0

  Boost include path: /home/parallels/ofnode/sysroot/usr/include

  Could not find the following Boost libraries:

          boost_filesystem
          boost_system

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  /home/parallels/ofnode/of/ofnode_common.cmake:238 (find_package)
  /home/parallels/ofnode/of/openFrameworks.cmake:2 (include)
  CMakeLists.txt:6 (include)


-- Boost include dir /home/parallels/ofnode/sysroot/usr/include
CMake Error at /home/parallels/ofnode/of/openFrameworks.cmake:114 (message):
  No shared openFrameworks libraries found in
  /home/parallels/ofnode/of/lib-linux/release-armv7-32 folder.
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)


-- Configuring incomplete, errors occurred!
See also "/home/parallels/ofnode/build-of-rpi/CMakeFiles/CMakeOutput.log".

@avilleret
Copy link
Member

thanks @autr for the review, could you send a PR for the lib list update ?

concerning install vs reinstall for aptitude, I think we should do both
because reinstall won't install packages that are note already installed... (silly)

concerning boost, I always have trouble finding it when cross compiling
I'll check it

btw I fixed the build under ArchLinux
we need to test and debug OSX now

@avilleret
Copy link
Member

concerning boost, I have the following (from my sysroot folder) 👍

[antoine@antoine-pc sysroot]$ find . -name *boost*
./usr/include/boost
./usr/include/boost/icl/detail/boost_config.hpp
./usr/include/boost/geometry/geometries/adapted/boost_polygon.hpp
./usr/include/boost/geometry/geometries/adapted/boost_array.hpp
./usr/include/boost/geometry/geometries/adapted/boost_polygon
./usr/include/boost/geometry/geometries/adapted/boost_fusion.hpp
./usr/include/boost/geometry/geometries/adapted/boost_range
./usr/include/boost/geometry/geometries/adapted/boost_tuple.hpp
./usr/include/boost/fusion/include/boost_array.hpp
./usr/include/boost/fusion/include/boost_tuple.hpp
./usr/include/boost/fusion/adapted/boost_tuple
./usr/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp
./usr/include/boost/fusion/adapted/boost_array.hpp
./usr/include/boost/fusion/adapted/boost_array
./usr/include/boost/fusion/adapted/boost_tuple.hpp
./usr/include/boost/hana/ext/boost
./usr/include/boost/hana/ext/boost.hpp
./usr/include/boost/chrono/typeof/boost
./usr/include/boost/serialization/boost_unordered_map.hpp
./usr/include/boost/serialization/boost_unordered_set.hpp
./usr/include/boost/convert/detail/boost_parameter_ext.hpp
./usr/include/c++/6/bits/boost_concept_check.h
./usr/lib/arm-linux-gnueabihf/libboost_filesystem.so.1.62.0
./usr/lib/arm-linux-gnueabihf/libboost_system.so.1.62.0
./usr/lib/arm-linux-gnueabihf/libboost_system.a
./usr/lib/arm-linux-gnueabihf/libboost_filesystem.a
./usr/lib/arm-linux-gnueabihf/libboost_system.so
./usr/lib/arm-linux-gnueabihf/libboost_filesystem.so
./usr/share/lintian/overrides/libboost-system1.62.0
./usr/share/lintian/overrides/libboost1.62-dev
./usr/share/lintian/overrides/libboost-filesystem1.62.0
./usr/share/doc/libboost-filesystem1.62-dev
./usr/share/doc/libboost-system1.62.0
./usr/share/doc/libboost-system1.62-dev
./usr/share/doc/libboost1.62-dev
./usr/share/doc/libboost-filesystem-dev
./usr/share/doc/libboost-filesystem1.62.0
./usr/share/doc/libboost-system-dev

and CMake finds it right :

[antoine@antoine-pc build_of_rpi]$ ninja 
[0/1] Re-running CMake...
-- BCM include dir /home/antoine/dev/ofnode/sysroot/opt/vc/include;/home/antoine/dev/ofnode/sysroot/opt/vc/include/interface/vmcs_host/linux;/home/antoine/dev/ofnode/sysroot/opt/vc/include/interface/vcos/pthreads
-- BCM lib bcm_host;vcos;vchiq_arm
-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Boost include dir /home/antoine/dev/ofnode/sysroot/usr/include
...

could you check @autr if you have the same tree for boost ?
and could you check that there is no dead link for boost lib ?
if so, then we should add them to the "update symlinks" section

@avilleret
Copy link
Member

btw, I just removed glew source from repo to use system's one

@avilleret
Copy link
Member

@autr concerning Boost, I do have issue when including 3rdparty lib that needs come with their own boost version, then boost_dir is overridden and openframeworks can't find boost_system and boost_file_system lib.

Do you have such a thing on your side ?

@gsautr
Copy link

gsautr commented Jan 27, 2019

Hey @avilleret - starting anew with libglew2.0 and libglew-dev on the Pi side, I got dependency errors on the Ubuntu side (glew could not find "gl" / "glu").

Trashed sysroot and installed without - but on Ubuntu 18.04 machine, glew doesn't seem to be present so installed w. sudo apt install libglew-dev

Can you tell me how to link system glew into the Cmake config?

cmake ../of -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -GNinja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot"`
~/ofnode/build-of-rpi ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'bcm_host'
--   Found bcm_host, version 1
-- BCM include dir /home/parallels/ofnode/sysroot/opt/vc/include;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vmcs_host/linux;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vcos/pthreads
-- BCM lib bcm_host;vcos;vchiq_arm
-- Checking for module 'libcurl'
--   Found libcurl, version 7.52.1
-- Checking for module 'glew'
--   No package 'glew' found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  ofnode_common.cmake:226 (pkg_check_modules)
  CMakeLists.txt:4 (include)

@gsautr
Copy link

gsautr commented Jan 27, 2019

Ah, I see the update is to add glew into the sysroot. This is the error I get on Ubuntu side:

cmake ../of -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -GNinja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot"`
~/ofnode/build-of-rpi ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'bcm_host'
--   Found bcm_host, version 1
-- BCM include dir /home/parallels/ofnode/sysroot/opt/vc/include;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vmcs_host/linux;/home/parallels/ofnode/sysroot/opt/vc/include/interface/vcos/pthreads
-- BCM lib bcm_host;vcos;vchiq_arm
-- Checking for module 'libcurl'
--   Found libcurl, version 7.52.1
-- Checking for module 'glew'
--   Package 'gl', required by 'glu', not found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  ofnode_common.cmake:226 (pkg_check_modules)
  CMakeLists.txt:4 (include)


-- Configuring incomplete, errors occurred!
See also "/home/parallels/ofnode/build-of-rpi/CMakeFiles/CMakeOutput.log".

@avilleret
Copy link
Member

hum strange that it search for OpenGL library since on arm it should use openGLES

anyhow, libGL.so is in libgl1-mesa-glx package

btw, I put my sysroot here if you want to check it out : https://www.dropbox.com/s/wdloxqutn4b64mu/sysroot-of0.10.tar.gz

but I'm currently testing ofnode on RPi and it doesn't work yet
I only have black screen for now

@avilleret
Copy link
Member

@autr I confirm that CMake should not search for GLEW when building for RaspberryPi
I'm trying to fix it, and hopefully it will also fix my 2 days headache...

@avilleret
Copy link
Member

@autr could you try with 443d2f0 ?

cross compiling from Archlinux and downloading it to raspberry pi works for me

I'll test native compilation when I'll have a little more time

@gsautr
Copy link

gsautr commented Jan 28, 2019

Hi @avilleret - update on attempt:

  • D/led and extract your sysroot example
  • Clone of.git recursively with submodules to fix glew CMakeList missing errors
  • Fix typo of -GNinja to -G Ninja
  • Clone ofApp.git
  • ofGLFWWindowSettings unknown error
  • Change main.cpp from ofGLFWWindowSettings to standard 0.10 ofSetupOpenGL
  • ninja and linker error on ofApp-armv7-Release

Is there something I should be doing with regards to Arch / Arm7? I was building my sysroot from Stretch (Arm6) but for these attempts was using your sysroot tar.

#### of ####

# Clone OF correctly

cd ~/ofnode 
&& rm -rf of 
&& git clone --depth 1 --recursive --branch 0.10 https://github.com/ofnode/of.git

# Fixed typo "-GNinja" : "-G Ninja"

cd ~/ofnode 
&& sudo rm -rf build-of-rpi 
&& mkdir build-of-rpi 
&& pushd build-of-rpi 
&& cmake ../of -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -G Ninja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot"` 
&& ninja

# Final output of ninja:

[81/81] Linking CXX executable src/glm/glm/glm_dummy


#### ofApp ####

# Clone ofApp correctly

cd ~/ofnode 
&& rm -rf ofApp 
&& git clone https://github.com/ofnode/ofApp.git


cd ~/ofnode 
&& sudo rm -rf build-ofApp-rpi 
&& mkdir build-ofApp-rpi 
&& pushd build-ofApp-rpi 
&& cmake ../ofApp -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -G Ninja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot"` 
&& ninja

# Errors, as main.cpp using old GPFW Window

int main()
{
  ofGLFWWindowSettings settings;

  auto window = ofCreateWindow(settings);
  auto app = make_shared<ofApp>();
  ofRunApp(window, app);

  return ofRunMainLoop();
}

/home/parallels/ofnode/ofApp/src/main.cpp:5:3: error: ‘ofGLFWWindowSettings’ was not declared in this scope
   ofGLFWWindowSettings settings;
   ^~~~~~~~~~~~~~~~~~~~
/home/parallels/ofnode/ofApp/src/main.cpp:5:3: note: suggested alternative: ‘ofGLESWindowSettings’
   ofGLFWWindowSettings settings;
   ^~~~~~~~~~~~~~~~~~~~
   ofGLESWindowSettings
/home/parallels/ofnode/ofApp/src/main.cpp:7:32: error: ‘settings’ was not declared in this scope
   auto window = ofCreateWindow(settings);

 #etc

 # So switch to OpenGL default:

 int main()
{
	ofSetupOpenGL(1280, 720, OF_WINDOW);
	ofRunApp(new ofApp()); // start the app
}

# Linker error;

[9/9] Linking CXX executable /home/parallels/ofnode/ofApp/bin/ofApp-armv7-Release
FAILED: /home/parallels/ofnode/ofApp/bin/ofApp-armv7-Release
: && /usr/bin/arm-linux-gnueabihf-g++ --sysroot=/home/parallels/ofnode/sysroot  -fdiagnostics-color -std=gnu++14 -O3 -DNDEBUG -Wno-narrowing -Wno-deprecated-declarations -g1 -Wno-psabi -march=armv7-a -mfpu=vfp -mfloat-abi=hard -fPIC  -rdynamic CMakeFiles/ofApp.dir/src/main.cpp.o CMakeFiles/ofApp.dir/src/ofApp.cpp.o  -o /home/parallels/ofnode/ofApp/bin/ofApp-armv7-Release -L/home/parallels/ofnode/sysroot/opt/vc/lib -Wl,-rpath,/opt/vc/lib:/home/parallels/ofnode/of/lib-linux/release-armv7-32 -Wl,-rpath-link,/home/parallels/ofnode/sysroot/usr/lib:/home/parallels/ofnode/sysroot/usr/lib/arm-linux-gnueabihf:/home/parallels/ofnode/sysroot/lib:/home/parallels/ofnode/sysroot/lib/arm-linux-gnueabihf:/home/parallels/ofnode/sysroot/opt/vc/lib -Wl,-rpath,'$ORIGIN' -lbcm_host -lvcos -lvchiq_arm -lboost_system -lboost_filesystem -lcurl -lfreeimage /home/parallels/ofnode/of/lib-linux/release-armv7-32/libopenFrameworks.so -lXi -lSM -lICE -lX11 -lXext -lXrandr -lXcursor -lXxf86vm -lXinerama -lz -lcairo -lssl -lcrypto -lfreetype -lfontconfig -lfreetype -lpthread -lpugixml -lglut -luriparser -lXmu -ldl /home/parallels/ofnode/sysroot/opt/vc/lib/libbrcmEGL.so /home/parallels/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so -lasound -lopenal -lmpg123 -lsndfile -ludev -lglib-2.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lssl -lcrypto -lfreetype -lfontconfig -lfreetype -lpthread -lpugixml -lglut -luriparser -lXmu -ldl /home/parallels/ofnode/sysroot/opt/vc/lib/libbrcmEGL.so /home/parallels/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so -lasound -lopenal -lmpg123 -lsndfile -ludev -lglib-2.0 -lgstreamer-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstvideo-1.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 && : 


@avilleret
Copy link
Member

Fixed typo "-GNinja" : "-G Ninja"

strange, the former always works for me (but the later does too)

So switch to OpenGL default:

I also noted that but forgot to push it, it's up-to-date now (btw I just replaced the ofGLFWWindowSettings with ofGLWindowsSettings)

Linker error;

could you post the error ?
I only have the command line
my sysroot tarball should miss some libs, I'll update it asap

thanks for the feedback

@gsautr
Copy link

gsautr commented Jan 28, 2019

Thanks - I saw some strange behaviour with ofGLFWWindowSettings still being seen even after I had rm -rf the entire dir and cloned the latest. Is there another bin or cache somewhere?

Here's the full error I'm now getting:

cd ~/ofnode && sudo rm -rf build-ofApp-rpi && mkdir build-ofApp-rpi && pushd build-ofApp-rpi && cmake ../ofApp -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -G Ninja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot"` && ninja
~/ofnode/build-ofApp-rpi ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode ~/ofnode
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'bcm_host'
--   Found bcm_host, version 1
-- BCM include dir /home/pi/ofnode/sysroot/opt/vc/include;/home/pi/ofnode/sysroot/opt/vc/include/interface/vmcs_host/linux;/home/pi/ofnode/sysroot/opt/vc/include/interface/vcos/pthreads
-- BCM lib bcm_host;vcos;vchiq_arm
-- Checking for module 'libcurl'
--   Found libcurl, version 7.52.1
-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Boost include dir /home/pi/ofnode/sysroot/usr/include
-- Glew lib :
-- Checking for module 'cairo'
--   Found cairo, version 1.14.8
-- Checking for module 'fontconfig'
--   Found fontconfig, version 2.11.0
-- Found system OpenGL ES 2 library: /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so
-- EGL include dir : /home/pi/ofnode/sysroot/opt/vc/include
-- OpenGLES2 include dir : /home/pi/ofnode/sysroot/opt/vc/include
-- EGL library : /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmEGL.so
-- OpenGLES2 library : /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so
-- Looking for XOpenDisplay in /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libX11.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libX11.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXext.so - not found
-- Looking for dnet_ntoa in dnet
-- Looking for dnet_ntoa in dnet - not found
-- Looking for dnet_ntoa in dnet_stub
-- Looking for dnet_ntoa in dnet_stub - not found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libX11.so
-- Found ZLIB: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.8")
-- Found OpenSSL: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.1.0j")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Freetype: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libfreetype.so (found version "2.6.3")
-- Found ALSA: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libasound.so (found version "1.1.3")
-- Found OpenAL: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libopenal.so
-- Found MPG123: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libmpg123.so
-- Found SNDFILE: /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libsndfile.so
-- libudev stable: 1
-- Found UDev: /home/pi/ofnode/sysroot/lib/arm-linux-gnueabihf/libudev.so
--    include: /home/pi/ofnode/sysroot/usr/include
-- Found GLIB: /home/pi/ofnode/sysroot/usr/include/glib-2.0;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include (found version "2.50.3")
-- Checking for module 'gstreamer-1.0'
--   Found gstreamer-1.0, version 1.10.4
-- Checking for module 'gstreamer-base-1.0'
--   Found gstreamer-base-1.0, version 1.10.4
-- Checking for module 'gstreamer-video-1.0'
--   Found gstreamer-video-1.0, version 1.10.4
-- Checking for module 'gstreamer-app-1.0'
--   Found gstreamer-app-1.0, version 1.10.4
-- Gstreamer include dir: /home/pi/ofnode/sysroot/usr/include/gstreamer-1.0/home/pi/ofnode/sysroot/usr/include/glib-2.0/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include
-- Gstreamer lib:
-- Gstreamer lib: gstreamer-1.0gobject-2.0glib-2.0
-- Gstreamer-app lib: gstapp-1.0gstbase-1.0gstreamer-1.0gobject-2.0glib-2.0
-- Gstreamer-base lib: gstbase-1.0gstreamer-1.0gobject-2.0glib-2.0
-- Gstreamer-video lib: gstvideo-1.0gstbase-1.0gstreamer-1.0gobject-2.0glib-2.0
-- Checking for module 'gtk+-3.0'
--   Found gtk+-3.0, version 3.22.11
-- cotire 1.7.2 loaded.
-- TARGET_ARCH: armv7 32bit
-- OF_COTIRE: ON
-- OF_STATIC: OFF
-- OF_AUDIO: ON
-- OF_VIDEO: ON
-- OF_GTK: ON
-- OF_GTK2: OFF
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_C_COMPILER_ID: GNU
-- CMAKE_CXX_COMPILER_ID: GNU
-- OPENFRAMEWORKS_LIBRARIES : -Wl,-rpath-link,/home/pi/ofnode/sysroot/usr/lib:/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot/lib:/home/pi/ofnode/sysroot/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot/opt/vc/lib;-Wl,-rpath,'$$ORIGIN';bcm_host;vcos;vchiq_arm;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libboost_system.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libboost_filesystem.so;curl;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libfreeimage.so;/home/pi/ofnode/of/lib-linux/release-armv7-32/libopenFrameworks.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXi.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libSM.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libICE.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libX11.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXext.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXrandr.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXcursor.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXxf86vm.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libXinerama.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libz.so;cairo;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libssl.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libcrypto.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libfreetype.so;fontconfig;freetype;-lpthread;pugixml;glut;uriparser;Xmu;dl;/home/pi/ofnode/sysroot/opt/vc/lib/libbrcmEGL.so;/home/pi/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libasound.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libopenal.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libmpg123.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libsndfile.so;/home/pi/ofnode/sysroot/lib/arm-linux-gnueabihf/libudev.so;/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libglib-2.0.so;gstreamer-1.0;gobject-2.0;glib-2.0;gstapp-1.0;gstbase-1.0;gstreamer-1.0;gobject-2.0;glib-2.0;gstbase-1.0;gstreamer-1.0;gobject-2.0;glib-2.0;gstvideo-1.0;gstbase-1.0;gstreamer-1.0;gobject-2.0;glib-2.0;gtk-3;gdk-3;pangocairo-1.0;pango-1.0;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0
-- CXX target ofApp cotired without unity build.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ofnode/build-ofApp-rpi
[4/9] Generating CXX prefix source cotire/ofApp_CXX_prefix.cxx
-- Result 1 scanning includes of /home/pi/ofnode/build-ofApp-rpi/cotire/ofApp_CXX_unity.cxx.
-- 1 line(s) skipped, see /home/pi/ofnode/build-ofApp-rpi/cotire/ofApp_CXX_prefix.cxx.log
[6/9] Building CXX precompiled header cotire/ofApp_CXX_prefix.hxx.gch
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
[7/9] Building CXX object CMakeFiles/ofApp.dir/src/ofApp.cpp.o
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
cc1plus: warning: /home/pi/ofnode/build-ofApp-rpi/cotire/ofApp_CXX_prefix.hxx.gch: not used because `__STDC_ISO_10646__' defined as ` 201706L' not ` 201605L' [-Winvalid-pch]
In file included from /home/pi/ofnode/of/src/glm/glm/detail/precision.hpp:6:0,
                 from /home/pi/ofnode/of/src/glm/glm/detail/type_vec.hpp:6,
                 from /home/pi/ofnode/of/src/glm/glm/detail/type_vec2.hpp:6,
                 from /home/pi/ofnode/of/src/glm/glm/vec2.hpp:6,
                 from /home/pi/ofnode/of/src/openframeworks/events/ofEvents.h:8,
                 from /home/pi/ofnode/of/src/openframeworks/utils/ofURLFileLoader.h:3,
                 from /home/pi/ofnode/of/src/openframeworks/ofMain.h:11,
                 from /home/pi/ofnode/ofApp/src/ofApp.h:3,
                 from /home/pi/ofnode/ofApp/src/ofApp.cpp:1:
/home/pi/ofnode/of/src/glm/glm/detail/setup.hpp:456:100: note: #pragma message: GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components
 # pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components")
                                                                                                    ^
[8/9] Building CXX object CMakeFiles/ofApp.dir/src/main.cpp.o
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
cc1plus: warning: /home/pi/ofnode/build-ofApp-rpi/cotire/ofApp_CXX_prefix.hxx.gch: not used because `__STDC_ISO_10646__' defined as ` 201706L' not ` 201605L' [-Winvalid-pch]
In file included from /home/pi/ofnode/of/src/glm/glm/detail/precision.hpp:6:0,
                 from /home/pi/ofnode/of/src/glm/glm/detail/type_vec.hpp:6,
                 from /home/pi/ofnode/of/src/glm/glm/detail/type_vec2.hpp:6,
                 from /home/pi/ofnode/of/src/glm/glm/vec2.hpp:6,
                 from /home/pi/ofnode/of/src/openframeworks/events/ofEvents.h:8,
                 from /home/pi/ofnode/of/src/openframeworks/utils/ofURLFileLoader.h:3,
                 from /home/pi/ofnode/of/src/openframeworks/ofMain.h:11,
                 from /home/pi/ofnode/ofApp/src/ofApp.h:3,
                 from /home/pi/ofnode/ofApp/src/main.cpp:1:
/home/pi/ofnode/of/src/glm/glm/detail/setup.hpp:456:100: note: #pragma message: GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components
 # pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components")
                                                                                                    ^
[9/9] Linking CXX executable /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release
FAILED: /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release
: && /usr/bin/arm-linux-gnueabihf-g++ --sysroot=/home/pi/ofnode/sysroot  -fdiagnostics-color -std=gnu++14 -O3 -DNDEBUG -Wno-narrowing -Wno-deprecated-declarations -g1 -Wno-psabi -march=armv7-a -mfpu=vfp -mfloat-abi=hard -fPIC  -rdynamic CMakeFiles/ofApp.dir/src/main.cpp.o CMakeFiles/ofApp.dir/src/ofApp.cpp.o  -o /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release -L/home/pi/ofnode/sysroot/opt/vc/lib -Wl,-rpath,/opt/vc/lib:/home/pi/ofnode/of/lib-linux/release-armv7-32 -Wl,-rpath-link,/home/pi/ofnode/sysroot/usr/lib:/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot/lib:/home/pi/ofnode/sysroot/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot/opt/vc/lib -Wl,-rpath,'$ORIGIN' -lbcm_host -lvcos -lvchiq_arm -lboost_system -lboost_filesystem -lcurl -lfreeimage /home/pi/ofnode/of/lib-linux/release-armv7-32/libopenFrameworks.so -lXi -lSM -lICE -lX11 -lXext -lXrandr -lXcursor -lXxf86vm -lXinerama -lz -lcairo -lssl -lcrypto -lfreetype -lfontconfig -lfreetype -lpthread -lpugixml -lglut -luriparser -lXmu -ldl /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmEGL.so /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so -lasound -lopenal -lmpg123 -lsndfile -ludev -lglib-2.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lssl -lcrypto -lfreetype -lfontconfig -lfreetype -lpthread -lpugixml -lglut -luriparser -lXmu -ldl /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmEGL.so /home/pi/ofnode/sysroot/opt/vc/lib/libbrcmGLESv2.so -lasound -lopenal -lmpg123 -lsndfile -ludev -lglib-2.0 -lgstreamer-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstvideo-1.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 && :
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: warning: librt.so.1, needed by /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libboost_system.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: warning: libresolv.so.2, needed by /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libgssapi_krb5.so.2, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: warning: libgomp.so.1, needed by /home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15, not found (try using -rpath or -rpath-link)
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_dynamic_start@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so: undefined reference to `clock_getres@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_dynamic_next@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `omp_get_num_threads@OMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_guided_start@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `ns_name_uncompress@GLIBC_2.9'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `ns_parserr@GLIBC_2.9'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2: undefined reference to `__res_query@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_critical_name_start@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_parallel@GOMP_4.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_end@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `ns_initparse@GLIBC_2.9'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `__res_nsearch@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_end_nowait@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2: undefined reference to `__dn_expand@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libgdk-3.so: undefined reference to `shm_unlink@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_barrier@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libcairo.so: undefined reference to `clock_gettime@GLIBC_2.4'
/home/pi/ofnode/sysroot/lib/arm-linux-gnueabihf/libsystemd.so.0: undefined reference to `mq_getattr@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `omp_get_thread_num@OMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_guided_next@GOMP_1.0'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libgdk-3.so: undefined reference to `shm_open@GLIBC_2.4'
/home/pi/ofnode/sysroot/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_critical_name_end@GOMP_1.0'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@avilleret
Copy link
Member

ok, first thing, you're using GCC 7.3.0 and I have 8.2.0 from here https://github.com/abhiTronix/raspberry-pi-cross-compilers

this will help a little bit

concerning the missing lib, those are 3rd party lib depencies that are not satisfied
I'll try to update my up-to-date sysroot asap, but if you want to, you can track them one by one by searching google with keyword like "debian stretch armhf librt" for example
be sure to download armhf and stretch version of those deb

I put a script in my sysroot to install .deb files into the sysroot
just put the .deb into the sysroot/tmp folder and run unpack.sh
this will unpack all packages into the sysroot

@avilleret
Copy link
Member

hopefully, everyone is sleeping so the WIFI hostel is very fast tonight, here is my updated sysroot : https://www.dropbox.com/s/koekcmmpw00sews/sysroot-ofnode_0.10.tar.gz

@gsautr
Copy link

gsautr commented Feb 3, 2019

Sorry for the late reply!

  • Installed GCC 8.2.0 and added to Ubuntu path: echo 'export PATH=/opt/cross-compiler/bin:$PATH' >> .bashrc && echo 'export LD_LIBRARY_PATH=/opt/cross-compiler/lib:$LD_LIBRARY_PATH' >> .bashrc
  • OF successfully compiled, folder structure is ls ~/ofnode/ build-ofApp-rpi build-of-rpi of ofApp sysroot-autr sysroot-avilleret
  • ofApp build against sysroot-avilleret missing librt libresolv libgomp ?

Here's the output:

[9/9] Linking CXX executable /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release
FAILED: /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release
: && /usr/bin/arm-linux-gnueabihf-g++ --sysroot=/home/pi/ofnode/sysroot-avilleret  -fdiagnostics-color -std=gnu++14 -O3 -DNDEBUG -Wno-narrowing -Wno-deprecated-declarations -g1 -Wno-psabi -march=armv7-a -mfpu=vfp -mfloat-abi=hard -fPIC  -rdynamic CMakeFiles/ofApp.dir/src/main.cpp.o CMakeFiles/ofApp.dir/src/ofApp.cpp.o  -o /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release -L/home/pi/ofnode/sysroot-avilleret/opt/vc/lib -Wl,-rpath,/opt/vc/lib:/home/pi/ofnode/of/lib-linux/release-armv7-32: -Wl,-rpath-link,/home/pi/ofnode/sysroot-avilleret/usr/lib:/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot-avilleret/lib:/home/pi/ofnode/sysroot-avilleret/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot-avilleret/opt/vc/lib -Wl,-rpath,'$ORIGIN' -lbcm_host -lvcos -lvchiq_arm -lboost_system -lboost_filesystem -lcurl -lfreeimage /home/pi/ofnode/of/lib-linux/release-armv7-32/libopenFrameworks.so -lXi -lSM -lICE -lX11 -lXext -lXrandr -lXcursor -lXxf86vm -lXinerama -lz -lcairo -lssl -lcrypto -lfreetype -lfontconfig -lfreetype -lpthread -lpugixml -lglut -luriparser -lXmu -ldl /home/pi/ofnode/sysroot-avilleret/opt/vc/lib/libbrcmEGL.so /home/pi/ofnode/sysroot-avilleret/opt/vc/lib/libbrcmGLESv2.so -lasound -lopenal -lmpg123 -lsndfile -ludev -lglib-2.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lssl -lcrypto -lfreetype -lfontconfig -lfreetype -lpthread -lpugixml -lglut -luriparser -lXmu -ldl /home/pi/ofnode/sysroot-avilleret/opt/vc/lib/libbrcmEGL.so /home/pi/ofnode/sysroot-avilleret/opt/vc/lib/libbrcmGLESv2.so -lasound -lopenal -lmpg123 -lsndfile -ludev -lglib-2.0 -lgstreamer-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstvideo-1.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lgdk_pixbuf-2.0 -lgio-2.0 && :
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: warning: librt.so.1, needed by /home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libboost_system.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: warning: libresolv.so.2, needed by /home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libgssapi_krb5.so.2, not found (try using -rpath or -rpath-link)
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: warning: libgomp.so.1, needed by /home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15, not found (try using -rpath or -rpath-link)
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_dynamic_start@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so: undefined reference to `clock_getres@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_dynamic_next@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `omp_get_num_threads@OMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_guided_start@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `ns_name_uncompress@GLIBC_2.9'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `ns_parserr@GLIBC_2.9'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2: undefined reference to `__res_query@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_critical_name_start@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_parallel@GOMP_4.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_end@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `ns_initparse@GLIBC_2.9'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libkrb5.so.3: undefined reference to `__res_nsearch@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_end_nowait@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2: undefined reference to `__dn_expand@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libgdk-3.so: undefined reference to `shm_unlink@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_barrier@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libcairo.so: undefined reference to `clock_gettime@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/lib/arm-linux-gnueabihf/libsystemd.so.0: undefined reference to `mq_getattr@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `omp_get_thread_num@OMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_loop_guided_next@GOMP_1.0'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libgdk-3.so: undefined reference to `shm_open@GLIBC_2.4'
/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libraw.so.15: undefined reference to `GOMP_critical_name_end@GOMP_1.0'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Is there something to be added to restore-link.sh to cover these?

@gsautr
Copy link

gsautr commented Feb 3, 2019

Success! Silly mistake - I needed to name the GCC dir correctly to /opt/cross-pi-gcc/ before running the build.

[9/9] Linking CXX executable /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release
# From Ubuntu
$ scp /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release [email protected]:~/
# From Pi
$ ./ofApp-armv7-Release
./ofApp-armv7-Release: error while loading shared libraries: libopenFrameworks.so: cannot open shared object file: No such file or directory

Will this run on Stretch if armv7 or should I install Arch for testing?

@gsautr
Copy link

gsautr commented Feb 3, 2019

Any idea why the executable can't find its libraries? It seems to be added correctly during the build process.

./ofApp-armv7-Release: error while loading shared libraries: libopenFrameworks.so: cannot open shared object file: No such file or directory
-- OPENFRAMEWORKS_LIBRARIES : -Wl,-rpath-link,/home/pi/ofnode/sysroot-avilleret/usr/lib:/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot-avilleret/lib:/home/pi/ofnode/sysroot-avilleret/lib/arm-linux-gnueabihf:/home/pi/ofnode/sysroot-avilleret/opt/vc/lib;-Wl,-rpath,'$$ORIGIN';bcm_host;vcos;vchiq_arm;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libboost_system.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libboost_filesystem.so;curl;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libfreeimage.so;/home/pi/ofnode/of/lib-linux/release-armv7-32/libopenFrameworks.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libXi.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libX11.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libXext.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libXrandr.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libXcursor.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libXxf86vm.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libXinerama.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libz.so;cairo;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libssl.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libcrypto.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libfreetype.so;fontconfig;freetype;-lpthread;pugixml;glut;uriparser;Xmu;dl;/home/pi/ofnode/sysroot-avilleret/opt/vc/lib/libbrcmEGL.so;/home/pi/ofnode/sysroot-avilleret/opt/vc/lib/libbrcmGLESv2.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libasound.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libopenal.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libmpg123.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libsndfile.so;/home/pi/ofnode/sysroot-avilleret/lib/arm-linux-gnueabihf/libudev.so;/home/pi/ofnode/sysroot-avilleret/usr/lib/arm-linux-gnueabihf/libglib-2.0.so;gstreamer-1.0;gobject-2.0;glib-2.0;gstapp-1.0;gstbase-1.0;gstreamer-1.0;gobject-2.0;glib-2.0;gstbase-1.0;gstreamer-1.0;gobject-2.0;glib-2.0;gstvideo-1.0;gstbase-1.0;gstreamer-1.0;gobject-2.0;glib-2.0;gtk-3;gdk-3;pangocairo-1.0;pango-1.0;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0
-- CXX target ofApp cotired without unity build.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ofnode/build-ofApp-rpi
[9/9] Linking CXX executable /home/pi/ofnode/ofApp/bin/ofApp-armv7-Release

@avilleret
Copy link
Member

avilleret commented Feb 3, 2019

Any idea why the executable can't find its libraries? It seems to be added correctly during the build process.

hum... when linking dynamically to openFrameworks, you should have copied the libopenFrameworks.so to your Raspberry Pi
Usually, the binary try to find it where it was build.
But when you're crosscompiling, it's more likely you don't have the same folder structure on the computer you run the build than on the Raspberry pi where you run the binary.
That's why I added a convenient install target that copy libopenframeWorks.so and the data folder to a directory of your choice.
Then you just have to copy that directory to the Pi and it should work.
To use it, be sure to grab the latest changes from Git, then add your install folder to configure step with :

cmake . -DCMAKE_INSTALL_PREFIX=${PWD}/install

for example, to put it in an install folder inside the build folder.
Then build the install target with :

ninja install

you can now copy the install folder to your raspberry pi

@gsautr
Copy link

gsautr commented Feb 3, 2019

Sorry if I find this quite confusing - my understanding is that a compiled app contains all its libraries / binaries needed to run. Is a dynamic library something that can be placed elsewhere / outside of the app - in this case the compiled libopenFrameworks.so?

At the moment I am trashing and building from scratch with the latest 0.10 branch like so:

#### OF ####

# Clone ofNode 0.10 branch 

cd ~/ofnode && rm -rf of && git clone --depth 1 --recursive --branch 0.10 https://github.com/ofnode/of.git

cd ~/ofnode && sudo rm -rf build-of-rpi && mkdir build-of-rpi && pushd build-of-rpi && cmake ../of -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -G Ninja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot-avilleret"` && ninja

#### ofApp ####

# Clone ofApp

cd ~/ofnode && rm -rf ~/ofnode/ofApp && git clone https://github.com/ofnode/ofApp.git

cd ~/ofnode && sudo rm -rf build-ofApp-rpi && mkdir build-ofApp-rpi && pushd build-ofApp-rpi && cmake ../ofApp -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -G Ninja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot-avilleret"` && ninja

At what stage and how should I add the libopenFrameworks.so relative to the path of the compiled app? And is it a relative or absolute path?

I have OF 0.10 compiled on the Pi also, so is there a location within the OF folder that would reference libopenFrameworks.so?

Thanks!

@gsautr
Copy link

gsautr commented Feb 3, 2019

OK, working! 🙌

Just did: scp -r /home/pi/ofnode/of/lib-linux/ [email protected]:~/ofnode/of to reference the library. Though is there a way to link the OF library statically, to keep things simple?

I will try rebuilding the sysroot from scratch with a fresh install of Raspbian because I'd like to help update the sysroot guide. Is what's there correct before I start?

Thanks again!

@gsautr
Copy link

gsautr commented Feb 3, 2019

Does the install method add the libraries statically or install them to a certain location?

cd ~/ofnode
rm -rf ~/ofnode/ofApp
git clone https://github.com/ofnode/ofApp.git

cd ~/ofnode
rm -rf ~/ofnode/build-ofApp-rpi 
mkdir build-ofApp-rpi 
mkdir build-ofApp-rpi/install 
pushd build-ofApp-rpi 
cmake ../ofApp -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -DCMAKE_INSTALL_PREFIX=${PWD}/install -G Ninja -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot-avilleret"` 
ninja install

[9/10] Install the project...
-- Install configuration: "Release"
-- Installing: /home/pi/ofnode/build-ofApp-rpi/install/./ofApp-armv7-Release
-- Set runtime path of "/home/pi/ofnode/build-ofApp-rpi/install/./ofApp-armv7-Release" to "$ORIGIN/lib:$ORIGIN"
CMake Error at cmake_install.cmake:61 (file):
  file INSTALL cannot find "/home/pi/ofnode/ofApp/bin/data".


FAILED: CMakeFiles/install.util
cd /home/pi/ofnode/build-ofApp-rpi && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.

@avilleret
Copy link
Member

Sorry if I find this quite confusing - my understanding is that a compiled app contains all its libraries / binaries needed to run. Is a dynamic library something that can be placed elsewhere / outside of the app - in this case the compiled libopenFrameworks.so?

If an executable depends on a method that is implemented in another library it needs to be linked to that library. It can be link either dynamically or statically. When linking statically the library is copied into the executable binary and then it doesn't depend on an external library.
In case of dynamically linking, the methods are referenced in the executable and it need to load an external "shared" library to get their definition. To do so, the executable keep a list of all library to link at startup. It look to those library in some standard paths (like /usr/llib, /usr/local/lib and paths defined in LD_LIBRARY_PATH...) but you can also hint the executable by adding some paths to the list.
And this what this line https://github.com/ofnode/of/blob/0.10/openFrameworks.cmake#L14 does.
it add a directory called lib in the same folder as the binary (the $ORIGIN variable) to the search path.

Then during the install step the libopenFrameworks.so is copied in the lib folder and the data folder is copied next to the binary.

Though is there a way to link the OF library statically, to keep things simple?

linking statically could fine in some way, but sometimes it's not allowed by the library licence, or no static version of the library exist.
Also linking statically increase deeply the executable size.
And you have to relink your executable to all libraries that the first one depends on (which could be a lot for complex project like openframeworks)
So sometimes linking statically just move the issue to the next level.

@gsautr
Copy link

gsautr commented Feb 3, 2019

OK, thanks for explaining. I'm still unsure how to perform the install step however - is the install dir made in the ofApp or build-of-ofApp folder? And should the flag be added to the initial generation of CMake files?

Another question is Addon usage - I tried for example compiling the ofxOMXPlayer examples (both V2 and original ) but without success. Inside the openFrameworks.cmake there seem to be conditionals for different addons - so is it then a limitation of the cmake approach that Addons need additional configuration? ie. Ninja interprets differently to Make?

@avilleret
Copy link
Member

is the install dir made in the ofApp or build-of-ofApp folder?

the application is installed where you want, and you define it with CMAKE_INSTALL_PREFIX, in the example above :

cmake . -DCMAKE_INSTALL_PREFIX=${PWD}/install

${PWD} contains the current folder path, in this case this is the build folder. So after a ninja make there will be an install folder inside the build folder containing the application and the libopenFrameworks.so.

And should the flag be added to the initial generation of CMake files?
no, you can run the configuration once, build the lib, then re-run cmake to define CMAKE_INSTALL_PREFIX and install without the need to rebuild the whole project.
That's the power of CMake.

ninja is just a build tool just as make. cmake let you generate build configuration for different tool. I'm using ninja because it is far faster than make but you could use make if you want (in that case just remove the -GNinja flag from the first cmake call. You can also generate Visual Studio Solution and XCode project but I never try them with ofnode.

Concerning the addon, there is a CMake function called ofxaddon() that let you add an addon dependency. This should have been documented somewhere. Anyway, after cloning ofxOMXPlayer beside your CMakeLists.txt just add ofxaddon(ofxOMXPlayer) to it and cmake will try to parse addon configuration file to build it and link against. But it doesn't work everytime, I tried to parse addon configuration but some of the original openFrameworks behavior is hard to reproduce or lead to disaster in the build engine.
So sometimes you have to tweak it a little bit.

@gsautr
Copy link

gsautr commented Feb 6, 2019

OK thanks for the clarification. For these purposes I’m using make system as I believe its also what’s used for CI and test builds over here.

Re. OMXPlayer examples - it has dependencies - so my assumption is that this would necessitate a rebuild of the sysroot?

In which case would it not also be possible instead to use a live mounted Pi via Samba as outlined in the cross-compile guide here.

Re. a local sysroot build, this is the process I’m attempting in mind of creating a bash install script.

From Pi

export dependency_list="
	xorg-dev							  
	libgtk-3-dev						  
	libboost-filesystem-dev				  
	libboost-system-dev					  
	libboost-filesystem1.62.0			  
	libboost-system1.62.0				  
	libudev-dev							  
	libcairo2-dev						  
	libusb-1.0-0-dev					  
	libssl-dev							  
	libfreetype6-dev					  
	libfreetype6						  
	libfontconfig1-dev					  
	libglu1-mesa-dev					  
	libmpg123-dev						  
	libopenal-dev						  
	libassimp-dev						  
	libopencv-dev						  
	libasound2-dev						  
	libsndfile1-dev						  
	gstreamer1.0-x						  
	gstreamer1.0-alsa					  
	gstreamer1.0-libav					  
	gstreamer1.0-pulseaudio				  
	gstreamer1.0-plugins-base			  
	gstreamer1.0-plugins-good			  
	gstreamer1.0-plugins-bad			  
	gstreamer1.0-plugins-ugly			  
	libgstreamer1.0-dev					  
	libgstreamer-plugins-base1.0-dev	  
	libcurl4-openssl-dev				  
	liburiparser-dev					  
	libpugixml-dev						  
	zlib1g-dev							  
	zlib1g								  
	libpng16-16							  
	libasound2							  
	libudev1							  
	libglib2.0-0						  
	libfreeimage-dev					  
	freeglut3-dev						  
	freeglut3							  
	libx11-6							  
	libxext6							  
	libssl1.1							  
	libselinux1							  
	libpcre3							  
	libmount-dev						  
	liblzma5							  
	libxau6								  
	libffi6								  
	libxdmcp6							  
	libbsd0								  
	libblkid1							  
	libdbus-1-3							  
	libdrm2								  
	libsystemd0							  
	libuuid1							  
	liblz4-1							  
	libgcrypt20							  
	libgpg-error0						  
	libusb-1.0-0						  
	libjpeg62-turbo						  
	libcurl3							  
	libxml2								  
	libnghttp2-14						  
	libidn2-0							  
	librtmp1							  
	libglew2.0							  
	libgl1-mesa-glx 					  
	libavcodec-dev						  
	libavdevice-dev						  
	libavfilter-dev						  
	libavformat-dev						  
	libavresample-dev					  
	libavutil-dev						  
	libpostproc-dev						  
	libswresample-dev					  
	libswscale-dev"

yes | sudo apt install $dependency_list
yes | sudo aptitude --download-only install $dependency_list
yes | sudo aptitude --download-only reinstall $dependency_list

rm -rf ~/sysroot-pi
mkdir ~/sysroot-pi
cd ~/sysroot-pi
for deb in /var/cache/apt/archives/*.deb; do dpkg-deb -xv $deb .; done

From Ubuntu

export install_dir=~/ofnode
export sysroot_dir=$install_dir/sysroot-host

mkdir $install_dir
cd $install_dir 
sudo rm -rf sysroot-host
sudo rm -rf sysroot-pi
rsync -hvrPtl [email protected]:~/sysroot-pi .
mv sysroot-pi sysroot-host

cd $sysroot_dir/usr/lib/arm-linux-gnueabihf
ln -fs  ../../../lib/arm-linux-gnueabihf/libz.so.1 libz.so
ln -fs  ../../../lib/arm-linux-gnueabihf/libglib-2.0.so.0 libglib-2.0.so
ln -fs  ../../../lib/arm-linux-gnueabihf/libpcre.so.3 libpcre.so
ln -fs  ../../../lib/arm-linux-gnueabihf/libblkid.so.1.1.0 libblkid.so
ln -fs  ../../../lib/arm-linux-gnueabihf/libusb-1.0.so.0.1.0 libusb-1.0.so
ln -fs  ../../../lib/arm-linux-gnueabihf/liblzma.so.5.2.2 liblzma.so
ln -fs  ../../../lib/arm-linux-gnueabihf/libexpat.so.1.6.2 libexpat.so
ln -fs  ../../../lib/arm-linux-gnueabihf/libdbus-1.so.3.14.15 libdbus-1.so

cd $sysroot_dir/usr
rsync -hvrPtl [email protected]:/usr/include .

cd $sysroot_dir
mkdir opt
cd opt
rsync -hvrPtl [email protected]:/opt/vc .

Build OF and ofApp example

cd $install_dir 
rm -rf of 
git clone --depth 1 --recursive --branch 0.10 https://github.com/ofnode/of.git

cd $install_dir 
sudo rm -rf build-of-rpi 
mkdir build-of-rpi 
pushd build-of-rpi 
cmake ../of -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot-avilleret"` 
make -j4

Success

cd $install_dir
rm -rf $install_dir/ofApp
git clone https://github.com/ofnode/ofApp.git

cd $install_dir
rm -rf $install_dir/build-ofApp-rpi 
mkdir build-ofApp-rpi 
pushd build-ofApp-rpi 
cmake ../ofApp -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot-avilleret"` 
make -j4

Success

Build example-basic from OMXPlayer v2

Same example builds correctly from RPI, but not via CMake method:

cd $install_dir
cp -r of/addons/ofxOMXPlayer/example-basic/ ./omxplayer-example
cp ofApp/CMakeLists.txt omxplayer-example/
sudo nano omxplayer-example/CMakeLists.txt

# Edit to add ofxaddon(ofxOMXPlayer)

rm -rf $install_dir/build-omx 
mkdir build-omx 
pushd build-omx 
cmake ../omxplayer-example -DCMAKE_TOOLCHAIN_FILE=../of/dev/arm-linux-gnueabihf.cmake -DCMAKE_SYSROOT=`realpath "${PWD}/../sysroot-avilleret"` 
make -j4

Error:

In file included from /media/psf/gilbertsinnott/ofnode/build-omx/cotire/ofApp_CXX_prefix.cxx:8,
from /media/psf/gilbertsinnott/ofnode/build-omx/cotire/ofApp_CXX_prefix.hxx:4:
/media/psf/gilbertsinnott/ofnode/of/addons/ofxOMXPlayer/src/KeyConfig.h:4:7: error: redefinition of ‘class KeyConfig’
class KeyConfig
^~~~~~~~~
In file included from /media/psf/gilbertsinnott/ofnode/of/addons/ofxOMXPlayer/src/ofxOMXPlayerEngine.h:12,
from /media/psf/gilbertsinnott/ofnode/of/addons/ofxOMXPlayer/src/ofxOMXPlayer.h:3,
from /media/psf/gilbertsinnott/ofnode/build-omx/cotire/ofApp_CXX_prefix.cxx:6,
from /media/psf/gilbertsinnott/ofnode/build-omx/cotire/ofApp_CXX_prefix.hxx:4:
/media/psf/gilbertsinnott/ofnode/of/addons/ofxOMXPlayer/src/KeyConfig.h:4:7: note: previous definition of ‘class KeyConfig’

@avilleret
Copy link
Member

Re. OMXPlayer examples - it has dependencies - so my assumption is that this would necessitate a rebuild of the sysroot?

not a rebuild, but an update yes, iirc you need libavfilter-dev at least (which is not needed by of itself)

In which case would it not also be possible instead to use a live mounted Pi via Samba as outlined in the cross-compile guide here.

this is of course feasible but way slower than having it on a local SSD.
in the same way, you can copy your SD card content locally (either with dd or anything else that keep symbolic link) and then share this folder over the network and boot your pi from the network
this is also slower.

The easiest way to make a sysroot is to build of from scratch on RPi (and this install all needed libraries) and then copy the sd card to your computer. This is quite easy but you'll end up with a huge amount of unneeded things.

My current workflow is :

  • cross building application from Archlinux with custom sysroot (more or less the one I send to you) and gcc 8.2.0

  • then make a self containing folder with app and library thanks to custom install rules,

  • then sync it to my RPis with more or less the following

    rsync -hvrPtl package/ [email protected]:~/package

concerning ofxOMXPlayer I'm using it, but I didn't build example yet, though it's planned for this afternoon

@avilleret
Copy link
Member

concerning ofxOMXPlayer, there are couple of things to tweak
please look at : https://github.com/avilleret/ofxOMXPlayer
there is a pending PR here : jvcleave/ofxOMXPlayer#140

and concerning the CMakelists.txt here is mine :
CMakeLists.txt

@gsautr
Copy link

gsautr commented Feb 11, 2019

Fantastic, thanks for the clarification ... for ease, at the moment I'm using RPI_ROOT as outlined in the guide for 0.9.8 - as it's also useful for testing this method and the Travis / CI scripts in the OF main repo.

OF examples are compiling fine, but the example-basic from your fork of ofxOMXPlayer is returning;

/opt/cross-pi-gcc/lib/gcc/arm-linux-gnueabihf/8.2.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lilclient

Might I need to update the symlinks for the dependencies in the RPI_ROOT ?

@Morwenn
Copy link

Morwenn commented Sep 17, 2019

I tried to use this fork to integrate it in a Conan architecture (where switching to 0.10 to avoid the OpenSSL issue mattered) and managed to get most of the CMake working, however it seems that something is missing: there isn't any install target in the generated Makefile, which means that I have to copy all the generated files "by hand" instead of benefiting from the CMake installation support.

There seems to be some install rules in a macro in the file openFrameworks.cmake but they are never called when building the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants