Results 1 to 8 of 8

Thread: Compiling on Rasperry Pi

  1. #1

    Compiling on Rasperry Pi

    (Comes from this thread.)

    Quote Originally Posted by 3Shrike3 View Post
    Thanks for replying - sorry about not posting in the right forum, will next time.
    There is allegro for raspberry pi - it just needed an apt-get allegro. Your -FU option didn't work, but you were right about the write permissions issue - I just needed to compile with sudo fpc test.pas
    You shouldn't never compile as root (or sudoer).

    Option -FU is to tell the compiler where to save the output of compiling units. Anyway, the error you posted:

    Code:
    albase.pas(209) Error: Can't create assembler file: /usr/lib/fpc/2.6.0/units/arm-linux/allegro.pas/albase.pas/albase.s
    Your compiler is trying to create an assembler file instead of an object file. May be your should use option -ap:

    Code:
      -a     The compiler doesn't delete the generated assembler file
          -al        List sourcecode lines in assembler file
          -an        List node info in assembler file
          -ap      Use pipes instead of creating temporary assembler files
          -ar        List register allocation/release info in assembler file
          -at        List temp allocation/release info in assembler file
    Anyway, as a temporary assembler file it should create it at /tmp. May be your FPC configuration isn't correct.
    Last edited by Ñuño Martínez; 19-02-2013 at 04:29 PM. Reason: Title change
    No signature provided yet.

  2. #2
    Thanks - you are right about -ap
    Out of curiosity, what is wrong with compiling as root?

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Can someone post some good sources of information about the Raspberry Pi hardware? I'd like to know a little more about it as this isn't the first time I've read about this being done in the Object Pascal world. It has also been done using Oxygene for Java.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Ok here goes the answers to my own question: http://www.raspberrypi.org/faqs




    Attached Images Attached Images
    Jason McMillen
    Pascal Game Development
    Co-Founder





  5. #5
    Quote Originally Posted by 3Shrike3 View Post
    Out of curiosity, what is wrong with compiling as root?
    Root is the super-user. It has access to everything in your computer, including core configuration and system. Programs started by any user inherits their security configuration. That means they have access to everything in your computer, including core configuration and system. "Normal" users don't have that level of access, or they have limited access to it (for example, it can be configured to allow it to administrate some part of the OS). So programs started by "normal" users haven't access to everything in your computer.

    Now imagine that FPC has a bug, or it is infected by virus, and if you run it then it deletes/modify a file from your hard-disk, randomly. If the program has Root access configuration it is able to remove/modify core configuration files. Now you see the problem, don't you? That's also why POXIX operating systems (i.e. UNIX, Linux, MacOS, etc) have fewer viruses than Windows and DOS, because most user programs don't have access to core system (i.e. they can't install themselves as system programs).

    On topic again (about compilation of Allegro.pas), once you finish your testing, can you tell us your experience? I'm curious to know if it works in anything different than PC-Windows and PC-Linux. Also tell me about what problems you had and if you needed to make changes to Allegro.pas, to add it to the next release of Allegro.pas.

    As Will said, it would be great if we can port our games to such platform.

    Thank you.
    Last edited by Ñuño Martínez; 20-02-2013 at 12:41 PM. Reason: Asking about Allegro.pas
    No signature provided yet.

  6. #6
    Ok,
    For everything I have done so far, and for compiling your examples, fpc source.pas -ap has worked fine.
    I installed fpc with sudo apt-get install fpc. It took about fifteen minutes I think.
    (I then tried to install Lazarus the same way, but I accidentally cut the power during the install (it had already taken about 30 minutes). I tried tons of removes and reinstalls, and once I got it to start, but it came up with loads of missing package files. Since, I haven't even been able to open it and have more or less given up.)
    Back to allegro.pas ...
    I installed allegro with a sudo apt-get install allegro . I then downloaded the allegro.pas file and extracted it to my folder. For some reason the fix.sh script did not work, so I had to manually add target.os, which I wrote TARGET=linux in (I might have got the caps wrong ... I will check later.)
    EDIT: yep, i got the caps wrong, I actually had target=LINUX in the target.os file.
    Anyway, after adding the target.os file, the make command ran fine.
    to be continued... gtg
    Last edited by 3Shrike3; 20-02-2013 at 10:12 PM.

  7. #7
    So, part two:
    The demo then ran fine, a bit jumpy, but that is to be expected from a £20 computer with little processing power! The exscn3d program, the one with all the spinning cubes would run at around 20 fps - is that due to the low processing power on the RPi, or is it just that allegro is not very fast at 3d? All your examples compiled and ran fine then, except:
    exrotscl wouldn't open and gave the error message 'Could not load inkblot.tga'
    exxfade gave error message 'Error loading image file 'allegro.pcx''
    However, exscn3d, which uses allegro.pcx, ran fine.
    I then copied the contents of the lib directory into a new directory called allegro.pas in /usr/lib/fpc/2.6.0/units/arm-linux , which is where fpc is installed if you use apt-get. From then everything worked and I just needed to add -ap to compile.

  8. #8
    Quote Originally Posted by 3Shrike3 View Post
    I installed allegro with a sudo apt-get install allegro . I then downloaded the allegro.pas file and extracted it to my folder. For some reason the fix.sh script did not work, so I had to manually add target.os,
    May be your Linux doesn't has /bin/sh .

    Quote Originally Posted by 3Shrike3 View Post
    The demo then ran fine, a bit jumpy, but that is to be expected from a £20 computer with little processing power!
    The demo game is very simple, but I didn't optimised it a lot. I'm sure it can run faster, but it needs a profile (AFAIK FPC and GNU profiler don't work together) and better tilemap+sprite rendering.

    Quote Originally Posted by 3Shrike3 View Post
    The exscn3d program, the one with all the spinning cubes would run at around 20 fps - is that due to the low processing power on the RPi, or is it just that allegro is not very fast at 3d?
    As documentation says:
    Quote Originally Posted by Allegro.pas doumentation
    It is not, and never will be, a fully fledged 3d library (the goal is to supply generic support routines, not shrink-wrapped graphics code :-) but these functions may be useful for developing your own 3d code.
    Anyway, it has one of the fastest software based 3D renderer I've seen. It will never beat OpenGL, but beats Mesa in some cases.

    Quote Originally Posted by 3Shrike3 View Post
    All your examples compiled and ran fine then, except:
    exrotscl wouldn't open and gave the error message 'Could not load inkblot.tga'
    exxfade gave error message 'Error loading image file 'allegro.pcx''
    However, exscn3d, which uses allegro.pcx, ran fine.
    I don't understand why exscn3d runs but exxfade fails. I'll see if I can find an explanation.

    Anyway, most of examples runs. That's really cool. I should tell everybody.
    No signature provided yet.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •