Active Topics

 


Reply
Thread Tools
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#1
This topic is to summarize the options & experiences to compile (in C/C++, Python, etc) and/or package (.deb) softwares for MeeGo Harmattan, always doing it on-device (N9/N950) without any need of a desktop PC.

1) gcc/g++/make/etc installed directly :
With PR1.3, the previous methods of installing gcc/g++/make don't work anymore. If you use PR1.0/PR1.1 it is easy, with PR1.2 it is complex to install but works. Anyway, gcc/g++/etc from Harmattan SDK repository wasn't meant to be installed directly on Nokia N9/N950, so with further releases of MeeGo Harmattan (PR1.1, PR1.2 and PR1.3) some compatibilities problems appeared between on-device packages and SDK packages.

2) Harmattan SDK on device :
The "MeeGo 1.2 Harmattan Plataform SDK" has a long installation procedure in desktop PC's. It can be used on-device (N9/N950) by mounting and chrooting an image, which is now easier with the release of Easy Chroot for MeeGo Harmatta.
I show here 2 options :
a) use the HSDK package by humble user :
With HSDK, it is easy to create & use a Harmattan SDK image. For Harmattan open mode users, v0.0.3 works. For Inception users, only v0.0.1 works well following these instructions. The image "SDK.img" is placed in "/home/user/MyDocs" and has : ext3 type, 2.86 GB, 441 MB free, gcc/g++ 4.4.1, Qt/Qt Quick, Python 2.6.6, PySide (Qt4 binding for Python), make, dpkg-*, etc;
b) use Easy Chroot with a ready-to-use Harmattan SDK image :
- download my Harmattan SDK modified image, harmattan-sdk.img.ext3 (527 MB compressed with lzma), with ext3 type, 3.13 GB, 554 MB free. It has additional softwares : gFortran, IPython, NumPy, PyGame, Pyside-tools, TeXLive, less, nano, htop and wget;
- place the image in "/home/user/MyDocs" of your N9/N950, uncompress it using :
~/MyDocs$ xz -d harmattan-sdk.img.ext3.lzma
in X Terminal, it takes about 5 minutes;
- follow the instructions to install & use Easy Chroot for MeeGo Harmattan;
- use the Harmattan SDK image with :
# qchroot /home/user/MyDocs/harmattan-sdk.img.ext3 /home/user/SDK
where /home/user/SDK is a directory with 777 permissions (use "# chmod 777 SDK");
- close the image with :
# closechroot /home/user/SDK

3) Maemo 5 (Fremantle) SDK on (N9/N950) device :
Like the Harmattan SDK, the "Maemo 5 SDK" has a long installation procedure in desktop PC's. But it can also be used on-device (N900 and also N9/N950) :
- download qole's simplified Maemo 5 SDK PR1.2 image (21 MB compressed with lzma), with ext2 type, 1 GB (only 122 MB used). It has gcc/g++ 4.2.1, dpkg-*, etc. Qt4 and Python aren't installed;
or
- download my Maemo 5 SDK modified (from qole's) image (41 MB compressed with lzma), with ext2 type, 512 MB (176 MB used). It has some directories already created inside the image and additional softwares (Python 2.5.2, less, nano, htop, wget, gdb, strace);
- place the image in "/home/user/MyDocs" of your N9/N950, uncompress it using :
~/MyDocs$ xz -d maemo-sdk-v1_2.img.ext2.lzma
in X Terminal, it takes 45-63s (on N9 @ 1 GHz);
- follow the instructions to install & use Easy Chroot for MeeGo Harmattan;
- use the Harmattan SDK image with :
# qchroot /home/user/MyDocs/maemo-sdk-v1_2.img.ext2 /home/user/SDK
where /home/user/SDK is a directory with 777 permissions (use "# chmod 777 SDK");
- close the image with :
# closechroot /home/user/SDK

4) Easy Debian & image with programming tools :
Easy Debian for MeeGo Harmattan gives a desktop Linux/Debian on your N9/N950 device, just choose an image (e.g, debian-m5-v3e-Sci) with gcc/g++/etc if you need C/C++ programming not targetting Maemo/MeeGo package distribution. You can add Fortran, Lua, Pascal, Ruby, etc.

5) Packaging (Python) softwares with PyPackager :
PyPackager is now compatible with MeeGo Harmattan. PyPackager is an easy way to package (mainly Python) softwares on-device, i.e., just run "python make.py" on your N9/N950. Download here the last version of PyPackager or v3.3.0 package (made by packaging with PyPackager on my N9 ! It includes "python" section for Python modules). See examples of "make.py" files in the source code of Khertan's softwares in GitHub.


In all images cited above :
- MeeGo "/home/user" and "/home/user/MyDocs" directories are shared with the image;
- you can add softwares by using "apt-get update", "apt-get install", etc. Use Easy Chroot version >= 0.2.0 to avoid the need of adding the sbin directories to root $PATH of the image;
- define the correct locale by typing in the SDK terminal :
# dpkg-reconfigure locales
and choose the languages you want (UTF-8 is recommended).

==================================================

FAQ :

1) Is it possible to change the image size ?
Yes, use a desktop Linux and X Terminal, e.g. :
$ resize2fs SDK.img 3300M
resizes the SDK image to 3,300 MB.

2) Can I use HSDK with a specific and ready-to-use image ?
Yes, rename the (Harmattan ou Maemo 5) image to "SDK.img" (in "/home/user/MyDocs/").
If not created before, make a "/sdk" directory, as root in Terminal :
# mkdir /sdk
# chmod 777 /sdk
Then, just use "hsdk -s" to start and "hsdk -e" to finish using the SDK, instead of qchroot / closechroot.

3) How can I save MyDocs free space ?
Leave the SDK image compressed when it is not used and you need more free space.
Just uncompress when needed as it is fast on N9/N950 :
~/MyDocs$ xz -d -k <image.lzma>
here -k means the image is not deleted.
To compress the image, it takes many minutes in Nokia N9/N950 and just some minutes in a desktop PC :
$ xz -z -k -F lzma <image>
Remember to tompress the image everytime after modifying it and before deleting it.

4) Which SDK image is better ?
- the Maemo 5 SDK with 512MB if you want gcc/g++ and v4.2 is enough, and it takes only 45 s to uncompress;
- the original Harmattan SDK with 2.86 GB if you want gcc/g++ 4.4 or the complete Harmattan SDK;
- the modified Harmattan SDK with 3.3 GB if you also want Python tools or TeX/LaTeX.

5) How do I package on-device with Aegis support ?
Use Harmattan SDK or PyPackager, both run on-device (N9/N950).
See many "control" (for Harmattan SDK use) or "make.py" (for PyPackager use) files in the source code of softwares in the Harmattan GitHub repository.

6) I want to develop in Python/QML on-device for MeeGo Harmattan, including packaging. What do I need ?
Just install Python packages directly on your N9/N950, there is no need of Harmattan SDK. Recommended packages to install via "apt-get install" as root : python-pyside, pyside-tools, ipython. More information in the Python/Harmattan Wiki.
To package on-device, use PyPackager.

7) Why is it interesting to develop and package on-device ?
* Maemo/MeeGo developers have mobile Linux power on their hands, we like the freedom to not depend on any desktop OS/softwares, we like to develop anywhere, anytime, with no limits;
* Harmattan SDK setup on Linux desktop OS is a very long and boring procedure and there are situations where you don't have permissions to install it on some PC. Using ssh to your N9/N950 with a Harmattan SDK image is a solution for these cases;
* because we can Others can not

8) What if I want to develop & package on desktop PC for MeeGo Harmattan ?
There are many options :
- use Qt SDK for C/C++/Qt/QML development with complete graphical IDE;
- use Harmattan SDK for C/C++/Qt/QML/Python/PySide development;
- use PySide Assistant for packaging Python softwares. Use the xen's version of PySide Assistant to follow Nokia Store guidelines.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-01-06 at 14:09. Reason: Fixed links to PyPackager
 

The Following 22 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#2
Experiences about compiling & packaging on-device.

Compiling & packaging with Harmattan SDK using command "dpkg-buildpackage -sa -rfakeroot". Nokia N9 used the image of section 2b above. Time in seconds (s) :

python-sympy 0.7.1 (pure Python package) : XPS 15 (42s), A1215B (180s), N9 (94s);

easy-chroot 0.2.0 (package with scripts) : XPS 15 (14s), A1215B (44s), N9 (60s);

blas 1.2 (package with a lot of C & Fortran compilation) : XPS 15 (1,127s), A1215B (1,971s), N9 (1,118s).

Hardware descriptions :
XPS 15 : Dell XPS 15 L502X, Core i7 2670QM 4 cores @ 2.2-3.1 GHz, 1+6 MB cache L2/L3, 8GB RAM DDR3 1,333 MHz, 1TB 5,400 RPM SATA hard drive;
A1215B : Asus 1215B, AMD C-50 2 cores @ 1.0GHz, 1 MB cache L2, 2GB RAM DDR3 1,066 MHz, 320 GB 5,400 RPM SATA hard drive;
N9 : Nokia N9, TI OMAP 3630 ARM Cortex A8 @ 1.0 GHz, 1GB RAM mobile DDR.
PS : the notebook's bottleneck is the hard disk, while the N9 has flash memory.

So we see that on-device (N9) compiling and/or packaging is very practical : between not too slow to sometimes faster than netbooks, low-price notebooks and even high-spec notebooks !

More timing when compiling & packaging with chrooted Harmattan SDK on Nokia N9 :

- SciPy 0.14.0 (package with Python, C/C++ and Fortran compilation) : 8,946s (without Python 3 and docs);
- SuiteSparse 3.4.0 (package with Python, C/C++ and Fortran compilation) : 3,889s;
- cython 0.19.1 (package with Python and C/C++ compilation) : 2,168 s (without Python 3 and docs);
- NumPy 1.9.0 (package with Python, C/C++ and Fortran compilation) : 2,294s (without Python 3 and docs);
- MatPlotLib 1.2.0 (package with Python and C/C++ compilation) : 792 s (without Python 3, dbg and HTML/PDF docs);
- zeromq 2.2.0 (package with C/C++ compilation) : 456 s;
- libpgm 5.1.118 (package with C/C++ compilation) : 353 s;
- python-zmq 2.2.0 (package with Python and C/C++ compilation) : 294 s (without Python 3);
- IPython 0.13.1-2 (package with Python) : 132 s (without Python 3);
- python-tornado 2.4.1 (package with Python) : 45 s (without Python 3).

Kernel compilation by jackburton with chrooted Harmattan SDK on Nokia N9 : 5,035 s.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2014-09-30 at 18:29. Reason: Added SciPy, SuiteSparse, etc compilation timing
 

The Following 4 Users Say Thank You to rcolistete For This Useful Post:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#3
I've rebuilt PyPackager on COBS, so it should be available in few minutes in my home repository :

http://repo.pub.meego.com/home%3a/kh...rmattan/armel/

Regards,
 

The Following 3 Users Say Thank You to Khertan For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#4
From yesterday to today the image of item 2b was updated : better compression, added less.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#5
now issue with pypackager:
after i removed pypackager_2.3.0-2_armel.deb and trying to install 2.4.0 i am getting: "Manifest error: Cannot replace standard '...' via Aegis name attribute" so, something is broken
//i manually removed /usr/lib/pymodules/python2.6/pypackager//
__________________
~ # mv /usr/bin/smartsearch /usr/bin/stupidsearch
 

The Following User Says Thank You to wook_sf For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#6
Originally Posted by wook_sf View Post
now issue with pypackager:
after i removed pypackager_2.3.0-2_armel.deb and trying to install 2.4.0 i am getting: "Manifest error: Cannot replace standard '...' via Aegis name attribute" so, something is broken
//i manually removed /usr/lib/pymodules/python2.6/pypackager//
Me too, v3.4.0 gives this Aegis error. I've notified Khertan.

Install v3.3.0 for the moment (its link is back again in item 5 above).
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following User Says Thank You to rcolistete For This Useful Post:
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#7
Originally Posted by rcolistete View Post
Me too, v3.4.0 gives this Aegis error. I've notified Khertan.

Install v3.3.0 for the moment (its link is back again in item 5 above).
yea, i know (i did it before i even posted )
anyhow, why we can't user dpkg -b for making .debs?
i tried and got "tar: unrecognized option '--format=gnu'" :S damn
__________________
~ # mv /usr/bin/smartsearch /usr/bin/stupidsearch
 

The Following User Says Thank You to wook_sf For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#8
Originally Posted by wook_sf View Post
anyhow, why we can't user dpkg -b for making .debs?
i tried and got "tar: unrecognized option '--format=gnu'" :S damn
There are some Aegis problems if you only use dpkg-deb, see the this topic.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following User Says Thank You to rcolistete For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#9
Anyone got the steps of how to package on the N9?

Im yet to find any.
 
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#10
Originally Posted by F2thaK View Post
Anyone got the steps of how to package on the N9?

Im yet to find any.
Be more specific, package :
- a Python or C/C++ software ?
- an existing software in .tar.gz or a new one from scratch ?
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:24.