macOS Installation
Step-by-step guide to install and run Gurotopia on macOS
macOS Installation
This guide covers installing Gurotopia on macOS using Homebrew or MacPorts.
macOS is only tested on Intel (x86_64). Apple Silicon is not tested yet.
include/enet/lib/libenet_macos.a is a universal (x86_64 + arm64) archive, so it should still
link on Apple Silicon.
Prerequisites
You'll need a terminal and administrator access. Install Apple's Command Line Tools first:
xcode-select --installInstall Dependencies
Pick one package manager. You can also mix them: MacPorts GCC plus Homebrew OpenSSL and MariaDB is a common setup. Use the Homebrew compile command below if brew --prefix openssl@3 exists.
Homebrew
brew install gcc make openssl@3 mariadb-connector-cMacPorts
sudo port install gcc15 gmake openssl3 mariadb-11.4MacPorts GNU Make is installed as gmake. Gurotopia requires GCC 13 or newer — gcc15
satisfies that. See the FAQ if std::format fails.
This installs:
- GCC - The GNU Compiler Collection for C/C++
- Make - Build automation tool
- OpenSSL - For SSL/TLS encryption
- MariaDB - Client library (
-lmariadb)
Clone the Repository
git clone https://github.com/gurotopia/Gurotopia.git
cd GurotopiaCompile the Server
Apple's SDK does not ship OpenSSL headers, and the Makefile does not add Homebrew or MacPorts
paths. Pass them on the make line. Plain make will fail with openssl/ssl.h: No such file or directory.
Homebrew
make -j$(sysctl -n hw.ncpu) \
includes="-Iinclude -Ibuild/include -I$(brew --prefix openssl@3)/include" \
libraries="-L$(brew --prefix openssl@3)/lib -L$(brew --prefix mariadb-connector-c)/lib -L./include/enet/lib -L./include/mysql/lib -lssl -lcrypto -lmariadb -lenet_macos"MacPorts
gmake -j$(sysctl -n hw.ncpu) \
includes="-Iinclude -Ibuild/include -I/opt/local/libexec/openssl3/include" \
libraries="-L/opt/local/libexec/openssl3/lib -L/opt/local/lib/mariadb-11.4/mysql -L./include/enet/lib -L./include/mysql/lib -lssl -lcrypto -lmariadb -lenet_macos"sysctl -n hw.ncpu uses all available CPU cores. Use gmake if Make came from MacPorts. The
extra -lenet_macos flag links the macOS ENet archive; the default -lenet is a Linux library.
Got a build error? Visit the FAQ section, it might have the solution you need!
Build Output
After successful compilation, you'll find the executable in the project directory:
./main.outRun the Server
Execute the compiled binary:
./main.outThe server will start and display connection information in the terminal.
Run in Background
To run the server in the background:
nohup ./main.out > server.log 2>&1 &Or use screen or tmux for a persistent session:
screen -S gurotopia
./main.out
# Press Ctrl+A, then D to detachTroubleshooting
Permission denied
Make the binary executable:
chmod +x main.outMissing libraries / OpenSSL not found
The compiler is not searching Homebrew or MacPorts. Re-run the compile command from this page
(not a bare make). If the prefixes are empty, reinstall the packages:
# Homebrew
brew install gcc make openssl@3 mariadb-connector-c
# MacPorts
sudo port install gcc15 gmake openssl3 mariadb-11.4Port already in use
Check if another process is using the port:
sudo lsof -i :17091Kill the process or change the port in configuration.