Skip to content

Latest commit

 

History

History
220 lines (160 loc) · 3.77 KB

File metadata and controls

220 lines (160 loc) · 3.77 KB

Installation Guide

Prerequisites

This FIX/SBE engine requires OCaml and the Dune build system. Follow the instructions below for your platform.

Windows Installation

Option 1: Using OCaml for Windows (Recommended)

  1. Install OCaml for Windows

    Download and install from: https://fdopen.github.io/opam-repository-mingw/installation/

    Or use Diskuv OCaml (DkML):

    winget install Diskuv.OCaml
  2. Initialize OPAM

    opam init -y
    eval $(opam env)
  3. Create OCaml switch (if needed)

    opam switch create 4.14.1
    eval $(opam env)
  4. Install Dune

    opam install dune -y

Option 2: Using WSL2 (Alternative)

If you prefer a Linux environment:

# Install WSL2
wsl --install

# Inside WSL2
sudo apt update
sudo apt install opam
opam init -y
eval $(opam env)
opam install dune -y

Linux Installation

# Ubuntu/Debian
sudo apt update
sudo apt install opam
opam init -y
eval $(opam env)
opam switch create 4.14.1
eval $(opam env)
opam install dune -y

# Fedora/RHEL
sudo dnf install opam
opam init -y
# ... rest same as above

macOS Installation

# Using Homebrew
brew install opam
opam init -y
eval $(opam env)
opam switch create 4.14.1
eval $(opam env)
opam install dune -y

Installing Project Dependencies

Once OCaml and Dune are installed:

cd d:/ag/FIX-SBE-Engine

# Install project dependencies
opam install . --deps-only -y

# Or install individually
opam install lwt lwt_ppx ppx_deriving yojson xmlm logs fmt alcotest benchmark -y

Building the Project

# Build everything
dune build

# Build in release mode (optimized)
dune build --release

# Clean build artifacts
dune clean

Running Tests

# Run all tests
dune runtest

# Run specific test
dune exec tests/test_fix_codec.exe

# Verbose test output
dune runtest --display=short

Verifying Installation

Check that everything is working:

# Check OCaml version
ocaml --version
# Should show: The OCaml toplevel, version 4.14.1 or higher

# Check Dune version
dune --version
# Should show: 3.7 or higher

# Check OPAM packages
opam list

Troubleshooting

"dune: command not found"

After installing dune, make sure to run:

eval $(opam env)

Add this to your shell profile (~/.bashrc or ~/.zshrc):

test -r ~/.opam/opam-init/init.sh && . ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true

Build errors

If you get compilation errors, try:

dune clean
opam update
opam upgrade
dune build

Windows-specific issues

  • Ensure you're using an OCaml-compatible shell (PowerShell, Git Bash, or WSL)
  • Some packages may require MinGW or MSVC toolchain
  • Consider using WSL2 for the most compatible experience

Quick Start (Once Installed)

cd d:/ag/FIX-SBE-Engine

# Build and test
dune build
dune runtest

# See test output
dune exec tests/test_fix_codec.exe
dune exec tests/test_fix_session.exe

Docker Alternative

If you encounter installation issues, you can use Docker:

# Create Dockerfile
FROM ocaml/opam:debian-ocaml-4.14

WORKDIR /app
COPY . .

RUN opam install . --deps-only -y
RUN eval $(opam env) && dune build

CMD ["dune", "runtest"]

Then run:

docker build -t fix-sbe-engine .
docker run -it fix-sbe-engine

Next Steps

After successful installation:

  1. Review the README.md for project overview
  2. Explore the code in src/core/
  3. Run tests to verify functionality
  4. Check out examples (coming soon)

Resources