Fs2 open on Linux/Compiling

From FreeSpace Wiki
Jump to: navigation, search
« Optimization The fs2_open on Linux Guide
Compiling
Compile Script »

Note: This step is only for those who want the bleeding-edge source code to compile on their own. You can skip this if you intend to use a provided binary executable.

Compiling The Source Code

The source code can now be compiled to a desired binary. This binary can be in 3 variants:

  1. Release - Good for playing the game normally
  2. FastDebug - Used to find errors during gameplay (Used for mod level debugging)
  3. Debug - Used to find errors on a code level. Please check this if the user wants to develop and debug the code further

For New Users - Compile Using Visual Studio Code

To compile the code in Visual Studio Code, the user must first set the desired build variant. To select this, the user must:

  1. Open the Command Palette (CTRL + SHIFT + P)
  2. Search or Type CMake: Select Variant
  3. Select the desired variant
  4. Build the code by using any of the following methods:
    1. Open Command Palette and type CMake: Build
    2. Press the Build button

The Build Artifacts

The build artifacts should be inside the build directory. The full path of the binary must be:

${workspaceFolder}/build/bin/fs2_open_<version>_<instruction_set>-<variant>

The version will be the version of the source code.

Instruction Set will denote which type of CPU SIMD instructions are executed, SSE2 or AVX.

Variant will be the type of variant that the user selected earlier.

For eg. File name for the version 24.2.0, instruction set of AVX and of debug variant will be

fs2_open_24_2_0_AVX-debug

If you see the build in the build directory, congratulations! The binary is ready to be used to play and debug!


Run from within your fs2_open directory:

$ make

Sit back and enjoy gcc work its magic.
You will find the binary executable in code/ as either fs2_open_r if you built a release build or fs2_open_d if you built a debug build.

NOTE: in 3.6.15 and higher, quiet compiles are turned on by default. To get a verbose compile:

$ V=1 make

Also, the binary executable in code/ is now called fs2_open_3.6.15 and fs2_open_3.6.15_DEBUG