Skip to content

Compiling from Source

Zakant edited this page Sep 26, 2017 · 6 revisions

Prerequisites

You'll need to compile Intercept-Python from source:

  • Arma modding knowledge (where to place a non steam mod and how to load it, how to pack a folder to a .pbo)
  • A c++ compiler that supports c++17. If you haven't one, Visual Studio 2017 Community is recommended.
  • Latests version of CMake.
  • Python 3.6. x64 or x86 should be choosen according to your operating system. Please note: You can install both versions along each other. Just make sure that in the %path% enviroment variable only the python with the matching architecture is listed!
  • Boost. Note: You don't have to compile anything yet. This will be explained later one!

Downloading Intercept and Intercept-Python

Download Intercept and Intercept-Python (either by cloning using git, or by downloading the .zip file). If you already have Intercept downloaded, thats okay, you can use that version. Make sure that the folder structure looks like

.\intercept\...
.\intercept-python\...

Otherwise the scripts may not find intercept source!

Setting up the enviroment variables

The compile scripts will use three enviroment variables.

  • %BOOST_ROOT: The boost root dir (the one containing bootstrap.bat and index.htm)
  • %PYTHON_PATH_64: Path to x64 Python.
  • %PYTHON_PATH_86: Path to x86 Python.

Please set those variables now! If you only have one Python architecture skip this variable.

To add them open the windows control panel, click on user accounts and then change my enviroment variables.

After adding, restart your computer as thoses changes only take effect after a restart.

Compiling Boost

Intercept-Python comes with a easy-to-use python script that compiles the needed Boost.Python libraries.

NOTE: If you use Visual Studio 2017 as your compiler you MUST run the python script from the Developer Command Prompt!

Run now .\intercept-python\tools\BuildBoost.py. If you haven't added python x64 to your enviroment variabeles, add --no64 to the call. If you haven't aded x86, add --no86. If you have booth, just run the script without arguments. Compilation can take quite a while (~ 5 - 10 min). After that you should see compilation done. Boost.Python is now ready to use!

Compiling Intercept-Python

You can update the exported sqf functions by calling .\intercept-python\tools\CreatePythonWrapper.py. This will recreate .\intercept-python\src\SQFModules.hpp. Building intercept-python is easy:

  • Starting a command prompt (see note from boost compiling!)
  • Create a sub directory (e.g vcproj) and change into it.
  • Run cmake ...

When using msvc:

  • Run msbuild InterceptPython.sln or msbuild InterceptPython_x64.sln depending on the architecture!

The resulting library will be in Debug or Release. Keep this path open, we'll need it later one!

Note: You'll need to tell cmake explicitly that you want to compile x64. It's recommended to seperate the x86 from the x64 build!

Setting up Intercept.

Either use a precompiled intercept package and just add it as a every other mod or compile it from source and add it then. Instructions how to compile from source can be found here.

Create Intercept-Python mod

  • Pack .\intercept-python\addons\core to a pbo.
  • Create a new folder in your arma mod directory or root. Add a addons folder and copy the pbo into it.
  • Copy the .\intercept-python\python folder alongside the addons folder.
  • Create a interecpt folder along with the addons and python folder.
  • Copy the just created library into the intercept folder. Your mod structure should now look like this:
.\@Intercpt-Python
  \addons
    \core.pbo
  \intercept
    \Intercept_Python.dll
    \Intercept_Python_x64.dll
  \python
    \sqf
      \ai
      \...

Now you can add the mod to your launcher and run Intercept-Python!