Compiling on Linux - Help for Beginners (and Not So Beginners)

Questions or HOWTOs about the above? Post 'em here...
Post Reply
User avatar
Private First Class
Private First Class
Posts: 155
Joined: Tue Dec 04, 2012 10:21 pm

Compiling on Linux - Help for Beginners (and Not So Beginners)

Post by alfa1 »

I write this since there are not binaries for Linux (directly from this project; though it's a normal procedure) and since compilation is always (in general) a hard process, specially for beginners.

In this example we will compile and install the latest stable release in a local way:
  • Download the source code: (choose the ZIP one).
  • Decompress it on some directory/folder (using the 'autodetect subfolder' option).
  • Open a console into that new subfolder and run:
    • ./
    • ./configure --prefix=<path>/build ('<path>' (w/o the brackets) being usually the entire path to the subfolder; advice: avoid having spaces and symbols)
    • make
    • make install
If all goes well, the executable files will be located into 'build/bin' folder. Remember to run them always from here, to refer to the new installation, by typying './bzflag', in example (you can get help by creating a link to the folder (better than links to files)).

Consider that every new compilated tree (if you had several BZFlag versions installed) would use lot of disk space (about 800 MiB for me nowadays), then you could just have one active and the others reduced by hand (in example, by deleting all the .o files, by keeping only the setting files, etc.). In the other hand, you could keep the ZIP files, which are just about 14 MiB each one nowadays.

Of course, install previously all the required dependencies (autogen and configure will tell you, otherwise). For more help, see the documentation and the wiki.

Note: in the case where you had a too old/outdated Linux distro (and always being related to the software you are trying to compile; in the case of BZ you don't need to have very new libraries), you would have 2 options:
  1. Compile and install every dependency manually in a local way too (and then linking them to the BZ compilation).
  2. Use Wine.
We do this to avoid updating the entire operating system (you could just update some few packages but this either is not always possible or could break your system if you are not careful enough). (Updating the OS would be an option too but this should be valuated case by case.)
Post Reply