Skip to content

Installation Guide

Introduction

This guide describes how to install and set up the MES Infrastructure and its components. You can choose to install all or only the components you need, depending on your use case. These tools allow you to use published models. To use our tools, please refer to Tutorials.

Prebuilt Releases

A prebuilt package of executables is available for direct download. This eliminates the need for manual compilation. The binaries are built on manylinux2014 and are compatible with any Linux distribution using glibc ≥ 2.17 (Ubuntu >= 13.04, Centos>=7 or any other linux distro that has glibc>=2.17). You must also install OpenMP support.

You might also want to install our PyPi python package for working with python.

pip install medpython
Platform Support for MedPython

Platform x86_64 (Intel/AMD) aarch64 (ARM / Apple Silicon)
Linux (glibc) ✅ Pre-built (Py 3.10-3.14) ✅ Pre-built (Py 3.12)
Linux (Alpine/musl) 🛠️ Compile Required 🛠️ Compile Required
Windows ✅ Pre-built (Py 3.10-3.13) 🛠️ Compile Required
macOS ✅ Pre-built (Py 3.10-3.13) 🛠️ Compile Required

Note: For any Compile Required or either not listed as Pre-built. Compliation is required. See the "Build from Source" instructions below.

Prerequisites

Install OpenMP Support (Ubuntu)

Install OpenMP for parallel processing:

sudo apt install libgomp1 -y

Note: This step is required even if you don't plan to compile the tools. It is required for runtime. Equivalent package exists in other linux distros, but here we will cover Ubuntu.

Building the tools yourself

Before building the tools, complete the following steps:

1. Install Compiler and Build Tools (Ubuntu)

Install the required compiler and build tools if you want to build the software yourself:

sudo apt install binutils gcc g++ cmake make -y

2. Install Boost Libraries (Ubuntu)

Compiling Boost from Source

You can download Boost and compile it manually. Example steps for version 1.85.0:

Boost Compilation
# Install tools for download and extraction
sudo apt install bzip2 wget -y

# Download Boost
VERSION=1.85.0
VERSION_2=$(echo ${VERSION} | awk -F. '{print $1 "_" $2 "_" $3}')
wget https://archives.boost.io/release/${VERSION}/source/boost_${VERSION_2}.tar.bz2

# Extract files
tar -xjf boost_${VERSION_2}.tar.bz2
rm -f boost_${VERSION_2}.tar.bz2

# Set up Boost install directory
WORK_BUILD_FOLDER=$(realpath .)
cd boost_${VERSION_2}

# Configure and clean
./bootstrap.sh
./b2 --clean

# Build static libraries
./b2 cxxflags=-march=x86-64 cxxflags=-fPIC pch=off link=static variant=release linkflags=-static-libstdc++ -j8 --stagedir="${WORK_BUILD_FOLDER}/Boost" --with-program_options --with-system --with-regex --with-filesystem

mkdir -p ${WORK_BUILD_FOLDER}/Boost/include

# Link headers to Boost/include
ln -sf ${WORK_BUILD_FOLDER}/boost_${VERSION_2}/boost  ${WORK_BUILD_FOLDER}/Boost/include

# Build shared libraries (not needed for AlgoMarker, but needed for MES tools if you choose to compile)
./b2 cxxflags=-march=x86-64 cxxflags=-fPIC pch=off link=shared variant=release linkflags=-static-libstdc++ -j8 --stagedir="${WORK_BUILD_FOLDER}/Boost" --with-program_options --with-system --with-regex --with-filesystem

Installing Boost via Package Manager

sudo apt install libboost-program-options1.83-dev -y

Note: On Ubuntu 22.04, Boost version 1.74 is available and compatible. It was also tested with newest Boost version 1.89.0(2025-August-14) as today

Important: This method is not required for the AlgoMarker library or the Python API. This is only for working with the legacy tools

Available Components

You can install any of the following five components:

  1. AlgoMarker Shared Library: A shared Linux C library for accessing the AlgoMarker API and generating predictions/outputs from a model. Designed for production use, it supports only the essential "predict" and related APIs. Follow those steps only if you want to productize your model.
  2. AlgoMarker Wrapper: A REST API wrapper for the AlgoMarker Shared Library. Follow those steps only if you want to productize your model.
  3. MES Tools to Train and Test Models: Command-line executables for training, testing, and manipulating models using the MR_LIBS infrastructure. Required for training new models. Alternatively, you can use the Python API.
  4. Python API for MES Infrastructure: Python API, enabling model training, testing, and manipulation from Python. Some features may only be available via MES Tools or by extending the Python API.
  5. [MR_Scripts]: Useful Python and Bash scripts. Clone the repository with git clone git@github.com:Medial-EarlySign/MR_Scripts.git. No need to install it.

Environment Setup Script

After installing the required components, it is recommended to use the following script to configure your shell environment for all tools and scripts (This is only needed, if you are not using the python pypi package or if you want to use the executables):

Start-Up Script
#!/bin/bash

# Path to Boost Library (If you compiled the boost library)
BOOST_ROOT=${HOME}/Documents/MES/Boost
# Path to Git repository clones - here in the example, we clones all repositories under ${HOME}/Documents/MES
MR_LIBS=${HOME}/Documents/MES/MR_LIBS
MR_TOOLS=${HOME}/Documents/MES/MR_Tools
MR_SCRIPTS=${HOME}/Documents/MES/MR_Scripts
PY_VERSION=$(python -c "import platform; print(''.join(platform.python_version().split('.')[:2]))")

LD_PATH=${BOOST_ROOT}/lib
export PATH=$PATH:${MR_TOOLS}/AllTools/Linux/Release:${MR_SCRIPTS}/Python-scripts:${MR_SCRIPTS}/Bash-Scripts:${MR_SCRIPTS}/Perl-scripts
if [ ! -z "$LD_LIBRARY_PATH" ]; then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LD_PATH}
else
    export LD_LIBRARY_PATH=${LD_PATH}
fi
export AUTOTEST_LIB=${MR_TOOLS}/AutoValidation/kits
# Those lines are needed only if compling from source/not installing pypi python package of medpython
export PYTHONPATH=${MR_LIBS}/Internal/MedPyExport/generate_binding/Release/medial-python${PY_VERSION}:${MR_TOOLS}/RepoLoadUtils/common
export BOOST_ROOT

Tip: Adjust the LD_PATH, MR_LIBS, MR_TOOLS, and MR_SCRIPTS variables as needed for your system.