Compiling Free Pascal / Lazarus on Orange Pi

I had no issues following my instructions, Compiling the Latest Lazarus/Free Pascal for Raspberry Pi. This was, as usual, not a short process. It takes an hour, easy, assuming no mistakes are made.

I also noticed that the compiler hits the CPU so hard that I still lost a CPU core to overheating. That’s a little disappointing.

Unless you really need the most recent version of Lazarus, just use

apt-get install lazarus

The compiler was installed and a simple program tested.

In doing this, I was reminded why I don’t run Pascal on normal RPIs. It is too slow – there is too much IO on the SD card. I have a special RPI with a USB based hard drive for that very purpose.

I have moved Lazarus programs compiled on the RPI to the OPI and they work fine.

I expect that will conclude my testing with the Orange Pi One. I have now ordered an Orange Pi PC which has a faster CPU and more IO options to experiment with.

This entry was posted in c-opi. Bookmark the permalink.

4 Responses to Compiling Free Pascal / Lazarus on Orange Pi

  1. Graham says:

    being a Lazarus programmer, I am quite keen to use the FPC to create some relatively simple applications for the Orange Pi (Zero H2+ or the Zero Plus H5 version). I wish to use the IO on the Orange Pi (for the moment, just high/low logic states, but I may eventually venture into serial comms or ADC territory, who knows) as part of my program/s.

    When you say you have had Lazarus apps from the Raspberry Pi operating just fine, were your tests confined to the more traditional ports such as USB, HDMI etc. or did you try operating the IO on the 26 pin header as well?

    Any thoughts or suggestions would be greatly appreciated, thank you.

    Kind regards,

    • Dan TheMan says:

      The programs I tried were command line utilities. I don’t believe I tried moving a windows(X11) based program.

      I suspect programs directly manipulating hardware (GPIO) are going to fail. This article mentions there is an Orange Pi version of wiringPi so I assume there are differences. Which makes sense. The CPU may have the same instruction set, but the rest of the hardware is not necessarily the same.

      If I were going to seriously develop software for Orange Pi, I would want to be compiling directly on it. Plus one of the Orange Pi versions supports SATA so you could have a fast hard drive, something not possible on the RPI.

      I was having issues compiling FPC on the Orange Pi. FPC/Lazarus compiled properly (albeit very slowly). When I went to compile my own code it seems like linking failed.


      • Graham says:

        Hi Dan, thanks for your comments. My plan is to try (cross) compiling on my main machine, an application for the Orange Pi Zero. I don’t think I would like to compile natively on that little board, as the overhead would be excessive as you have found already. Still, getting a Lazarus or Pascal based program working on this little board is a very attractive idea at this point.

  2. Dan TheMan says:

    If you can get a cross-compiler running, I’d love to have the procedure. I’ve never had any luck myself with building a cross-compiler.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.