(WIP) Guide on how to compile RCBot2 Src Code |
(WIP) Guide on how to compile RCBot2 Src Code |
RoboCop |
Sep 25 2021, 12:03 PM
Post
#1
|
RCBot Fan Group: Admin Posts: 192 Joined: 17-December 15 From: Dundee, Scotland Member No.: 2,435 |
In this topic, I will explain how to prepare and compile RCBot2 for both Linux and Windows.
Now in order to do this, you will require Python 3, Git as well as the compilers (GCC 5+ and Clang for Linux) and the MSVC compiler kit from Visual Studio 2015 or newer. And you will also need to have the HL2SDK, SourceMod and Metamod headers that are provided from my Github Repository. Preparation:- Before you start you will need to read this documentation from AlliedMods wiki page in order to compile it properly. You will find the requirements and tools you will need to install. (Python 2 is now EOLed and depreciated, so maybe best install Python 3.) https://wiki.alliedmods.net/Building_SourceMod Linux AMBuild installation:- Now in order to use and install AMBuild, you will need to load the Linux Terminal Shell and type in this and to obtain AMBuild:- (For Debian, Ubuntu and Linux Mint Distros) CODE $ sudo apt install python python-clang python-pip git gcc g++ clang clang++ To obtain AMBuild:- CODE $ sudo git clone https://github.com/alliedmodders/ambuild $ sudo pip install ./ambuild Hint: For Linux rookies who get stuck if you want your Terminal to go back a folder type `cd ..`. It's recommended not to use or log in as a root user. Now for using RCBot2 you could either use `$ sudo git clone https://github.com/APGRoboCop/rcbot2` or download the source code directly from there. Once you have downloaded RCBot2 src code create a folder named "build" in the main /rcbot folder by typing `mkdir build` or if you using Linux Mint with a Cinnamon Desktop, simply right-click in the /rcbot folder window and click [Create New Folder] and name it "build" https://apg-clan.org/attachment.php?attachm...972&thumb=1 This method is easier and requires fewer clicks than having to type the directory for like `cd /rcbot2/build` or the full directory etc:- https://apg-clan.org/attachment.php?attachm...986&thumb=1 Compiling in Linux:- Now say for example you want to compile RCBot2 for TF2 debug build what you need to do is type this in the Terminal located in /rcbot2/build like this:- CODE $ python3 ../configure.py -s tf2 --mms_path ./alliedmodders/metamod-source --hl2sdk-root ./alliedmodders --sm-path ./alliedmodders/sourcemod --enable-debug $ ambuild And hopefully, the RCBot2 package is compiled and ready! Troubleshooting: If you cannot get AMBuild to compile or locate the SDKs properly try typing the full directory address like for example: CODE $ python3 ../configure.py -s tf2 --mms_path /home/desktop/Dropbox/src/rcbot2/alliedmodders/metamod-source --hl2sdk-root /home/desktop/Dropbox/src/rcbot2/alliedmodders --sm-path /home/desktop/Dropbox/src/rcbot2/alliedmodders/sourcemod --enable-debug Windows AMBuild installation:- https://wiki.alliedmods.net/Ambuild Now in order to use install AMBuild you will need to install Visual Studio 2015 or later. The way to obtain AMBuild from git is similar to `git clone https://github.com/alliedmodders/ambuild` and `pip install ./ambuild` but as you noticed that "sudo" isn't used as that is mainly for Linux. But before that in order to install Python 3 and have it loaded directly from Visual Studio Developer PowerShell, you can either install Chocolatey or Scoop. Personally, from my side, the Python 3 package from MS Store got some privilege flaws that make Python 3 hard to load and execute .py files. https://scoop.sh/ https://chocolatey.org/ But for this tutorial, I will show you on using Scoop. Simply go to Start Menu and find and select [Developer PowerShell for VS]. Once you have opened the PowerShell, type these into the console: CODE PS C:\> iwr -useb get.scoop.sh | iex PS C:\> Set-ExecutionPolicy RemoteSigned -scope CurrentUser (Type [Y] for Yes after that) CODE PS C:\> scoop install git python Hopefully, both Git and Python will install properly. That way you can install AMBuild like so:- CODE PS C:\> git clone https://github.com/alliedmodders/ambuild PS C:\> pip install ./ambuild Compiling in Windows:- And now it should be ready for RCBot2 src code to be compiled, but like before from the Linux Compiling step you may encounter some Troubleshooting issues. So to keep those to a minimum follow those steps. Type `cd` and the Folder Address like this for example if you got RCBot2 src code downloaded from a second HDD or USB Flash Drive - if not and from C:\ drive, ignore the second line if so:- CODE PS C:\> cd E:\rcbot2-master\build PS C:\> e: Don't forget to create /build folder in /rcbot2. Now say for example you want to compile RCBot2 for TF2 debug build what you need to do is type this in the Terminal located in /rcbot2/build like this:- CODE PS E:\rcbot2-master\build python3 ../configure.py -s tf2 --mms_path ./alliedmodders/metamod-source --hl2sdk-root ./alliedmodders --sm-path ./alliedmodders/sourcemod --enable-debug PS E:\rcbot2-master\build ambuild And hopefully, the RCBot2 package for Windows is compiled and ready! Troubleshooting: If you cannot get AMBuild to compile using Developer PowerShell or locate the SDKs properly try typing the full directory address like for example: CODE PS E:\rcbot2-master\build python3 ../configure.py -s tf2 --mms_path E:/rcbot2-master/alliedmodders/metamod-source --hl2sdk-root E:/rcbot2-master/alliedmodders --sm-path E:/rcbot2-master/alliedmodders/sourcemod --enable-debug Also if Developer PowerShell does not appear to work on your side you could try using [Developer Command Prompt for VS] to see if it will compile better with this app. The downside with this app is you will definitely need to use the `cd E:` as the PowerShell more or less automatically reassigns you to that destination folder and that it will not keep a backlog of the commands you had typed when you are finished with the Developer Command Prompt. And before I forget be sure to keep AMBuild and Python 3 up-to-date. For keeping Python 3 up-to-date simply type `scoop update *` to keep the packages up-to-date. Of course, for Linux Computers like Debian or Ubuntu requires typing `sudo apt update` followed by `sudo apt upgrade`. |
Lo-Fi Version | Time is now: 16th November 2024 - 05:00 AM |