Page 1 of 1

Compiling from source newbie questions

Posted: 10 Jan 2022 09:06
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)!

Re: Compiling from source newbie questions

Posted: 10 Jan 2022 11:40
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.

Re: Compiling from source newbie questions

Posted: 11 Jan 2022 14:28
by kaan191
Thanks! Strip utility did the trick and reduced the executable file size to ~7MB.