1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

Lazarus and Freepascal PND

Discussion in 'C /C ++' started by ptitSeb, Nov 5, 2012.

  1. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Hi,

    Here http://repo.openpand...&app=lazarus102 you can find the Lazarus IDE and Freepascal Compiler in a PND.

    This is Build 02, just a quick fix of the quick fix of the initial release... No beta anymore, it is now rated release.
    The Build 01 was rated beta quality and was a quick fix of Build 00.

    History log
    =========

    Build 06

    -----------

    • Updated Lazarus to 1.4.0
    Build 05
    -----------

    • Fix potential build & link issues

    Build 04

    ------------

    • Updated FPC to 2.6.4
    • Updated Lazarus to 1.2.6
    • Better integration with upcoming Code::blocks PND (but works fine as standalone too)

    Build 03

    ------------

    • Added -CpARMV6 -CfVFPV3 switch to have "hardware" floating point and recompile everything
    • updated FreePascal Compiler to v2.7.1 (dated 18/01/2013) from v2.6.0
    • updated Lazarus 1.0.4 from 1.0.2
    • updated ld and as to binutil 2.22 from firmware ones (1.18).
    Build 02

    ------------

    • Correction of the url in the PND.
    • Add a new sample in the initial setup: Magnifier 3.5
    • Program using SDL should compile now
    • Modify defaut config (in the initial setup) to include /lib and /usr/lib to searchpath of lib

    Build 01

    -----------

    • Correction of a problem that prevented Lazarus to Compile or Link properly.
    • Correction of problem that prevented initial setup (when no appdata/lazarus folder exist) to create default project.

    Build 00

    ------------

    • First release
    • Include Lasazarus v1.0.2
    • Include Freepascal v2.6
    • Created a folder for projects in appdata/lazarus/home/projects, but feel free to put your projects elsewhere
    • Temp folder defined to appdata/lazarus/home/temp to avoid saturating NAND (and it will come very quickly with Lazarus)
    • All samples (the examples folder in a normal installation) are moved to the appdata/lazarus/home/projects
    Be aware that Lazarus creates _HUGE _ programs ! There are pages on internet on this subject.
     
    Last edited by a moderator: Jun 24, 2015
    Tags:
  2. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Hi - tried it, cannot build.


    File -> New... -> Application


    Open messages window, get the error:


    /usr/bin/ld/: cannot find media/SEBEXT/sources/freepascal/lib/fpc/2.6.0/libpthread_nonshared.a


    Tried to build PandaBAS, but get another error:


    SpecBAS.pas(0,0) Fatal: Can not find the system used by SpecBAS. ppu=/mnt/utmp/lazarus/fpc/lib/fpc/2.6.0/units/arm-linux/rtl/system.ppu


    Which is odd, because the file mentioned (system.ppu) does indeed exist on that path.


    D.
     
  3. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Oh :(


    That's not good. Looks like I missed a path somewhere. I'll have to track it down (and must definetly try the pnd without my SEBEXT partition mounted).


    *EDIT* : ok, a little grep -r "SEBEXT" . on the sources, and I have founds some mistake... Rebuilding PND (on the pandora on the go, takes time), and I will retest (without the SEBEXT partition, I reproduce the bug with the build 00). Maybe a build 01 shortly?
     
    Last edited by a moderator: Nov 5, 2012
  4. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Yes ! I (hope / think) I've fixed it !


    I have a new Build 01 ready to upload to the repo...


    What I've done to test :


    1. Build the PND directly to my primary SD Card.


    2. Unmount both partition of my secondary SD Card (I have a FAT32 for movies / music, and an EXT2 for programming)


    3. Remove physicaly the secondary SD Card from the Pandora (no more /media/SEBEXT partition now)


    4. Launch lazarus => OK, no error message


    5. Launch default project.... Compile (nothing done I think, it was fast)... Linking (no error)... All good ! Empty window project runned !


    I go upload to the repo then update 1st post with Build 01
     
  5. moxie

    moxie The voice of reason, sense and exasperation Staff Member

    Joined:
    Aug 15, 2006
    Messages:
    2,707
    Location:
    South of Sweden
    This is actually quite cool stuff! Although it is twenty years since I last tried me some Pascal...Hm. Maybe I should try to dig out my old books? :)
     
  6. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Ok, new upload to the repo, Build 02, just to fix the url embeded in the pnd (and I hope I didn't break anything in the process, even if I tested a couple of time, and localisation works, I have it in french on my pandora now).


    As a bonus, I added the Magnifier 3.5 (but it will install only if "projects" doesn't exist in appdata/lazarus/home). It works quite well. Just, when you click, I have no ideas where it goes, as it still run, but is not apparent in taskbar or elsewhere... Have to stop it with the Stop button, do not usable as-is...


    As a side not, I too remember some good time with Turbo Pascal (v7 for DOS, with some good old Assembly for low level access, haaa, TPX for the win !) and the first version off Delphi also. First taste of RAD development ... before switching to C & C++.
     
    Last edited by a moderator: Nov 6, 2012
  7. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Ok, default project builds now! Yay!


    Also needs a swapfile on 256MB Pandas. However, trying to build SpecBAS results in an error:


    "/usr/bin/ld: cannot find -lSDL"


    I've seen this before when cross-compiling, and it was required that I install the SDL development libraries.


    D.
     
  8. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    (Hum, for Build 02, I will upload to the repo tomorow, too late now for me, and 200Mo takes ages !)


    @ZXDunny, yes, it looks like some SDL devel libs are missing :( . May be try with cdevtools launched, to see if it find them then.


    For the swap file ... ok :wacko: . I have a Rebirth, it run well, but it's clear Lazarus looks hungry on the ressources, memory or disk (for cpu, it is less demanding). I will mention it on the front page on repo when uploading Build 02.
     
    Last edited by a moderator: Nov 6, 2012
  9. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Nope, sorry. Ran CDevTools.pnd, then loaded up Lazarus and tried to run SpecBAS from the editor - same error.


    D.
     
  10. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Ok, I'll add a few libs in the lib folder of Lazarus, will be included in Build 02.


    I'll check dependencies of PandaBAS to be sure I don't miss something. My problem is the BASS library. I suppose I have to include it as well (but I am not clear on the licence type) or will it work if you put the .so somewhere else (to check that, you could also create a link to the missing SDL in your work folder, with "ln -s /usr/lib/libSDL-1.2.so.0 libSDL-1.2.so.0" and see if it works)
     
    Last edited by a moderator: Nov 6, 2012
  11. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Don't include BASS if you don't want to - I just leave the BASS.pas lying around in the pandabas source folder. The bass.so file needs to be distributed with PandaBAS anyway. Just SDL would likely be enough for me.


    D.
     
  12. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Or a better ideas (I hope), change parameters in the ".fpc.cfg" (in home) & "fpc.cfg" (in home/.lazarus) files (they are the sames, but I don't know which one count), and find the line with "# searchpath for libraries"


    here add a line with



    Code:
    
    -Fl/mnt/utmp/lazarus/fpc/lib/$fpcverion;/lib;/usr/lib
    
    
    Should work. If it work, I'll make it default value.


    I could also add a "writeable" folder for libs, inside "home" for customisation...


    Can also do that for units I guess...
     
  13. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Thanks, I'll give that a try - though I'd prefer not to have to run the C Dev Tools PND before being able to run Lazarus if it's all the same to you. To be fair, I'd rather not have the C Dev Tools PND on my card at all, as it's a waste of space.


    D.
     
  14. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Oh, you don't need the cdevtools pnd running for this (it was just a test, and it failed). I update the lazarus pnd, it should work now.


    The main problem was (if I succeeded in fixing it) that the link was searching is libraries only in the freepascal folder (that is /mnt/utmp/lazarus/fpc/lib/2.6.0). So I added softlink to the SDL lib sitting in the /usr/lib of the pandora.


    And to be safer, I modify the default fpc.cfg with the line in my previous post to permit the link process to find standard libraries in the standard system folder. So it should work now with the new pnd (Build 02), but it should also work if you just modify your appdata/.lazarus/fpc.cfg
     
    Last edited by a moderator: Nov 6, 2012
  15. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Thanks, I'll give it a try - making that change to the two fpc.cfg files resulted in the "cannot find system used by..." errors again :(


    D.
     
  16. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    ...And all is well :)


    Now to figure out how to enable vfpv3 (or NEON if FPC supports it)!


    D.
     
  17. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Right, according to the documentation wiki: http://wiki.freepascal.org/FPC_New_Features_2.6.0#Support_for_VFPv2_and_VFPv3


    I need to add options -Cparmv6 and -Cfvfpv3


    I do that, but then get the error mentioned above about not being able to find the system used:


    "SpecBAS.pas(0,0) Fatal: Can not find the system used by SpecBAS. ppu=/mnt/utmp/lazarus/fpc/lib/fpc/2.6.0/units/arm-linux/rtl/system.ppu"


    If I remove those options, it builds and runs fine.


    D.
     
  18. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Oh, that will be more complicated. I think I have to recompile every thing with this options -Cparmv6 - Cfvfpv3


    :(


    I will take a look, but it is not a quick fix...
     
  19. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Ok, some news about Lazarus and the optimisations.


    I need to recompile the RTL Unit. Just that :( .


    I wanted to do it like I have done before... Work on my EXT2 partition, and then change the link to future PND Magic one, that is /mnt/utmp/lazarus here.


    Because I'm mainly a Windows guy (I know, shame on me), I haven't thought of the maginc of the mount command !!!


    I have done a (ugly probably) :



    Code:
    
    sudo mount --bind /media/SEBEXT/sources/lazarus /mnt/utmp/lazarus -n
    
    

    Et voilĂ , I can recompile ecery thing without having to mess with path when I make the final PND...


    On the recompilation side, I have the 2 parameters -Cparmv6 and -Cfvfpv3 every where, so it will be by default.


    I had problem with the Assembler "as" command, because fpc doesn't send any parameters, and "-mfpu=vfpv3" is needed now. So I have to create un little shell file, called "as" in the bin folder of fpc, that call the real "as" with hard coded "-mfpu=vfp3", and it seems to compile now


    But I'm not finished yet...
     
  20. ZXDunny

    ZXDunny Advanced Member

    Joined:
    Oct 12, 2010
    Messages:
    2,339
    Keep going. I was hoping that later versions of FPC (I use 2.4.0 in my debian development environment) would support NEON, but I don't think that's in yet.


    D.
     

Share This Page

Loading...