maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Qt development on-device (N900) (https://talk.maemo.org/showthread.php?t=90701)

szopin 2013-07-10 20:20

Qt development on-device (N900)
 
In case someone needs to do a quick fix on the bus (haven't found any thread about this except chroot option). Managed to get Qrencode (first qt source I found) compiled with just a few steps:

Needed packages (except for standard gcc, used 4.4, 4.6/7 should work, no idea about 4.2) - libqt4-test, libsqlite3-dev, libqt4-dev

libqt4-dev from SDK repo has x86 binary of qmake. This one has ARM version:
https://garage.maemo.org/frs/downloa...0909_armel.deb

The other two packages I grabbed from marmistrz's repo I believe.

Generating makefile works. Make results in a lot of assembler errors though (Error: selected processor does not support ARM mode `ldrex r2,[r3]`). Turning off optimizations helps a bit, down to 4 errors from a few hundred. Not sure if this will help in all cases, but adding:
Code:

-march=armv7-a -marm -mfloat-abi=softfp
to CFLAGS resulted in a successful compile. Binary works.

Now to compile qtcreator...

szopin 2013-07-12 09:52

Re: Qt development on-device (N900)
 
3 Attachment(s)
It works! Kind of.
There's definitely option overload in the main menu (the screenshot with horizontal lines, they are clickable though require a bit of patience), not sure how hard it would be to spread the options into two/three submenus. Some of the editable text fields also behave a bit wonky (display text once you start editing it).
Used libQtDesigner.so's from ubuntu (maemo's 4.5.3 complained on startup when loading few plugins, libqthelp seems to be working), to build you'll also need QtHelp/QtDesigner folders in /usr/include (used the ones from here: http://portal.nersc.gov/svn/visit/ta...4.7.4/include/).
You can put the softfp cflag in /usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf to not have to edit each makefile qmake creates.
Had to use g++ 4.2, mangling of va_lists which usually is just a mildly irritating warning, here results in errors. The garage version of libqt4-dev doesn't install nicely on CSSU (depends = 4.7.0), but still works after dpkg, one just needs to update symlinks in /usr/lib. Building version 2.1.0 on non-overclocked device takes some 18 hours.

jessi3k3 2013-07-12 11:59

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by szopin (Post 1358436)
It works! Kind of.
There's definitely option overload in the main menu (the screenshot with horizontal lines, they are clickable though require a bit of patience), not sure how hard it would be to spread the options into two/three submenus. Some of the editable text fields also behave a bit wonky (display text once you start editing it).
Used libQtDesigner.so's from ubuntu (maemo's 4.5.3 complained on startup when loading few plugins, libqthelp seems to be working), to build you'll also need QtHelp/QtDesigner folders in /usr/include (used the ones from here: http://portal.nersc.gov/svn/visit/ta...4.7.4/include/).
You can put the softfp cflag in /usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf to not have to edit each makefile qmake creates.
Had to use g++ 4.2, mangling of va_lists which usually is just a mildly irritating warning, here results in errors. The garage version of libqt4-dev doesn't install nicely on CSSU (depends = 4.7.0), but still works after dpkg, one just needs to update symlinks in /usr/lib. Building version 2.1.0 on non-overclocked device takes some 18 hours.

I ported a Desktop QT application to the N900 and it was quite a mess. I had to build QT from scratch in scratchbox because it had a few missing libraries dependencies that are either not included in the CSSU or not updated. (libQtHelp, libQtCLucene just to name some). I had to include them with the application which is annoying.

I can probably provide you the natively built 4.7.4 libraries if you need them instead of using ubuntu's, but if those work then that's fine.


I mainly wanted to point out the handling of the file menu, I also have that problem where it barfs all of the options from all submenus on the Desktop into a single menu on the N900, but in my case there are so many options that I just get a blank file menu dropdown. I haven't had time to fix this but it should be possible to separate into several submenus but that requires tweaking the source. A quick 'fix' is to simply comment out declarations of several file menu commands that you deem unnecessary to shorten the list, it should make the buttons bigger.

Edit: To clarify, I pulled the QT source from the CSSU repo and built it myself in scratchbox, not the global 4.7.4 if that makes a difference.

marmistrz 2013-07-12 12:28

Re: Qt development on-device (N900)
 
And what about qt4-dev-arm for 4.7.4?

jessi3k3 2013-07-12 12:35

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by marmistrz (Post 1358459)
And what about qt4-dev-arm for 4.7.4?

Wouldn't that just be the packaged built shared libraries and include files?

szopin 2013-07-12 16:09

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by jessi3k3 (Post 1358462)
Wouldn't that just be the packaged built shared libraries and include files?

This -dev package is unlike standard ones as it contains for /usr/bin/:
Code:

lrelease      lupdate      moc          qdbuscpp2xml  qmake        rcc          uic-qt4
lrelease-qt4  lupdate-qt4  moc-qt4      qdbusxml2cpp  qmake-qt4    uic

as well (not sure if this is full binary set, as some folders were missing from /usr/include). To fix apt-get (won't let me install anything without 'fixing' libqt4-dev) I'll try to tweak the 4.7.0 deb to pretend it is .4, if you can upload the missing libQt* .so's that would be great. Will have a look at getting proper -dev 4.7.4 package later

jessi3k3 2013-07-12 23:39

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by szopin (Post 1358515)
This -dev package is unlike standard ones as it contains for /usr/bin/:
Code:

lrelease      lupdate      moc          qdbuscpp2xml  qmake        rcc          uic-qt4
lrelease-qt4  lupdate-qt4  moc-qt4      qdbusxml2cpp  qmake-qt4    uic

as well (not sure if this is full binary set, as some folders were missing from /usr/include). To fix apt-get (won't let me install anything without 'fixing' libqt4-dev) I'll try to tweak the 4.7.0 deb to pretend it is .4, if you can upload the missing libQt* .so's that would be great. Will have a look at getting proper -dev 4.7.4 package later

All of those binaries are built in my /bin directory. I believe that the -qt4 are just softlinks pointing to their actual counterparts.

I'm not sure to what extend which libraries are missing, I can upload both the bin and lib directories but they're not small in size (~300mb). Give me some time.

The entire build directory is ~2GB in size.

Edit: What a gaffe, the filesize becomes bloated when I view my ext partition through windows. ext2fs for windows counts symlinks as their full size, essentially tripling the estimated file size. It's actually ~90mb when extracted.

jessi3k3 2013-07-13 00:03

Re: Qt development on-device (N900)
 
1 Attachment(s)
I've uploaded an archive with all
/lib/
/bin/
/include/

files. Let me know if they work. I hope the symlinks are preserved in the archive.

Qt-4.7.4-x11-maemo.tar.gz

Also, let me know if you need anything else within the build directory.

These should be all the files, see the attached install script that I found

Notice how on the script there are missing entries for libqthelp, libqtdesigner, etc, but they're built anyways.

pichlo 2013-12-20 11:03

Re: Qt development on-device (N900)
 
Thanks for this thread!

Please excuse my ignorance but I am having some problems setting it up. This is what I get when I try to install libqt4-dev, regardless whether the one from Fremantle SDK or the one from the first post (abbreviated):
Code:

The following packages have unmet dependencies:
  libqt4-dev: Depends: libgles2-sgx-img-dev but it is not installable
              Depends: opengles-sgx-img-common-dev but it is not installable

Where can I find the two missing packages? Not in extras-*, cssu-* or fremantle-* :(

szopin 2013-12-20 11:25

Re: Qt development on-device (N900)
 
try those:

http://repository.maemo.org/pool/fre...ngles-sgx-img/

pichlo 2013-12-20 11:42

Re: Qt development on-device (N900)
 
The EULA page gives 404.

http://tablets-dev.nokia.com/ gives,
"This maemo.org page got discontinued, please call your local Nokia customer care. (http://www.nokia.com/support/)"

The EULA page worked about two weeks ago when I was setting it up on my desktop. Unfortunately that is now inaccessible and will be for another week or so so my N900 is my only option.

szopin 2013-12-20 11:45

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by pichlo (Post 1399082)
The EULA page gives 404.

http://tablets-dev.nokia.com/ gives,
"This maemo.org page got discontinued, please call your local Nokia customer care. (http://www.nokia.com/support/)"

The EULA page worked about two weeks ago when I was setting it up on my desktop. Unfortunately that is now inaccessible and will be for another week or so so my N900 is my only option.

oops just noticed TMO is changing the key to ******

http://repository.maemo.org/pool/fre...ngles-sgx-img/

between the two binaries is: '4bc37c 7c77ebe 90177 c050b805 a8dc79', just remove spaces

pichlo 2013-12-20 19:12

Re: Qt development on-device (N900)
 
Fantastic, that works!

Yes, I noticed the asterisks and I knew I had to replace them with the key. But as I said, I have the key on my desktop but that is inaccessible. I was hoping to get it again from the EULA page but that now gives a 404.

EDIT: What else is different in your package other than qmake? Basxically I am wondering if I can install libqt4-dev from the repos and then overwrite qmake with the one from your package. The reason being that I have all dependencies at 4.7.4 while yours requires 4.7.0 and the downgrading is starting to look too messy.

szopin 2013-12-20 19:19

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by pichlo (Post 1399238)
Fantastic, that works!

Yes, I noticed the asterisks and I knew I had to replace them with the key. But as I said, I have the key on my desktop but that is inaccessible. I was hoping to get it again from the EULA page but that now gives a 404.

EDIT: What else is different in your package other than qmake? Basxically I am wondering if I can install libqt4-dev from the repos and then overwrite qmake with the one from your package. The reason being that I have all dependencies at 4.7.4 while yours requires 4.7.0 and the downgrading is starting to look too messy.

Not really sure. I believe this was the only package with ARM qmake binary I could find. If nothing changed between 4.7.0 and 4.7.4 in qmake itself it might work

marmistrz 2013-12-20 19:24

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by szopin (Post 1399078)

Or simply add nokia-binaries to apt sources :)

pichlo 2014-01-12 22:16

Re: Qt development on-device (N900)
 
OK so I got as far as adding Nokia binaries repo, installing all sorts of stuff, downloaded and unpacked the OP's package and replaced all x86 binaries from Nokia with those from the OP. Qmake now works fine and so does building a simple hello world program but anything more advanced and I get stuck.

I tried building VUmeter and got as far as creating Makefile from the supplied .pro file (= qmake works) and building the moc files. The next step, running make, spits out about 5 pages full of:
Code:

{standard input}: Assembler messages:
{standard input}:47: Error: selected processor does not support Thumb mode `ldrex r1,[r3]'
{standard input}:49: Error: selected processor does not support Thumb mode `strex r0,r1,[r3]'
{standard input}:50: Error: selected processor does not support Thumb mode `teq r0,#0'
{standard input}:111: Error: selected processor does not support Thumb mode `ldrex r2,[r3]'
...etc, repeats about 20 times with different line numbers

I've tried editing the Makefile to remove -mthumb from CFLAGS but that only replaces "selected processor does not support Thumb mode" with "selected processor does not support ARM mode".

I don't believe this is specific to VUmeter, I think there is something more fundamental in my setup. Any ideas?

I would really like to get this working in preference to scratchbox due to my lifestyle. Scratchbox ties me down to my main PC which I can use only at times of day when I am too tired to be productive.

szopin 2014-01-13 00:55

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by pichlo (Post 1405974)
I've tried editing the Makefile to remove -mthumb from CFLAGS but that only replaces "selected processor does not support Thumb mode" with "selected processor does not support ARM mode".

I don't believe this is specific to VUmeter, I think there is something more fundamental in my setup. Any ideas?

The erros 'does not support ARM mode' is mentioned in my first post here and managed to get around it with turning off optimization (I did not compile anything big though, only simple QT app that I managed to find source for, but it did full compile, can you check if you can compile Qrencode successfully? I might have used this one, not sure: http://repository.maemo.org/extras/p...1maemo1.tar.gz, if it fails then the setup needs tweaking, if it goes through, then my testing was insufficient). Do you have CSSU thumb installed? This could be responsible for the thumb errors. Would probably be best to recompile qmake on device with the same set of qt libs (I remember had to have a mix of 4.7.0 and 4.7.4, maybe this is causing it and the app I chose for testing was just a lucky hit?).

pichlo 2014-01-13 12:54

Re: Qt development on-device (N900)
 
You, sir, are my hero!

That should teach me to read for comprehension. With luck I may find some courses at the local college :)

Extra CFLAGS options as per post #1 did the trick and I produced a viable executable. Thank you, good sir! Now the fun begins!

pichlo 2014-04-12 13:44

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by szopin (Post 1358153)
Make results in a lot of assembler errors though (Error: selected processor does not support ARM mode `ldrex r2,[r3]`). Turning off optimizations helps a bit, down to 4 errors from a few hundred. Not sure if this will help in all cases, but adding:
Code:

-march=armv7-a -marm -mfloat-abi=softfp
to CFLAGS resulted in a successful compile. Binary works.

I've been doing a bit of development on my N900 lately and in my experience, in all the cases I've tried so far the -mfloat option was not necessary. So optimization should still work, all we need to do is specify the architecture. This s using gcc 4.6.1 from extras-devel.

Quote:

Now to compile qtcreator...
Any news on that one? :)

szopin 2014-04-13 21:12

Re: Qt development on-device (N900)
 
Quote:

Originally Posted by pichlo (Post 1421094)
I've been doing a bit of development on my N900 lately and in my experience, in all the cases I've tried so far the -mfloat option was not necessary. So optimization should still work, all we need to do is specify the architecture. This s using gcc 4.6.1 from extras-devel.



Any news on that one? :)

No news, posted some pics which show usability problems (too many clickable options make them unreadable), it worked for a test project I tried, could maybe be useful if you needed to edit .ui files, aside of that qmake/make is probably quicker/easier, maybe on jolla would be more usable, top maemo menu is no more so you get extra height (except on jolla if goes portrait by default :/), then again ui editor is also gone, qmake/make seems to be the way, until tablet

pichlo 2014-04-13 22:21

Re: Qt development on-device (N900)
 
Pity. UI editing is currently the only thing I do on the PC, all the rest is a phone job. If only someone could make a lightweight Qt UI designer for Maemo, that would be über-cool :)

pichlo 2014-11-06 10:28

Re: Qt development on-device (N900)
 
Another two silly questions came up:
  1. Is there a Qt equivalent of the two-line GTK button, like e.g. the ones in the System menu (e.g. "Internet Connection" has the second line in a smaller font and a different colour showing the connection name)?
  2. Not really related to Qt, so... http://talk.maemo.org/showthread.php...18#post1446118

marmistrz 2014-11-06 15:13

Re: Qt development on-device (N900)
 
pichlo: did you look at the QtMaemo5 module?


All times are GMT. The time now is 23:53.

vBulletin® Version 3.8.8