Compiling from source newbie questions

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
kaan191
Engineer
Engineer
Posts: 2
Joined: 10 Jan 2022 08:15

Compiling from source newbie questions

Post by kaan191 »

Hi everyone,

I have just completed compiling from source on my Raspberry Pi 4 model B. The game works (yay!). The openttd executable resides in ~/Games/OpenTTD/build (with the source code in ~/Games/OpenTTD).

I have a few noob questions:
- why is the executable size massive, compared to the downloads on the openttd website? (170MB) I compiled the Release version. I accidentally installed the Debug version before that and that was 250+MB. Is this expected?
- what is the conventional way of putting openttd into the PATH? Do people move the executable into one of the /bin/ folders on the filesystem? (Sorry if this is a stupid question)
- what is the recommended way of "tidying up" after invoking the ``make`` command? Besides the (big) executable, a du -sh of the ~/Games/OpenTTD/build directory reveals a total of 850MB... what can be removed after compiling to save up space? (Also sorry if this is a stupid question)

Thanks and looking forward to learning more (if it isn't obvious, I'm also a bit of a Linux / RPi noob)!
User avatar
jfs
Tycoon
Tycoon
Posts: 1867
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Compiling from source newbie questions

Post by jfs »

The executable might contain debug symbols (yes, even a release build), which can be removed with the 'strip' utility.

The 'make install' command will copy all the built files to the install directory given during the CMake configuration process. I believe this defaults to /usr/local/games but not entirely sure. It might not be in your default path, but it's definitely a system location that will require root (sudo) access to complete.

The 'make clean' command will remove all built object files and binaries from the build tree.
kaan191
Engineer
Engineer
Posts: 2
Joined: 10 Jan 2022 08:15

Re: Compiling from source newbie questions

Post by kaan191 »

Thanks! Strip utility did the trick and reduced the executable file size to ~7MB.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Bing [Bot] and 21 guests