# Installation Targets Guide
This document describes the CMake installation targets for FIX-FastTrade, including installation components, directory structure, and configuration options.
Overview
FIX-FastTrade uses CMake’s install system to provide a standardized installation process across different platforms. The installation system is designed to follow platform conventions while providing flexibility for custom deployments.
Installation Components
Runtime Component
Essential files needed to run FIX-FastTrade in production.
Includes:
* fix-fasttrade executable
* Runtime configuration files
* Essential documentation
Installation: .. code-block:: bash
# Install only runtime components cmake –build . –target install –component Runtime
# Or with make make install/Runtime
Development Component
Files needed for development and integration with other projects.
Includes:
* libfix-fasttrade-core.a static library
* All header files
* CMake configuration files
* Development documentation
Installation: .. code-block:: bash
# Install only development components cmake –build . –target install –component Development
# Or with make make install/Development
Documentation Component
Generated API documentation and guides.
Includes: * Doxygen-generated HTML documentation * API reference * Design documentation
Installation: .. code-block:: bash
# Install only documentation cmake –build . –target install –component Documentation
# Or with make make install/Documentation
Installation Targets
Standard Installation
Install all components to the configured prefix.
# Install everything to default location (/usr/local) make install
# Or with CMake directly cmake –build . –target install
Custom Installation Prefix
Install to a custom directory.
# Configure with custom prefix cmake .. -DCMAKE_INSTALL_PREFIX=/opt/fix-fasttrade make install
# Or reconfigure existing build cmake . -DCMAKE_INSTALL_PREFIX=$HOME/fix-fasttrade make install
User Installation
Install to user directory without root privileges.
# Install to user’s local directory cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local make install
# Update PATH for user installation echo ‘export PATH=$HOME/.local/bin:$PATH’ >> ~/.bashrc source ~/.bashrc
System-Wide Installation
Install to system directories (requires root).
# Install to system directories cmake .. -DCMAKE_INSTALL_PREFIX=/usr sudo make install
# Alternative system locations cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local # Default cmake .. -DCMAKE_INSTALL_PREFIX=/opt/fix-fasttrade # Optional software
Installation Directory Structure
Default Installation Layout
When installed with default prefix (/usr/local):
/usr/local/ ├── bin/ │ └── fix-fasttrade # Main executable ├── lib/ │ └── libfix-fasttrade-core.a # Static library ├── include/ │ ├── fix/ # FIX protocol headers │ │ ├── Application.h │ │ ├── Config.h │ │ ├── Message.h │ │ ├── MessageParser.h │ │ ├── Session.h │ │ ├── SessionID.h │ │ └── ZeroCopyMessage.h │ ├── infrastructure/ # Infrastructure headers │ │ ├── containers/ │ │ │ └── SimpleQueue.h │ │ ├── memory/ │ │ │ └── SimplePool.h │ │ ├── platform/ │ │ │ └── Platform.h │ │ ├── simd/ │ │ │ └── SIMDUtils.h │ │ └── threading/ │ │ └── CPUAffinity.h │ ├── model/ # Trading model headers │ │ ├── Order.h │ │ └── Trade.h │ └── service/ # Service layer headers │ ├── FixService.h │ └── TradingService.h ├── config/ # Configuration files │ ├── fix-config.xml # Main configuration │ ├── examples/ # Example configurations │ │ ├── basic-config.xml │ │ ├── advanced-config.xml │ │ └── test-config.xml │ └── schemas/ # XML schema files │ └── fix-config.xsd └── docs/ # Documentation (optional)
- └── html/ # Generated API docs
├── index.html ├── classes.html └── …
Custom Installation Layout
Example with custom prefix (/opt/fix-fasttrade):
/opt/fix-fasttrade/ ├── bin/fix-fasttrade ├── lib/libfix-fasttrade-core.a ├── include/[same structure as above] ├── config/[same structure as above] └── docs/[same structure as above]
User Installation Layout
Example with user prefix ($HOME/.local):
$HOME/.local/ ├── bin/fix-fasttrade ├── lib/libfix-fasttrade-core.a ├── include/[same structure as above] ├── config/[same structure as above] └── docs/[same structure as above]
Installation Configuration
CMake Installation Variables
CMAKE_INSTALL_PREFIX
Base directory for installation.
# Default: /usr/local on Unix, C:/Program Files on Windows cmake .. -DCMAKE_INSTALL_PREFIX=/custom/path
Component-Specific Directories
Override specific installation directories:
# Custom binary directory cmake .. -DCMAKE_INSTALL_BINDIR=bin
# Custom library directory cmake .. -DCMAKE_INSTALL_LIBDIR=lib64
# Custom include directory cmake .. -DCMAKE_INSTALL_INCLUDEDIR=include
# Custom configuration directory cmake .. -DCMAKE_INSTALL_SYSCONFDIR=etc
# Custom documentation directory cmake .. -DCMAKE_INSTALL_DOCDIR=share/doc
Full Path Overrides
Specify absolute paths for installation directories:
# Absolute paths cmake ..
-DCMAKE_INSTALL_FULL_BINDIR=/usr/bin -DCMAKE_INSTALL_FULL_LIBDIR=/usr/lib -DCMAKE_INSTALL_FULL_INCLUDEDIR=/usr/include -DCMAKE_INSTALL_FULL_SYSCONFDIR=/etc -DCMAKE_INSTALL_FULL_DOCDIR=/usr/share/doc
Platform-Specific Installation
Linux Installation
Follow Filesystem Hierarchy Standard (FHS):
# System installation (FHS compliant) cmake ..
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var
sudo make install
macOS Installation
Follow macOS conventions:
# macOS system installation cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local make install
# macOS application bundle (future) cmake .. -DCMAKE_INSTALL_PREFIX=/Applications/FIX-FastTrade.app/Contents make install
Windows Installation
Follow Windows conventions:
REM Windows system installation cmake .. -DCMAKE_INSTALL_PREFIX=”C:Program FilesFIX-FastTrade” cmake –build . –target install
REM Windows user installation cmake .. -DCMAKE_INSTALL_PREFIX=”%USERPROFILE%AppDataLocalFIX-FastTrade” cmake –build . –target install
Installation Examples
Development Environment Setup
Install for development with all components:
# Development installation mkdir -p build-dev && cd build-dev cmake ..
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$HOME/fix-fasttrade-dev
make -j$(nproc) make install
# Verify development installation ls -la $HOME/fix-fasttrade-dev/ $HOME/fix-fasttrade-dev/bin/fix-fasttrade –help
Production Deployment
Install optimized build for production:
# Production installation mkdir -p build-prod && cd build-prod cmake ..
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/fix-fasttrade
make -j$(nproc) sudo make install
# Create systemd service (Linux) sudo tee /etc/systemd/system/fix-fasttrade.service << EOF [Unit] Description=FIX-FastTrade Trading System After=network.target
[Service] Type=simple User=trading ExecStart=/opt/fix-fasttrade/bin/fix-fasttrade –config /opt/fix-fasttrade/config/fix-config.xml Restart=always RestartSec=5
[Install] WantedBy=multi-user.target EOF
sudo systemctl enable fix-fasttrade sudo systemctl start fix-fasttrade
Container Deployment
Install for containerized deployment:
# Multi-stage Docker build FROM ubuntu:20.04 AS builder RUN apt-get update && apt-get install -y build-essential cmake libboost-all-dev COPY . /src WORKDIR /src/build RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/app RUN make -j$(nproc) && make install
FROM ubuntu:20.04 AS runtime RUN apt-get update && apt-get install -y libboost-system1.71.0 libboost-thread1.71.0 COPY –from=builder /app /app EXPOSE 8080 CMD [“/app/bin/fix-fasttrade”, “–config”, “/app/config/fix-config.xml”]
Cross-Platform Installation
Install with portable configuration:
# Portable installation mkdir -p build-portable && cd build-portable cmake ..
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=”-O2 -mtune=generic” -DCMAKE_INSTALL_PREFIX=./install
make -j$(nproc) make install
# Create portable package tar -czf fix-fasttrade-portable.tar.gz -C install .
Post-Installation Configuration
Environment Setup
Configure environment after installation:
# Add to PATH (if not in standard location) export PATH=/opt/fix-fasttrade/bin:$PATH
# Add library path (if needed) export LD_LIBRARY_PATH=/opt/fix-fasttrade/lib:$LD_LIBRARY_PATH
# Set configuration path export FIX_FASTTRADE_CONFIG=/opt/fix-fasttrade/config/fix-config.xml
# Make permanent echo ‘export PATH=/opt/fix-fasttrade/bin:$PATH’ >> ~/.bashrc
Configuration File Setup
Set up configuration files after installation:
# Copy example configuration cp /opt/fix-fasttrade/config/examples/basic-config.xml
/opt/fix-fasttrade/config/fix-config.xml
# Edit configuration vim /opt/fix-fasttrade/config/fix-config.xml
# Validate configuration /opt/fix-fasttrade/bin/fix-fasttrade –config /opt/fix-fasttrade/config/fix-config.xml –validate
Service Integration
Integrate with system services:
# Create systemd service (Linux) sudo tee /etc/systemd/system/fix-fasttrade.service << EOF [Unit] Description=FIX-FastTrade Trading System After=network.target
[Service] Type=simple User=trading Group=trading ExecStart=/opt/fix-fasttrade/bin/fix-fasttrade –config /opt/fix-fasttrade/config/fix-config.xml WorkingDirectory=/opt/fix-fasttrade Restart=always RestartSec=5 StandardOutput=journal StandardError=journal
[Install] WantedBy=multi-user.target EOF
# Enable and start service sudo systemctl daemon-reload sudo systemctl enable fix-fasttrade sudo systemctl start fix-fasttrade sudo systemctl status fix-fasttrade
Installation Verification
Basic Verification
Verify installation completeness:
# Check executable which fix-fasttrade fix-fasttrade –version fix-fasttrade –help
# Check library ls -la /opt/fix-fasttrade/lib/libfix-fasttrade-core.a nm /opt/fix-fasttrade/lib/libfix-fasttrade-core.a | grep -i session
# Check headers ls -la /opt/fix-fasttrade/include/ find /opt/fix-fasttrade/include/ -name “*.h” | wc -l
# Check configuration ls -la /opt/fix-fasttrade/config/ xmllint –noout /opt/fix-fasttrade/config/fix-config.xml
Functional Verification
Test installed system functionality:
# Test configuration validation fix-fasttrade –config /opt/fix-fasttrade/config/examples/basic-config.xml –validate
# Test help system fix-fasttrade –help
# Test version information fix-fasttrade –version
# Test with minimal configuration fix-fasttrade –config /opt/fix-fasttrade/config/examples/test-config.xml –dry-run
Integration Verification
Test integration capabilities:
# Test library linking cat > test_integration.cpp << EOF #include <fix/Session.h> #include <iostream>
- int main() {
std::cout << “FIX-FastTrade library integration test” << std::endl; return 0;
} EOF
# Compile test g++ -I/opt/fix-fasttrade/include test_integration.cpp
-L/opt/fix-fasttrade/lib -lfix-fasttrade-core -lboost_system -lboost_thread -lpthread -o test_integration
# Run test ./test_integration
Uninstallation
Manual Uninstallation
Remove installed files manually:
# Remove installed files sudo rm -rf /opt/fix-fasttrade
# Remove service (if created) sudo systemctl stop fix-fasttrade sudo systemctl disable fix-fasttrade sudo rm /etc/systemd/system/fix-fasttrade.service sudo systemctl daemon-reload
# Remove user/group (if created) sudo userdel trading sudo groupdel trading
Package-Based Uninstallation
If installed via package manager:
# Debian/Ubuntu sudo dpkg -r fix-fasttrade
# CentOS/RHEL/Fedora sudo yum remove FIX-FastTrade # CentOS/RHEL sudo dnf remove FIX-FastTrade # Fedora
Installation Manifest
Create installation manifest for easier uninstallation:
# Create manifest during installation make install > install_manifest.txt 2>&1
# Use manifest for uninstallation cat install_manifest.txt | grep “Installing” |
sed ‘s/– Installing: //’ | xargs sudo rm -f
This comprehensive installation targets guide provides all the information needed to properly install, configure, and manage FIX-FastTrade installations across different environments and use cases.