Skip to content

Building CRHMcode GCC

jhs507 edited this page Sep 24, 2024 · 8 revisions

Building CRHMcode GCC

Using the install script

A installation script is provided in crhmcode/crhmcode/src/install_crhm.sh when executed with super user permissions ie sudo ./install_crhm.sh it will install crhm into /usr/local and place the crhmConfig.h header in /usr/include

Ubuntu and Linux Variants:

  1. Checkout desired branch from this repository (or download the source distribution zip file from one of the listed releases and skip to step 6)
  2. Download boost from https://www.boost.org/users/history/version_1_75_0.html
  3. Decompress the downloaded boost archive
  4. Place the boost_1_75_0 directory in crhmcode/crhmcode/src/libs directory
  5. Initialize the spdlog submodule by running the commands git submodule init and git submodule update
  6. Create a build folder at crhmcode/crhmcode/build.
  7. Change directories to the build folder cd crhmcode/crhmcode/build
  8. Configure the project with CMake cmake ../src
  9. Build the project with CMake cmake --build .
  10. The build folder will contain the crhm executable which can then be moved to any convenient location

Windows with WSL2 (Recommended)

This method uses the Windows Subsystem For Linux which allows you to run Linux distributions directly under your Windows 10 or 11 OS. This method is rec

  1. Install WSL2 using the instructions found here: https://learn.microsoft.com/en-us/windows/wsl/install#install-wsl-command Following these instructions will install a Ubuntu distribution.
  2. Run the Ubuntu application to open the Ubuntu command line. (You can search for "Ubuntu" in the start menu to find the application)
  3. Run the command: sudo apt update
  4. Run the command: sudo apt upgrade
  5. Run the command: sudo apt install build-essential
  6. Run the command: sudo apt install cmake
  7. Follow the Ubuntu installation instructions above

Windows with MSYS2 and MinGW

This method uses MSYS2 and MinGW to allow you to run some programs in a Linux-like environment. This method is less recommended as most testing of CRHM takes place within an Ubuntu environment.

  1. Install MSYS2 following the directions found here: https://www.msys2.org/#installation
  2. From the start menu run "MSYS MinGW 64-bit" (You will need to "run as administrator")
  3. In the MSYS MinGW console navigate to the crhmcode/crhmcode directory
  4. Run the command pacman -S mingw-w64-x86_64-toolchain
  5. Run the command pacman -Qs make
  6. Run the command pacman -S mingw-w64-x86_64-cmake
  7. Follow the Ubuntu installation instructions above

Clone this wiki locally