Discussion:
Cross-compile for RPi
Benjamin
2018-08-04 15:08:58 UTC
Permalink
I know it's a rather general question, but how would I go about
cross-compiling Subsurface on a laptop in order to get a binary for a
Raspberry Pi 3 running Raspbian stretch? And is it possible to generate an
AppImage of Subsurface for this?

It's a rather edge case, but I'm wanting to have a small computer which I
can VNC into or even set up an automatic set of scripts in order to
download dives from 3 dive computers instead of having to get to a
laptop/PC after every set of dives which the dive computers can store.

Benjamin
Dirk Hohndel
2018-08-04 15:26:46 UTC
Permalink
I know it's a rather general question, but how would I go about cross-compiling Subsurface on a laptop in order to get a binary for a Raspberry Pi 3 running Raspbian stretch? And is it possible to generate an AppImage of Subsurface for this?
It's a rather edge case, but I'm wanting to have a small computer which I can VNC into or even set up an automatic set of scripts in order to download dives from 3 dive computers instead of having to get to a laptop/PC after every set of dives which the dive computers can store.
I know that a couple of people have played with running Subsurface on ARM devices. I think a likely candidate to be able to provide you some pointers would be Philip :-)

/D
Benjamin
2018-08-05 17:15:19 UTC
Permalink
Thank you Dirk :)
Philip, could you maybe help?

Benjamin
Post by Benjamin
Post by Benjamin
I know it's a rather general question, but how would I go about
cross-compiling Subsurface on a laptop in order to get a binary for a
Raspberry Pi 3 running Raspbian stretch? And is it possible to generate an
AppImage of Subsurface for this?
Post by Benjamin
It's a rather edge case, but I'm wanting to have a small computer which
I can VNC into or even set up an automatic set of scripts in order to
download dives from 3 dive computers instead of having to get to a
laptop/PC after every set of dives which the dive computers can store.
I know that a couple of people have played with running Subsurface on ARM
devices. I think a likely candidate to be able to provide you some pointers
would be Philip :-)
/D
Philip Balister
2018-08-06 13:43:38 UTC
Permalink
Post by Benjamin
Thank you Dirk :)
Philip, could you maybe help?
Maybe, but on work travel. I'm not familiar with raspbian, anyone know
if they have cross compilers available.

If I get time, I can look at creating a pi-s image with subsurface. Just
need to figure out how to build subsurface without using the script :)

Philip
Post by Benjamin
Benjamin
Post by Benjamin
Post by Benjamin
I know it's a rather general question, but how would I go about
cross-compiling Subsurface on a laptop in order to get a binary for a
Raspberry Pi 3 running Raspbian stretch? And is it possible to generate an
AppImage of Subsurface for this?
Post by Benjamin
It's a rather edge case, but I'm wanting to have a small computer which
I can VNC into or even set up an automatic set of scripts in order to
download dives from 3 dive computers instead of having to get to a
laptop/PC after every set of dives which the dive computers can store.
I know that a couple of people have played with running Subsurface on ARM
devices. I think a likely candidate to be able to provide you some pointers
would be Philip :-)
/D
Robert Helling
2018-08-09 16:27:30 UTC
Permalink
Hi,
Post by Philip Balister
Maybe, but on work travel. I'm not familiar with raspbian, anyone know
if they have cross compilers available.
If I get time, I can look at creating a pi-s image with subsurface. Just
need to figure out how to build subsurface without using the script :)
I just picked up another raspberry pi to take with me on my summer vacation. It had a Rapberrian based on Debian Squeeze on it. It turns out that lacks qt location. I tried to comment out all location stuff and build without map but so far without success. The other problem is that the imagedownloader throws compile errors starting with

/home/pi/src/subsurface/core/imagedownloader.cpp: In function 'std::pair<QImage, bool> getHashedImage(const QString&, bool)':
/home/pi/src/subsurface/core/imagedownloader.cpp:118:9: error: 'qInfo' was not declared in this scope
qInfo() << "Error loading image" << filename << "[local:" << localFilename << "]";
^
/home/pi/src/subsurface/core/imagedownloader.cpp: In member function 'void Thumbnailer::imageDownloaded(QString)':
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: error: no matching function for call to 'run(QThreadPool*, Thumbnailer::imageDownloaded(QString)::<lambda()>)'
workingOn[filename] = QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
^
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: note: candidates are:
In file included from /usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/QtConcurrent:14:0,
from /home/pi/src/subsurface/core/imagedownloader.cpp:16:
/usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/qtconcurrentrun.h:70:12: note: template<class T> QFuture<T> QtConcurrent::run(T (*)())
QFuture<T> run(T (*functionPointer)())
^
/usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/qtconcurrentrun.h:70:12: note: template argument deduction/substitution failed:
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: note: mismatched types 'T()' and 'QThreadPool'
workingOn[filename] = QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
^
In file included from /usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/QtConcurrent:14:0,
from /home/pi/src/subsurface/core/imagedownloader.cpp:16:
/usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/qtconcurrentrun.h:75:12: note: template<class T, class Param1, class Arg1> QFuture<T> QtConcurrent::run(T (*)(Param1), const Arg1&)
QFuture<T> run(T (*functionPointer)(Param1), const Arg1 &arg1)
^
/usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/qtconcurrentrun.h:75:12: note: template argument deduction/substitution failed:
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: note: mismatched types 'T(Param1)' and 'QThreadPool'
workingOn[filename] = QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
^

and continuing for many screens. I have not really looked into this at any depth but the fact that it seems to be about C++ templates does not make me optimistic. Maybe bstoeger can help.

Right now, I have to run. The next thing to try will be to start with a more recent Debian stretch.

Best
Robert


--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling Elite Master Course Theoretical and Mathematical Physics
Scientific Coordinator
Ludwig Maximilians Universitaet Muenchen, Dept. Physik
Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339
http://www.atdotde.de

Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515 BB44 0820 367C 36BC 0C1D and
DCED 37B6 251C 7861 270D 5613 95C7 9D32 9A8D 9B8F
Jan Iversen
2018-08-09 20:30:22 UTC
Permalink
Just a thought (from a rasberry developer), this platform is pretty weak, so it would make sense to port the mobile version, that should solve some of your problems, while keeping the download functionality.

rgds
jan i

Enviado desde mi iPad
Post by Robert Helling
Hi,
Post by Philip Balister
Maybe, but on work travel. I'm not familiar with raspbian, anyone know
if they have cross compilers available.
If I get time, I can look at creating a pi-s image with subsurface. Just
need to figure out how to build subsurface without using the script :)
I just picked up another raspberry pi to take with me on my summer vacation. It had a Rapberrian based on Debian Squeeze on it. It turns out that lacks qt location. I tried to comment out all location stuff and build without map but so far without success. The other problem is that the imagedownloader throws compile errors starting with
/home/pi/src/subsurface/core/imagedownloader.cpp:118:9: error: 'qInfo' was not declared in this scope
qInfo() << "Error loading image" << filename << "[local:" << localFilename << "]";
^
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: error: no matching function for call to 'run(QThreadPool*, Thumbnailer::imageDownloaded(QString)::<lambda()>)'
workingOn[filename] =QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
^
In file included from /usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/QtConcurrent:14:0,
/usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/qtconcurrentrun.h:70:12: note: template<class T> QFuture<T> QtConcurrent::run(T (*)())
QFuture<T> run(T (*functionPointer)())
^
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: note: mismatched types 'T()' and 'QThreadPool'
workingOn[filename] = QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
^
In file included from /usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/QtConcurrent:14:0,
/usr/include/arm-linux-gnueabihf/qt5/QtConcurrent/qtconcurrentrun.h:75:12: note: template<class T, class Param1, class Arg1> QFuture<T> QtConcurrent::run(T (*)(Param1), const Arg1&)
QFuture<T> run(T (*functionPointer)(Param1), const Arg1 &arg1)
^
/home/pi/src/subsurface/core/imagedownloader.cpp:247:101: note: mismatched types 'T(Param1)' and 'QThreadPool'
workingOn[filename] = QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
^
and continuing for many screens. I have not really looked into this at any depth but the fact that it seems to be about C++ templates does not make me optimistic. Maybe bstoeger can help.
Right now, I have to run. The next thing to try will be to start with a more recent Debian stretch.
Best
Robert
--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling Elite Master Course Theoretical and Mathematical Physics
Scientific Coordinator
Ludwig Maximilians Universitaet Muenchen, Dept. Physik
Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339
http://www.atdotde.de
Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515 BB44 0820 367C 36BC 0C1D and
DCED 37B6 251C 7861 270D 5613 95C7 9D32 9A8D 9B8F
_______________________________________________
subsurface mailing list
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
Robert Helling
2018-08-09 21:06:43 UTC
Permalink
Hi,
Post by Robert Helling
Right now, I have to run. The next thing to try will be to start with a more recent Debian stretch.
success! I started from a fresh stretch image. Had some problems with the required debian packages (as listed in the INSTALL file), some were non-existent, some I had to install manually for whatever reason. But then it built (taking forever). I had to comment out some GL functions from subsurface-desktop-main.cpp as the linker had problems but those affect only the GL version determination. I ended up with a working Subsurface built natively on RaspberryPi (including google maps).

The mentioned problems are not of my concern as my application would be a headless command line version of Subsurface anyway.

Best
Robert
Benjamin
2018-08-10 06:48:32 UTC
Permalink
Good morning

The compile time on the Raspberry seems to stretch towards infinity, which
is why I was wondering about cross-compiling. Also, if we are already
cross-compiling, then the whole idea about an AppImage suddenly starts
making more sense, and...

But before heading down that particular rabbit hole, which parts did you
have to comment out? Unlike with a desktop, the hardware on the Raspberry
is completely standard. If the video card is known to support the GL calls
which are used, would it not make sense to ifdef those calls out and say
that if we are cross-compiling for the platform, then the checks can be
discarded? The hardware itself seems to be stronger than certain laptops
which Subsurface can run on. Or is this just my work life (embedded
systems) bleeding over into my private life? :)

Benjamin

Robert Helling
2018-08-06 11:57:56 UTC
Permalink
Hi,
Post by Dirk Hohndel
I know that a couple of people have played with running Subsurface on ARM devices. I think a likely candidate to be able to provide you some pointers would be Philip :-)
a while ago, I compiled subsurface on a RaspianPi natively without any problems out of the box. I don’t know if since we have picked up dependencies that make this more difficult. In any case I am interested in this as well as I still have the plan to use a RaspberryPi as intermediate between USB dive computers and Subsurface mobile (in particular on iOS).

Best
Robert
Loading...