About installing Castle Engine on Linux

I had troubles installing the engine in my Debian 11. I know, there’s Debian 12 but for some reason it stopped to work on my computer and I had to downgrade it and I can’t risk again now.

The problem was that CGE uses GLIBC_2.34 but Debian 11 isntalls GLIBC_2.31. So I tried to compile CGE myself using the makefile at the root directory; but I installed Lazarus using fpcupdeluxe that doesn’t install it in /usr/bin so makefile can’t reach fpc nor lazbuild.

But I was able to fix it:

I had FP installed from the Debian repository, then I created a link (ln) to the lazbuild program from the fpcupdeluxe installation to the /usr/bin directory and I was able to compile CGE. I don’t know if it would work if instead of install FP from repositories I create a link to fpc the same way I did with lazbuild.

Finally I opened the Editor and I configured the paths to Lazarus (it was able to detect FP).

Now it works.

I hope you understood what the problem is and how I fixed it because I think this information should be added somewhere in the documentation but I can’t explain it better.

It is documented that we need GLIBC >= 2.34 :

The solutions are to either upgrade Debian, or compile CGE yourself (thus, linked with the GLIBC on your system) – which you did.

Note that

  • you can use system-wide FPC and Lazarus (e.g. from Debian packages installation of both FPC and Lazarus),

  • or you can use your user-specific (e.g. installed by fpcupdeluxe FPC and Lazarus).

    In the latter case, make sure you have fpc and lazarus on $PATH (they don’t need to be in /usr/bin/, you can as well add your $HOME/bin/ to your $PATH in e.g. ~/.bashrc), see fpcupdeluxe | Manual | Castle Game Engine section “5. Putting FPC on $PATH” .

    If this sounds complicated, note that Compiling from source | Manual | Castle Game Engine mentions a few ways to build things, and you don’t really need fpc or lazbuild on $PATH for all of them. You could just point your Lazarus to the FPC you want to use and build everything using Lazarus IDE.

  • or a combination of them. In this case it seems you decided to use FPC from Debian packages but Lazarus from fpcupdeluxe which is fine.

I don’t see anything we could fix from your description – you chose to configure FPC / Lazarus in a particular way (lots of possibilities here), and it was OK. Our binaries do have to require GLIBC >= 2.34 for reasons explained in that news post. If I’m missing anything we could fix, please let me know of course, it’s always possible I misunderstand something :slight_smile:

That’s it: I didn’t read the system requirements. :sweat:

About the $PATH thing, you’re right and I have to learn how to use it.

Hello,
I’m also trying to install Castle Game Engine on an older Linux version. Could you clarify if compiling CGE manually is the only way to make it work with GLIBC 2.31? Are there any precompiled binaries available for older GLIBC versions?
Thanks.

That is true. The precompiled binaries on Download | Castle Game Engine require newer GLIBC.

That’s because they have been linked on a system with newer GLIBC. We have been forced to make this requirement upgrade, otherwise we could not support building for Android, so we would have a different problem.

The recommended action is just to upgrade your system. The latest OS, in particular Debian stable “bookworm” released in June 2023 has good GLIBC. But if you really really have to stick to the old system, you can compile CGE yourself.

Eventually, we want to ship CGE as a Snap package, which will avoid this issue (you will be able to run the Snap on any system that supports Snap, no matter the GLIBC version).

Thanks for the clear explanation, Michalis. I get it now that the precompiled binaries need a newer GLIBC. I’ll try upgrading my system, but it’s good to know I can manually compile CGE if I need to stick with the older version.

2 Likes