CyxWiz LogoCyxWiz
DocsBuilding

Building from Source

Complete build instructions for all CyxWiz components on Windows, Linux, and macOS.

Prerequisites

ToolVersionWindowsLinuxmacOS
CMake3.20+cmake.orgapt install cmakebrew install cmake
Git2.0+git-scm.comapt install gitbrew install git
Rust1.70+rustup.rsrustup.rsrustup.rs
Python3.8+python.orgapt install python3brew install python

C++ Compiler

Windows

MSVC 2022+

Install Visual Studio 2022 with C++ workload

Linux

GCC 10+ or Clang 12+

apt install build-essential
macOS

Clang 12+

xcode-select --install

Quick Start

Windows
REM From Developer Command Prompt for VS 2022

REM Clone repository
git clone https://github.com/CYXWIZ-Lab/CYXWIZ.git
cd CyxWiz

REM First-time setup
setup.bat

REM Build all components
build.bat

REM Or build release only
build.bat release
Linux/macOS
# Clone repository
git clone https://github.com/CYXWIZ-Lab/CYXWIZ.git
cd CyxWiz

# First-time setup
chmod +x scripts/*.sh
./scripts/setup.sh

# Build all components
./scripts/build.sh

# Or build release only
./scripts/build.sh release

Manual Build Process

Step 1: Install vcpkg Dependencies
# Clone vcpkg (if not present)
git clone https://github.com/microsoft/vcpkg.git

# Bootstrap vcpkg
cd vcpkg
./bootstrap-vcpkg.sh  # Linux/macOS
# or
.\bootstrap-vcpkg.bat  # Windows

# Install dependencies (reads vcpkg.json)
./vcpkg install
cd ..
Step 2: Configure with CMake
# Windows Debug
cmake --preset windows-debug

# Windows Release
cmake --preset windows-release

# Linux Debug
cmake --preset linux-debug

# Linux Release
cmake --preset linux-release

# macOS Debug
cmake --preset macos-debug

# macOS Release
cmake --preset macos-release
Step 3: Build
# Build configured preset
cmake --build build/<preset-name> --config Release

# Build with parallel jobs
cmake --build build/windows-release --config Release -j 8

# Build specific target
cmake --build build/windows-release --target cyxwiz-engine
Step 4: Run Tests
cd build/<preset-name>
ctest --output-on-failure

# Run specific test
./bin/cyxwiz-tests "[tensor]"

CMake Presets

PresetPlatformBuild TypeDescription
windows-debugWindowsDebugDevelopment with symbols
windows-releaseWindowsReleaseOptimized production
linux-debugLinuxDebugDevelopment with symbols
linux-releaseLinuxReleaseOptimized production
macos-debugmacOSDebugDevelopment with symbols
macos-releasemacOSReleaseOptimized production
android-releaseAndroidReleaseMobile backend only

Build Options

# Enable/disable components
cmake --preset windows-release \
  -DCYXWIZ_BUILD_ENGINE=ON \
  -DCYXWIZ_BUILD_SERVER_NODE=ON \
  -DCYXWIZ_BUILD_TESTS=ON

# GPU backends
cmake --preset linux-release \
  -DCYXWIZ_ENABLE_CUDA=ON \
  -DCYXWIZ_ENABLE_OPENCL=ON

# Python bindings
cmake --preset linux-release \
  -DCYXWIZ_BUILD_PYTHON=ON \
  -DPython3_EXECUTABLE=/usr/bin/python3
OptionDefaultDescription
CYXWIZ_BUILD_ENGINEONBuild desktop client
CYXWIZ_BUILD_SERVER_NODEONBuild compute node
CYXWIZ_BUILD_TESTSONBuild test suite
CYXWIZ_BUILD_PYTHONONBuild Python bindings
CYXWIZ_ENABLE_CUDAOFFEnable CUDA backend
CYXWIZ_ENABLE_OPENCLONEnable OpenCL backend
CYXWIZ_ENABLE_PROFILINGOFFEnable profiling

Building Individual Components

CyxWiz Engine Only
cmake --preset windows-release \
  -DCYXWIZ_BUILD_SERVER_NODE=OFF

cmake --build build/windows-release \
  --target cyxwiz-engine
Server Node Only
cmake --preset linux-release \
  -DCYXWIZ_BUILD_ENGINE=OFF

cmake --build build/linux-release \
  --target cyxwiz-server-node
Backend Library Only
cmake --build build/windows-release \
  --target cyxwiz-backend
Central Server (Rust)
cd cyxwiz-central-server

# Set protoc path (Windows)
set PROTOC=..\vcpkg\packages\...

# Build and run
cargo build --release
cargo run --release

Build Artifacts

Windows
build/windows-release/
├── bin/
│   ├── cyxwiz-engine.exe
│   ├── cyxwiz-server-node.exe
│   └── cyxwiz-tests.exe
├── lib/
│   ├── cyxwiz-backend.dll
│   └── cyxwiz-backend.lib
└── python/
    └── pycyxwiz.pyd
Linux
build/linux-release/
├── bin/
│   ├── cyxwiz-engine
│   ├── cyxwiz-server-node
│   └── cyxwiz-tests
├── lib/
│   └── libcyxwiz-backend.so
└── python/
    └── pycyxwiz.so

Building with CUDA

  1. Install CUDA Toolkit from developer.nvidia.com
  2. Install NVIDIA driver
  3. Verify: nvidia-smi
cmake --preset linux-release \
  -DCYXWIZ_ENABLE_CUDA=ON \
  -DCMAKE_CUDA_ARCHITECTURES="75;80;86"
GPU GenerationArchitectureCUDA Arch
RTX 20xxTuring75
RTX 30xxAmpere86
RTX 40xxAda Lovelace89

Troubleshooting

"ArrayFire not found"
cmake --preset linux-release \
  -DArrayFire_DIR=/opt/arrayfire/...
"vcpkg dependencies missing"
cd vcpkg
./vcpkg install
"gRPC generation failed"
./vcpkg install protobuf grpc
protoc --cpp_out=. *.proto
Clean Build
rm -rf build/
# Or clean specific preset
cmake --build build/... --target clean