Using FPCUPDELUXE to Create (Free Pascal) Lazarus Compilers of Different Versions

I use stable versions of the Lazarus/Free Pascal compiler for my production projects. Decades of experience has left me very leery of the latest and greatest of any software.

For Lazarus, that means going to SourceForge (https://sourceforge.net/projects/lazarus/files/) and using a x.x.2 or greater version of the compiler. x.x.0 is forbidden in my book and even x.x.1 typically I avoid.

This is all fine and dandy until I find a bug in the compiler, and I cannot come up with a reasonable work around.

When an error is found with no resolution, I report it to the compiler writers. Without fail, the first question will be – can you reproduce it with the trunk compiler (the absolute most recent). Not that I can blame them. The bug may well already be fixed and they don’t want to waste time chasing down problems already fixed.

This means I need to be able to create a trunk version of the compiler on demand.

In the past, I’ve manually built the Lazarus compiler on Windows system. It is  not a simple process but I know the procedure and can get a compiler running in a few hours. One downside to manually building the compiler is it will interfere with any existing Lazarus compiler, so the manual build should be done in a clean VM.

This week I found myself in the same predicament, except the bug is occurring only on the MacOS platform. I can just barely manage getting my production software to run on this platform. Manually building a compiler would be very time-consuming for me.

As I was researching the build process for MacOS I stumbled across the FPCUPDELUXEprogram. You tell it the version of Free Pascal and the version of Lazarus you want, it will download the code from the SVN along with the proper bootstrap compiler, then build everything for you. Further, the install is completely isolated from the rest of the system so any production Lazarus compiler is not impacted. YES!

I installed FPCUPDELUXE on my Mac system and used it to build FPC/Lazarus 3.0.4/Trunk. In about 1/2 an hour I had a usable compiler.

The FPCUPDELUXE program can be found here:

https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases

I needed to build the 64bit MacOS compiler, so I downloaded

fpcupdeluxe-x86_64-darwin-cocoa.zip

Note: On MacOS, FPUPDELUXE must be installed properly into the Applications folder. I didn’t do that on my first attempt and had some access issues.

When you start FPUPDELUXE you will see:

Operation is quite straight forward.

  • Click on setInstallDir and select where you want the blob of code (FPC and Lazarus).
  • Select the Version of the FPC compiler. Note the branches stable, trunk, and fixesn.n. These are useful if you want the latest or just the fixes.
  • Select the Version of Lazarus to install. Note that Lazarus relies upon various features of the FPC compiler. It would be a bad idea to select an FPC compiler older than what that version of Lazarus was released with.
  • Finally, click on the Install/Update FPC+Laz button.

About 30 minutes later you will have a running compiler. So much easier than the manual method!

Once the compile is done, you will find a link to the Lazarus program in your home directory:

You will find that a Desktop Link was built as well:

There are many other options available including cross compiling to Raspberry Pi. If / When I use some of these options, I’ll document them as well.

Compiling Specific Revision

I discovered rather than just compiling trunk, I needed trunk up to a specific revision.

Click on setup, for Lazarus Branch, select trunk. For revision, enter the revision you want (62400 in my case).

After you enter the revision, it is recalled when you restart fpcupdeluxe.

This entry was posted in c-lazarus and tagged , . Bookmark the permalink.

4 Responses to Using FPCUPDELUXE to Create (Free Pascal) Lazarus Compilers of Different Versions

  1. Hans Otten says:

    Shouldt FPCUPDELETE be FPCUPDELUXE?

  2. I found your site through a link on ioctl. https://forum.lazarus.freepascal.org/index.php?topic=507.0

    Looks like you have some Lazarus experience so how do you deal with differences between libraries with respect to C, Python verses Lazarus?

    Specifically I’m trying to use the SocketCan library which uses socket.h among other include files. It doesn’t appear that the socket library for Lazarus has that level of capability. The socket unit in Lazarus appears to really be only for tcp based communication.

    https://en.wikipedia.org/wiki/SocketCAN
    https://man7.org/linux/man-pages/man7/netdevice.7.html

    Am I missing something with lazarus? Perhaps it’s named slightly differently?

    Or am I going to have to port the C version over to Lazarus?

    Thanks
    John

    • Dan TheMan says:

      Note to self, this relates to the post https://bigdanzblog.wordpress.com/2014/01/21/raspberry-pii2c-with-lazarusfree-pascal/

      It’s been a long time since I have messed with this stuff (6 years) so take anything I say with a major grain of salt.

      fpIOCtl is simply a free pascal callable procedure that in turn calls ioctl. If you can call ioctl from C and get it to manipulate the socketCAN stuff, I would really expect it to work from free pascal.

      If you are calling socketCAN stuff directly, and looking at the wikipedia link you showed me, it appears you probably need to, then YES you will have to provide your own Lazarus to socketCAN interface much like the fpIOCtl call which in in the baseUnix interface.

      I don’t know what is in can.h or can/raw.h, but I’m assuming you need stuff inside those includes and that is the stuff you will need to implement in lazarus/free pascal.

      The index to the baseUnix interface is here: https://www.freepascal.org/docs-html/rtl/baseunix/index-8.html . I don’t see anything in there dealing with CAN.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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.