Compile: Difference between revisions
No edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
Latest Omni-bot version for Enemy Territory and Return to Castle Wolfenstein is in the '''stable''' branch !!! | Latest Omni-bot version for Enemy Territory and Return to Castle Wolfenstein is in the '''stable''' branch !!! | ||
Use the Download ZIP button or install Git and | Use the Download ZIP button or install Git and clone the repository. | ||
git clone https://github.com/jswigart/omni-bot.git -b stable --depth 1 --recursive /omni-bot | |||
You also need submodule GameMonkey: https://github.com/jswigart/gmscriptex | You also need submodule GameMonkey: https://github.com/jswigart/gmscriptex | ||
Omni-bot depends on the Boost libraries which can be downloaded from https://sourceforge.net/projects/boost/ | Omni-bot depends on the Boost libraries which can be downloaded from https://github.com/boostorg/boost/releases or https://sourceforge.net/projects/boost/ | ||
= Linux = | = Linux = | ||
You need C++ compiler: | |||
sudo apt-get install g++ | |||
== Compile Boost == | == Compile Boost == | ||
If your Linux distribution contains boost packages, you can just install the packages and skip this step. | If your Linux distribution contains boost packages, you can just install the packages and skip this step. But those packages does not work on 64-bit. | ||
Run shell | Run shell terminal and change current directory to boost source. | ||
./bootstrap.sh --with-libraries=date_time,filesystem,regex,system | ./bootstrap.sh --with-libraries=date_time,filesystem,regex,system | ||
./b2 address-model=32 link=static | ./b2 address-model=32 link=static | ||
You can use --prefix parameter to install | If you want to copy Boost to the system path /usr/local, you can use b2 parameter install, but it requires root privileges. You can also use --prefix parameter to install it to another folder. | ||
== Compile Omni-bot == | == Compile Omni-bot == | ||
If you want to compile Omni-bot for | If you don't want to compile Omni-bot for all supported games, open Omnibot\Jamfile in a text editor and insert comment # before build-project commands that you don't want to compile (they are at the end of Jamfile). | ||
Open script Omnibot\linux\buildbot.sh in a text editor and change paths. The BOOST_SUFFIX | Open script Omnibot\linux\buildbot.sh in a text editor and change paths. The '''$BOOST''' variable is a path to include header files. It is usually same as the Boost root installation folder. The '''$BOOST_LIB''' is path with static libraries (libboost_system.a, libboost_regex.a ...). They are usually located in $BOOST/stage/lib. The $BOOST_BUILD_PATH and $BOOST_SUFFIX variables are not needed anymore in the current Boost version. Then run the script. | ||
If you are lucky and compilation is successful, you will have file omnibot_et.so or omnibot_rtcw.so somewhere in Omnibot\build folder. | If you are lucky and compilation is successful, you will have file omnibot_et.so or omnibot_rtcw.so somewhere in Omnibot\build folder. | ||
Line 48: | Line 51: | ||
Add parameter address-model=64 to bjam command when you compile Omni-bot. | Add parameter address-model=64 to bjam command when you compile Omni-bot. | ||
== Cross-compilation == | |||
It is possible to build ARM binaries on x86 machine. | |||
sudo apt install g++-aarch64-linux-gnu | |||
Create file ~/user-config.jam: | |||
using gcc : arm : aarch64-linux-gnu-g++ ; | |||
Then add parameter toolset=gcc-arm when you compile Boost and Omni-bot. | |||
= Windows = | = Windows = |
Latest revision as of 11:17, 31 December 2024
You can get Omni-bot C++ source code from GitHub: https://github.com/jswigart/omni-bot
Latest Omni-bot version for Enemy Territory and Return to Castle Wolfenstein is in the stable branch !!!
Use the Download ZIP button or install Git and clone the repository.
git clone https://github.com/jswigart/omni-bot.git -b stable --depth 1 --recursive /omni-bot
You also need submodule GameMonkey: https://github.com/jswigart/gmscriptex
Omni-bot depends on the Boost libraries which can be downloaded from https://github.com/boostorg/boost/releases or https://sourceforge.net/projects/boost/
Linux
You need C++ compiler:
sudo apt-get install g++
Compile Boost
If your Linux distribution contains boost packages, you can just install the packages and skip this step. But those packages does not work on 64-bit.
Run shell terminal and change current directory to boost source.
./bootstrap.sh --with-libraries=date_time,filesystem,regex,system ./b2 address-model=32 link=static
If you want to copy Boost to the system path /usr/local, you can use b2 parameter install, but it requires root privileges. You can also use --prefix parameter to install it to another folder.
Compile Omni-bot
If you don't want to compile Omni-bot for all supported games, open Omnibot\Jamfile in a text editor and insert comment # before build-project commands that you don't want to compile (they are at the end of Jamfile).
Open script Omnibot\linux\buildbot.sh in a text editor and change paths. The $BOOST variable is a path to include header files. It is usually same as the Boost root installation folder. The $BOOST_LIB is path with static libraries (libboost_system.a, libboost_regex.a ...). They are usually located in $BOOST/stage/lib. The $BOOST_BUILD_PATH and $BOOST_SUFFIX variables are not needed anymore in the current Boost version. Then run the script.
If you are lucky and compilation is successful, you will have file omnibot_et.so or omnibot_rtcw.so somewhere in Omnibot\build folder.
Compile Mods
Run script buildet.sh or buildrtcw.sh.
Files cgame.mp.i386.so and ui.mp.i386.so must be compressed into archive omnibot_et.pk3 or omnibot_rtcw.pk3.
64-bit
If you use 64-bit ET:Legacy and legacy mod, you must compile 64-bit Omni-bot.
Add parameters address-model=64 cflags=-fPIC when you compile Boost.
Add parameter address-model=64 to bjam command when you compile Omni-bot.
Cross-compilation
It is possible to build ARM binaries on x86 machine.
sudo apt install g++-aarch64-linux-gnu
Create file ~/user-config.jam:
using gcc : arm : aarch64-linux-gnu-g++ ;
Then add parameter toolset=gcc-arm when you compile Boost and Omni-bot.
Windows
Project files are for Microsoft Visual Studio 2017 or newer. You can download free Community edition. While installing choose the "Desktop development with C++" workload.
Compile Boost
You can easily download boost binaries from https://sourceforge.net/projects/boost/files/boost-binaries/. Then you don't need to compile it and you can skip this step.
Start "x86 Native Tools Command Prompt for VS" from the Start menu. Change current directory to boost root.
bootstrap.bat .\b2 --with-date_time --with-filesystem --with-regex --with-system link=static runtime-link=static variant=release
Add parameter address-model=64 if you compile 64-bit version.
Change variant parameter to debug if you want to compile Omni-bot with debugging info.
Change runtime-link parameter to shared if you want to use Code Generation / Runtime Library - Multi-threaded DLL (/MD)
Compile Omni-bot
Open file Omnibot\projects\msvc12\PropertySheets\Paths.props in a text editor and change the BOOST path.
Open solution Omnibot\projects\msvc12\Omni-bot.sln.
The solution contains projects for all supported games. Project MOD_ET is for Enemy Territory. Project MOD_RTCW is for Return to Castle Wolfenstein. Projects Common and gm_ex are required for both games.
Select Release or Debug configuration and Win32 or x64 configuration on the toolbar and compile. There is a Post-Build Event defined to copy output files to installation folders. These folders are defined in Omnibot\projects\msvc12\PropertySheets\Paths.props. Files omnibot_et.dll or omnibot_et_x64.dll are copied into ET_INST. Files omnibot_rtcw.dll or omnibot_rtcw_x64.dll are copied into RTCW_INST.
Compile Mods
Enemy Territory mod solution: GameInterfaces\ET\src\ET.sln
Return to Castle Wolfenstein solution: GameInterfaces\RTCW\src\RTCW.sln
There are 3 projects in the solution: cgame, game, ui. Projects cgame and ui have Post-Build Event defined to compress cgame_mp_x86.dll and ui_mp_x86.dll into omnibot_et.pk3 or omnibot_rtcw.pk3.