bakercp / ofxDlib

An openFrameworks wrapper for dlib. http://dlib.net/
MIT License
52 stars 16 forks source link

bootstrap.sh not working on Raspberry Pi #26

Closed neilmendoza closed 5 years ago

neilmendoza commented 5 years ago

Hi,

I ran bootstrap.sh with OF from github. First error I got was that it couldn't find multistrap so I had to add /usr/sbin to the path. Next there was a permission error...

chroot: cannot change root directory to '/home/pi/openFrameworks/scripts/apothecary/scripts/linuxarmv6l/raspbian/': Operation not permitted

...so I sudo'ed it. Now up to this error...

chfn: PAM: Authentication failure adduser: `/usr/bin/chfn -f systemd Time Synchronization systemd-timesync' returned error code 1. Exiting. dpkg: error processing package systemd (--configure): subprocess installed post-installation script returned error exit status 1 Setting up libatk-bridge2.0-0:armhf (2.22.0-2) ... Setting up sysv-rc (2.88dsf-59.9) ... Setting up initscripts (2.88dsf-59.9) ... invoke-rc.d: could not determine current runlevel invoke-rc.d: WARNING: No init system and policy-rc.d missing! Defaulting to block. Setting up libharfbuzz-dev:armhf (1.4.2-1) ... Setting up libavformat57:armhf (7:3.2.12-1~deb9u1) ... Setting up dconf-gsettings-backend:armhf (0.26.0-2) ... Setting up gir1.2-gstreamer-1.0 (1.10.4-1) ... Setting up libgstreamer-plugins-base1.0-0:armhf (1.10.4-1+deb9u1) ... Setting up gstreamer1.0-plugins-base:armhf (1.10.4-1+deb9u1) ... Setting up libpulse-dev:armhf (10.0-1+deb9u1) ... Setting up gsettings-desktop-schemas (3.22.0-1) ... Setting up libcairo2-dev (1.14.8-1) ... Setting up gstreamer1.0-pulseaudio:armhf (1.10.4-1) ... Setting up libxmu-dev:armhf (2:1.1.2-2) ... Setting up libgtk-3-common (3.22.11-1+rpi1) ... Setting up initramfs-tools-core (0.130) ... Setting up libavfilter6:armhf (7:3.2.12-1~deb9u1) ... Setting up libpangoxft-1.0-0:armhf (1.40.5-1) ... Setting up gir1.2-gst-plugins-base-1.0 (1.10.4-1+deb9u1) ... Setting up libatk1.0-dev:armhf (2.22.0-1) ... Setting up initramfs-tools (0.130) ... update-initramfs: deferring update (trigger activated) Setting up libpangocairo-1.0-0:armhf (1.40.5-1) ... Setting up gir1.2-pango-1.0:armhf (1.40.5-1) ... dpkg: dependency problems prevent configuration of plymouth: plymouth depends on systemd (>= 232-8~); however: Package systemd is not configured yet.

dpkg: error processing package plymouth (--configure): dependency problems - leaving unconfigured Setting up libgstreamer-plugins-bad1.0-0:armhf (1.10.4-1) ... Setting up dropbear-initramfs (2016.74-5+deb9u1) ... Generating Dropbear DSS host key. Please wait. Generating key, this may take a while... Public key portion is: ssh-dss AAAAB3NzaC1kc3MAAACBAPK1krExkD2IfGWkDhqu5gcmrAUeRyhFr3PDgVuww8n0IFdDu4yUn9xK8tK0FADRigk2pxTjzozmJUBUpnONfPGIVVX90DsOrwCs2vyYSM4EpVf5A6wugA6w1j/kj3EoGiVRR8BfC+FvQI3vuE6oZv9WbMH2wIZkmijZKm/rCnk/AAAAFQC9y4874GnU4KniKg08KkiYcAKNIQAAAIEA5DP2L3MOtzjN8s5/9FBvU8HZ5fMmwhm6k4HUXMbvxVBSyqQSN9ub321vuyosIrgbSxDdQVGB5g/UlHByDHCJW4GhDaNzhcZeD1atLCW56yEQ9rSfanJOYvnGRblPIGKoSq0WkFAbFxF9cLmo3v16/8snpQwoV95D/cusAE0VzbQAAACAQYysfp/FzNXclfvzF0pl7h3Aao5aR20czlPxtEKyEOs95SSyUx9znb01UmawbVSPwbXlzGUc/KaU4U2RoVl7IGYQpnAdfjo0Aesa7ING3ryBeQpJ4tWbmeK8xP1w1UOvxb2014PwITQfvPAz2r5+Q/YbGvoef/KagzdBlrVajk8= root@raspberrypi Fingerprint: md5 5c:ad:12:b6:ea:1d:c0:54:84:f4:8e:ce:36:16:b9:a9 Generating Dropbear RSA host key. Please wait. Generating key, this may take a while... Public key portion is: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4mOl1Xc2nDtxvuDrEldgtZeJMX8fjmzU1VSCJYpzaIzNcpxioVhwzUg0juGLqu+P96GlAW3jkJpVP+tS98SE0tmT0sDP+WsjqXY7Tuwb1mVxkv7BthBB2no/TY4IbKt2owCfHan9WgibJ5Bb4vmD1drllzMOXZndI6LHcNGRIrz6VOOxWBh40uA13WOzYDpzcLYvcirg7olTE9adh1JfjqkspsEaSPpP1TAkLleWxplzObLB/iqmX7WQ+XZ8LO8fWj9QXw0RNm8NmLG2EzAZz5DxY8iufHV7n781gtQVI9LdGdo/St+4zpbvhl2ITsUfCzFPUXc5SH1JXAAOUSFgz root@raspberrypi Fingerprint: md5 21:f8:46:74:99:26:13:41:67:9d:77:1e:94:58:60:28 Generating Dropbear ECDSA host key. Please wait. Generating key, this may take a while... Public key portion is: ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAVrPKBOA2/s7MYAp2w+XeggnkZhmKUab2Fg/JYy1CcKdEGhsTfBGG+UviC+lRZ9SaKlidYWqaiUZmIfdHRgkpz6wAhOKOnbv2PXi30Q6LaIN7Qwb06pYMLspc/9pE6TS1eGsMFwVjEY0fiBlGHR46HzV0OE2Lq4OeI4oAavZ6LmKL8XQ== root@raspberrypi Fingerprint: md5 e8:00:a6:23:fc:29:6b:55:e4:37:4f:7f:18:46:fe:e4 Setting up glib-networking:armhf (2.50.0-1) ... Setting up libavformat-dev:armhf (7:3.2.12-1~deb9u1) ... Setting up libpango1.0-dev (1.40.5-1) ... Setting up librtaudio-dev:armhf (4.1.2~ds0-4) ... Setting up gstreamer1.0-x:armhf (1.10.4-1+deb9u1) ... Setting up libgstreamer1.0-dev (1.10.4-1) ... Setting up gstreamer1.0-alsa:armhf (1.10.4-1+deb9u1) ... dpkg: dependency problems prevent configuration of mountall: mountall depends on plymouth; however: Package plymouth is not configured yet.

dpkg: error processing package mountall (--configure): dependency problems - leaving unconfigured Setting up dropbear (2016.74-5+deb9u1) ... Setting up gstreamer1.0-libav:armhf (1.10.4-1) ... Setting up librsvg2-2:armhf (2.40.16-1) ... Setting up libsoup2.4-1:armhf (2.56.0-2+deb9u2) ... Setting up libsoup-gnome2.4-1:armhf (2.56.0-2+deb9u2) ... Setting up librsvg2-common:armhf (2.40.16-1) ... Setting up libgstreamer-plugins-base1.0-dev (1.10.4-1+deb9u1) ... Setting up librest-0.7-0:armhf (0.8.0-2) ... Setting up gstreamer1.0-plugins-good:armhf (1.10.4-1) ... Setting up adwaita-icon-theme (3.22.0-1+deb9u1) ... update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode Setting up libgtk2.0-0:armhf (2.24.31-2) ... Setting up libgtk-3-0:armhf (3.22.11-1+rpi1) ... Setting up libopencv-highgui2.4-deb0:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-objdetect2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up gir1.2-gtk-2.0 (2.24.31-2) ... Setting up libgtk2.0-dev (2.24.31-2) ... Setting up libopencv-features2d2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-highgui-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-features2d-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-calib3d2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-calib3d-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-legacy2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-ts2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-contrib2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-legacy-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-gpu2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-objdetect-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up gstreamer1.0-plugins-bad:armhf (1.10.4-1) ... Setting up libhighgui-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv2.4-jni (2.4.9.1+dfsg1-2) ... Setting up libcv-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-contrib-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-ocl2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-stitching2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-gpu-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-ts-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv2.4-java (2.4.9.1+dfsg1-2) ... Setting up libopencv-videostab2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libcvaux-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-superres2.4v5:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-videostab-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-ocl-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-stitching-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-superres-dev:armhf (2.4.9.1+dfsg1-2) ... Setting up libopencv-dev (2.4.9.1+dfsg1-2) ... Processing triggers for libc-bin (2.24-11+deb9u4) ... Processing triggers for initramfs-tools (0.130) ... Processing triggers for libgdk-pixbuf2.0-0:armhf (2.36.5-2+deb9u2) ... Errors were encountered while processing: raspbian-archive-keyring systemd plymouth mountall ERR: dpkg configure reported an error. Native mode configuration reported an error! I: Tidying up apt cache and list data. I: Tidying up apt cache and list data.

Multistrap system reported 1 error in /home/pi/openFrameworks/scripts/apothecary/scripts/linuxarmv6l/raspbian/.

bakercp commented 5 years ago

Hi @neilmendoza -- I don't recognize a lot of those errors so I'll have to find a pi and check it out. For reference were you using a clean RPi install? If so, what OS and version were you using?

neilmendoza commented 5 years ago

Hey, yes clean Pi with install of OF from repo after having run the install scripts and compiled the PG. Am running the latest version of the Raspbian, Stretch. You think I might have more luck using the stable version of OF from the site rather than the github version? Thanks!

bakercp commented 5 years ago

I'd definitely use a release version of OF rather than installing from the github repo on a PI. The release will install much more quickly ... compiling all of the required libs on the PI is a bit slow. You shouldn't need to install PG, etc since you usually just copy a Makefile from the OF/scripts/template/linux directory. The ofxDlib bootstrap script should take care of installing apothecary, etc.. and building the libs.

bakercp commented 5 years ago

(the master version of ofxDlib should be synced with 0.10.1 https://openframeworks.cc/versions/v0.10.1/of_v0.10.1_linuxarmv6l_release.tar.gz)

neilmendoza commented 5 years ago

Just tried with a clean Pi and 0.10.1 and got the same issues...

bakercp commented 5 years ago

@neilmendoza Hm. Sorry for the troubles. I'll take a look as soon as I get a chance.

neilmendoza commented 5 years ago

No worries. Thank you for the addon!

bakercp commented 5 years ago

Ok, I just had a chance to run this. So the bootstrap.sh and ofx automation scripts automatically install apothecary in order to compile the libraries. Apothecary has installation scripts that allow it to run natively on the normal platforms (e.g. macOS installs some utilities via brew and on desktop linux it installs some relevant utilities etc). The apothecary install scripts are here. I just noticed that the linuxarmv6l scripts which are called when installing apothecary on RPi are actually setting up a cross-compiler to be run on a linux/64 host ... which makes sense because that is typically how apothecary is used. In this case though, we want to use apothecary to compile on the RPi itself ... so a fix basically just means that we need to manually compile dlib or I need to update my ofx utility to be smarter ... or we need to do a PR in the apothecary scripts to allow for native apothecary installations (which would basically just look like this. Ha, and as I'm looking at apothecary issues it appears you've run into similar problems :) https://github.com/openframeworks/apothecary/issues/99

Anyway, I'll think on this a little and see what I can come up with ...

bakercp commented 5 years ago

OK, here's what I did to make it work ...

First get my apothecary updates, assuming you tried running boostrap.sh already and clone the openFrameworks/apothecary master ...

cd of_v0.10.1_linuxarmv6l_release/scripts/apothecary
git pull https://github.com/bakercp/apothecary.git rpi-native-compile

Next, get ofxDlib

cd of_v0.10.1_linuxarmv6l_release/addons
git clone https://github.com/bakercp/ofxDlib.git
git checkout bakercp-patch-1

Next run bootstrap ...

cd scripts
./bootstrap.sh

I think that is all of the pieces ...

I haven't tested a bunch of examples yet, but it seems to be compiling. Let me know.

neilmendoza commented 5 years ago

Hey, thanks so much for looking into that. I actually had to ship the project I needed it for so went with a non-ARM computer for now. Will have a look at getting it compiled on a Pi next week as might be able to swap it out.

bakercp commented 5 years ago

Cool, I'm curious to hear about your project with dlib on RPi -- I've done a bunch of performance testing w/ dlib on Rpi (see here) and am going to get these compiler settings integrated into the apothecary formula at some point. Since the apothecary update is running and I confirmed that everything is working with the bootstrap script, I'm going to merge and close this issue, though do keep me posted on how you use ofxDlib on the pi. I'm curious :)