Code::Blocks with C/C++ Compiler


Cool. I'll update. I have switched to the SVN, so I think it will not be the official 12.11, but the svn from today (it seems it is has been update slightly). The 12.11 is in a new Brantch, and I synchronise the Trunk, not sure I can switch easily to the Branch. If it's not clean, I'll get the sources and compile...
 
What I've seen of this version so far is very nice. It's a great IDE.


Have I mentioned how truly bitchin' it is to have this IDE on the go? Here's me, whipping a device out of my pocket on the metro and experimenting with 2D transformations for a game background, in the same C++ IDE that I use on all my PCs. You have done wonders with this PND.
 
A couple of things:


1.) when i run the command-line-version ("C/C++ Command Line Interface") I am prompted with the following errors. I'm not sure if you are aware of them or if they should be fixed:



Code:
ldconfig: /mnt/utmp/codeblocks/usr/lib/libstdc++.so.6.0.16-gdb.py is not an ELF file - it has the wrong magic bytes at the start.


ldconfig: /usr/lib/libGLES2D.so.1 is not a symbolic link


ldconfig: /usr/lib/libpnd.so.1 is not a symbolic link


2.) When I run the command-line-interface and leave it again (already without doing anything), then the pnd does not get unmounted. "lsof | grep codeblocks" shows that some process still block the unmounting-process because "/mnt/utmp/codeblocks/usr/lib/libgcc_s.so.1" is being used. Any new process I start like (xterm, bash) also uses that library. I can't see a way to cleanly unmount the pnd except by restarting the Pandora. Do others experience the same issue? Can it be prevented by doing something when ending the CLI? Can I manually solve it somehow? btw: I have the same issue with the cdevtools.pnd


3.) When doing compiling with the CLI or codeblocks: Are there already some optimisation-flags set like "-O2 -pipe -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp". Or do i have to configure these flags?


4) Usually when compiling stuff I do not much more than running "./configure" and "make". I would greatly appreciate a quick introduction into codeblocks how I would correctly open an unpacked source-tarball, configure it and built it with codeblocks instead of using the CLI. And if this would be possible too, an example how I can build projects using dependend libraries without installing them to the system. Like configuring and building such a library, then specifying where codeblock should look for them when compiling the sourcecode that the library was needed for. I guess something like this can somehow be more or less nicely done in a codeblocks-project.
 
Last edited by a moderator:
Some awnsers:


1. Yes, I am aware of that, but cannot fix thel The ldconfig is used to add all the libs for the Code::Blocks PND the the "pool" of libs available. Some files in the libs folder added or not real so. There are python scripts in the PND (the 1st errors, and more in the build 08 of the PND), and the two others are from the Firmware itself, nothing I can do...


2. Yes, I have seen tha, and I find it anoying too.But I haven't find a way to avoid that yet. I think it is a side effect of the ldconfig thing. May be a "sudo ldconfig" to refresh the pool without code::blocks pnd libs will do the trick?


3. I haven't setup any optimization, not in the Command Line, not in code::blocks. But for conde::block, default behavour is to have "-O2" for release build (the other flags are to be put by end). I can setup default optimzations flags, but you have to alter them if not to your taste, so I don't know.


4. Tutorial is realy not my specialty. About importing project in code::blocks, I haven't found magical formulas for this. For plain "configure & make", nothing exist, you have to create a Code::Blocks project by hand (thats doable for small project, but it is rapidly a too big task). For cmake, you can generate (with the -G "Codeblocks - Unix") a project, so it is easy. For Scons project, I don't know yet..


About Libraries you want to add, I will look at something. I have it almost ready, just the pkconfig thing I'm not sure yet. But, basicly, you will have to do a "./configure --prefix=/mnt/utmp/codeblocks/local", and "make" & "make install" to setup you custom libs. Than you do a "sudo ldconfig -f /mnt/utmp/codeblocks/init/ld.so.cfg" and your new lib is available(that next step is not always necessary). That is what I am planning for Build 08 of the PND (plus the full GCC 4.7.2 suite of compiler, update cmake, Perl 5 with cpan library installable and python 2.7, winelib & mesaGL to convert & compile even more stuff). comming soon, around Christmas I hope.
 
Thanks for the reply. Cleared some things up. Don't worry about the tutorials. I will try to find something on my own. And to some extend you already helped me as mentioned before.


I tried running "sudo ldconfig" after ending the C/C++-CLI and it helps. Not perfectly, but with a little delay. New commands, that are being executed afterwards, will not be using the libgcc_s.so.1 anymore. What remains is the need to end processes that are already using that library. For example the pnd-unmount-process itself still uses it. You can wait a while until the process gives up and end itself, but the pnd was still mounted afterwards. However I was then able to manually unmount the pnd by running as root "umount /mnt/utmp/" and "losetup -d /dev/loopX" (with 'X' being the number of the related loopdevice as shown in "losetup -a").


So at leats I can handle this without a restart now.


I modified "/mnt/utmp/codeblocks/runcli.sh" by adding at the very end a "sudo ldconfig" (doesn't seem to require a rootpassword) and it seems to work rather good. The pnd cleanly unmounts. This might not always work nicely, depending on which process have been started meanwhile. But it should be an improvement and at least increase the chances of the pnd being unmounted. So as long as noone points out negative effects resulting out of this modification you could try to add it in the next release.
 
Last edited by a moderator:
for sudo password entering, there is a "grace period", so you don't need to enter password if it as been enterred not to long ago. But if you do work for an hour or two, you will need te re-enter password again.


That is good experimentations :) . I can try to implement a clean unmount based on this, at the end of CLI or C::B, with asking the password at quitting, with same mecanism than starting.
 
Last edited by a moderator:
I tried to upload a new version of the Code::Blocks PND. But it's big... a little more than 560Mo, and I can't upload, fall in timeout I guess :(   (I get a "You did'nt upload a file" error). So I will not be abble to upload the new version before Christmas, sorry.

I'll probably upload it at work, the upstream bandwith is much higher than at home.

I also intend to enter the DragonBox competition with this Code::Blocks PND :)  .
 
The new compilators surely take some space. I suspect the Java one to be very space hungry.

Winelib takes a few megs also... And the many libs I added also takes some space.

Uncompressed, it takes a bit more than 2 Go !

Hum, Perl & Python are quite big also.
 
Last edited by a moderator:
Here is a little teaser... I try to keep a changelog of the change I do on Code::Blocks. Find a copy of what happened since last release.

******** => PND v1.0.6.07 ***********
+ OpenAL compiled by LinuxSWAT
******* 01/12/2012
* Hacked Binutils 2.22 to remove the "assertion failed" message...
+ Perl 5.17.6, with CPAN (needed to move things to appdata) and dynamic loading
+ Wine compiled. Winmaker useable (once move to appdata, need write access)
******* 02/12/2012
+ LameMP3 3.99.5      with experimental optim full
+ libav 0.8.4         with cortex and neon optims
+ libmpg123 1.14.4    with neon optims
* openal-soft 1.14 (replace OpenAL SI)
+ makedepend 1.0.4
+ utils-macro 1.17
+ glproto 1.4.11
+ libdrm 2.4.40        with only OMAP experimental api
+ dri2proto 2.8
+ xcbproto 1.8
+ libxcb 1.9
+ libsigc++ 2.3.1
+ xcb-utils 0.3.9
+ xproto 7.0.23
+ libX11 1.5.0        with xcb
+ MesaGL 9.0.1        software only, so slow... Tried mesademo, works
+ glu 9.0.1

******* 10/12/2012
* gcc 4.6.3 => 4.7.2 + fortran, objc and java compiler

******* 13/12/2012
* recompiled libalsa (to make conf and plugin reference firmware folder)

******* 14/12/2012
+ boost 1.51
+ valgrind 3.4.2      still complains of missing debug info
+ libtool 2.4.2
+ libjson 1.0.0
+ json-c 0.10
+ addipk cups
+ tried addipk glibc-dbg    doesn't work for valgrind...
* wine 1.5.18 -> 1.5.19 (git)    faster, but lost sound again

******* 16/12/2012
* alsa recompile with --have-softfloat, sound is back on wine
* change the specfile, to add rpath
* recompile wine
* python 2.6.2 -> 2.7.3        (note that the gcc warper doen't works with python
    it need a elf file, so had do define CC env and add -specfile blabla
    to CFLAGS to comille properly)
* smpeg 0.4.5
+ libpng 1.2.50
+ libjpeg 6b
+ pygames 1.9.1            (no portmidi or porttime)
+ openjpeg 2.0.0

******** 17/12/2012
* codeblocks svn8668        this is a post 12.11 version
+ IlmBase 1.0.2
+ OpenExr 1.7.1

******** 21/12/2012
+ review of config file and cleanup traces of old gc release
+ SFML 2.0rc
+ Dumb 0.9.3
+ Allegro 5.0.8

******** 22/12/2012
+ sparrow3d            looks like it is a great library for the Pandora
+ libconfig 1.4.9
- remove valdgrind again    too big allready
- more cleaning (traces of python 2.6, gcc 4.6.3)

So there a still some libs that are mssing, but many times it's the dependancies that slow me down...
 
CodeLite would be redondant with Code::Blocks. And I think Code::Blocks as more features and is working very well on the Pandora. So I dn't plan to switch to CodeLite.

Plus the much bigger size of the PND is not caused by Code::Blocks but all the other things I added.

If there is demand, I can try to add CodeLite, but it will be as another IDE, so the PND will contains Code::Blocks and CodeLite...
 
There is a possibility to cut some extra libs and readd it when we need ?
 
Last edited by a moderator:
The biggest lib is boost. But it is often used, so I readded it as needed it (for Cannonball for example).

I'll retry to send the PND later today, but I am pretty sure I will have to wait for next monday. I will analyse again the size of the folders. to see if there isn't something if missed on the various cleaning I performed.
 
Also, what would be great is "linked" PND. I way to launch a PND and auto-mount another PND.

For example, this way, I can ship CodeBlocks PND that automount DevTools PND.

Or I can launch some Winelib soft that automount WineRunTime PND.

I have seen that there are some field in the PXML file for that, but not sure it's implemented.
 
New release on the repo.

It is a HUGE one.

Update v1.05.08 (candidate to DragonBox coding competition 2012/13)

 

  • Update Code::Blocks to rev 8668 (rev. post 12.11 official)
  • Update GCC compiler to 4.7.2 (from 4.6.3)
  • Added other GCC compiler: Fortran, ObjC, Java
  • Added MesaGL (software rasteriser): Every GL Software compile now.
  • Added Winelib (1.5.20): windows software are compilable now. Transform them with "winemaker"
  • Update Python to 2.7.3 (from 2.6.2)
  • Update Perl to 5.17.6, with dynamic loading and cpan library access.
  • Added numerous libraries (OpenAL-soft 1.14, Allegro 5.1.5, Boost 1.51, fltk 1.3, SLML 2.0rc, etc.)
  • Hacked Binutils, so ld doesn't produce "assertion failled" messages
  • Added option for clean unmount of PND (add an empty file "clean_pnd" in appdata/codeblocks/init)
I also update many other little things... Here is the complete changelog:

 




******** => PND v1.0.6.07 ***********
+ OpenAL compiled by LinuxSWAT
******* 01/12/2012
* Hacked Binutils 2.22 to remove the "assertion failed" message...
+ Perl 5.17.6, with CPAN (needed to move things to appdata) and dynamic loading
+ Wine compiled. Winmaker useable (once move to appdata, need write access)
******* 02/12/2012
+ LameMP3 3.99.5      with experimental optim full
+ libav 0.8.4         with cortex and neon optims
+ libmpg123 1.14.4    with neon optims
* openal-soft 1.14 (replace OpenAL SI)
+ makedepend 1.0.4
+ utils-macro 1.17
+ glproto 1.4.11
+ libdrm 2.4.40        with only OMAP experimental api
+ dri2proto 2.8
+ xcbproto 1.8
+ libxcb 1.9
+ libsigc++ 2.3.1
+ xcb-utils 0.3.9
+ xproto 7.0.23
+ libX11 1.5.0        with xcb
+ MesaGL 9.0.1        software only, so slow... Tried mesademo, works
+ glu 9.0.1

******* 10/12/2012
* gcc 4.6.3 => 4.7.2 + fortran, objc and java compiler

******* 13/12/2012
* recompiled libalsa (to make conf and plugin reference firmware folder)

******* 14/12/2012
+ boost 1.51
+ valgrind 3.4.2      still complains of missing debug info
+ libtool 2.4.2
+ libjson 1.0.0
+ json-c 0.10
+ addipk cups
+ tried addipk glibc-dbg    doesn't work for valgrind...
* wine 1.5.18 -> 1.5.19 (git)    faster, but lost sound again

******* 16/12/2012
* alsa recompile with --have-softfloat, sound is back on wine
* change the specfile, to add rpath
* recompile wine
* python 2.6.2 -> 2.7.3        (note that the gcc warper doen't works with python
    it need a elf file, so had do define CC env and add -specfile blabla
    to CFLAGS to comille properly)
* smpeg 0.4.5
+ libpng 1.2.50
+ libjpeg 6b
+ pygames 1.9.1            (no portmidi or porttime)
+ openjpeg 2.0.0

******** 17/12/2012
* codeblocks svn8668        this is a post 12.11 version
+ IlmBase 1.0.2
+ OpenExr 1.7.1

******** 21/12/2012
+ review of config file and cleanup traces of old gc release
+ SFML 2.0rc
+ Dumb 0.9.3
+ Allegro 5.0.8

******** 22/12/2012
+ sparrow3d            looks like it is a great library for the Pandora
+ libconfig 1.4.9
- remove valdgrind again    too big allready
- more cleaning (traces of python 2.6, gcc 4.6.3)


 

******** 26/12/2012
* Allegro 5.1.5            (with gles2 support)
+ libXpm            fresh from git
+ xf86vidmodeproto        fresh from git
+ libXxf86vm            fresh from git
+ xf86dgaproto            idem
+ xf86driproto            idem
+ xf86miscproto            idem
+ libXxf86misc            idem
+ libXxf86dga            idem
* wine 1.5.20 update
* Allegro 5.1.5 -> 5.0.8    it seems that gles2 support makes Allegro not usable. more tests needed
+ seal 1.0.7            beware of the license, check website before using


+ tcl/tk 8.4 -> 8.5.13

********* 28/12/2012
+ fltk 1.3.2

********* 29/12/2012
* mercurial -> 2.4.1        (and updated with python 2.7.3 install)
* Allgro 5.0.8 -> 5.1.5        gles2 still broken


 
 


And more to come in the build 09, that should be the final release fo the Dragonbox Competition.

 

*EDIT* forgot tcl/tk (updated to 8.5.13) in the changelog.
 
Last edited by a moderator:
Damn, you sure have been busy. Nice start to 2013. Good luck in the competition.
 
Hmm... looks like this latest PND is getting stuck on the ldconfig console window. It opens the "Code::Blocks needs to launch ldconfig" console window, but just sits there with a green cursor. I'll leave it running for a while and see if anything happens, but I don't think it's actually doing anything.
 
Back
Top