SECONDO

Installation Instructions

This page explains how to install Secondo and the tools it requires on your computer. The currently supported and CI-verified paths are a build from sources on Ubuntu / Debian, precompiled .deb binary packages for Ubuntu, and a build on macOS using Homebrew. Older distributions are covered by the historical installation guides. The build of Secondo from sources itself is explained on the Sources page.

Which installation is right for you?

Installation on Ubuntu / Debian (from sources)

The steps below install the tools required to compile Secondo and then build the system from sources. They are verified in continuous integration on Ubuntu 22.04, 24.04 and 26.04 (on the Intel/AMD x86_64 architecture). Debian 13 (Trixie) works in exactly the same way; the package names below are identical on Debian.

  1. Install the build tools and libraries. These include the C/C++ compiler, Berkeley DB, the Boost libraries, a Java Development Kit (default-jdk) for the Java GUI and optimizer server, and SWI-Prolog with its Java bridge (JPL) for the optimizer:
    sudo apt-get update
    sudo apt-get install flex bison gcc g++ build-essential \
        libdb5.3 libdb5.3-dev libdb5.3++ libdb5.3++-dev db5.3-util \
        libjpeg-dev libgsl0-dev libreadline-dev librecode-dev \
        libgmp-dev libgmp10 libncurses-dev libxml2-dev libboost-all-dev \
        libbison-dev libfl-dev libquadmath0 nlohmann-json3-dev \
        default-jdk swi-prolog swi-prolog-nox swi-prolog-java
    
  2. Get the sources and build Secondo. The build environment (compiler, Berkeley DB, SWI-Prolog and JPL paths, ...) is derived automatically from the installed tools; you only have to set SECONDO_BUILD_DIR and source the detection script:
    export SECONDO_BUILD_DIR=$HOME/secondo
    source $SECONDO_BUILD_DIR/CM-Scripts/secondo-detect.sh
    
    It is convenient to add these two lines to your ~/.bashrc, so the environment is set up automatically in every new terminal:
    echo 'export SECONDO_BUILD_DIR=$HOME/secondo' >> ~/.bashrc
    echo 'source $SECONDO_BUILD_DIR/CM-Scripts/secondo-detect.sh' >> ~/.bashrc
    
    Then download the sources and build the system as described on the Sources page (in short: run make in $SECONDO_BUILD_DIR).

Binary Installation via .deb Packages (Ubuntu, apt-get)

For users who just want to try Secondo without compiling it, we provide precompiled .deb packages for Ubuntu 22.04, 24.04 and 26.04. They install Secondo and all of its dependencies within a few minutes via apt-get, and are the recommended starting point for new users. Developers who want to build their own extensions should instead build from sources as described above.

See the Ubuntu installation guide using apt-get for the full instructions. Note that these packages are built for the x86_64/amd64 architecture only; on other architectures (e.g. arm64) please build from sources.

Installation on macOS (Intel and Apple Silicon)

On macOS, all tools required by Secondo are installed with the Homebrew package manager — a separate SDK download is no longer needed. The steps below are verified on macOS 15 (Sequoia) and macOS 26 (Tahoe), on both Intel (x86_64) and Apple Silicon (arm64). Enter the commands in a terminal.

  1. Install the Xcode command line tools (C/C++ compiler, make, system headers):
    xcode-select --install
    
  2. Install Homebrew (skip if it is already present); see brew.sh:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  3. Install the build tools and libraries:
    brew install flex bison berkeley-db gsl jpeg-turbo boost gmp libxml2 readline nlohmann-json
    
    Homebrew's flex and bison are "keg-only" and are not put on the PATH automatically. Add them to your ~/.zshrc:
    echo 'export PATH="$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc
    
  4. Install a Java Development Kit (JDK 21). It is used to build the Java GUI and the optimizer server:
    brew install openjdk@21
    
    Follow the caveats printed by Homebrew to make this JDK visible to the system (or install an equivalent JDK 21, e.g. Temurin).
  5. Install SWI-Prolog with Java (JPL) support. The Prolog optimizer needs SWI-Prolog, and the Java-based optimizer server additionally needs its JPL bridge (jpl.jar and libjpl.dylib). Homebrew's swi-prolog bottle is built without JPL, so build it from source with the Java package enabled. Open the formula:
    brew edit swi-prolog
    
    change the CMake option -DSWIPL_PACKAGES_JAVA=OFF to -DSWIPL_PACKAGES_JAVA=ON, save, and reinstall from source (the JDK from the previous step must be installed):
    brew reinstall --build-from-source swi-prolog
    
    This places jpl.jar and libjpl.dylib in the SWI-Prolog library directory, where Secondo finds them automatically. If you do not need the optimizer server, you can instead install the plain bottle with brew install swi-prolog.
  6. Get the sources and build Secondo. The build environment (compiler, Berkeley DB, SWI-Prolog and JPL paths, ...) is derived automatically from the installed tools; you only have to set SECONDO_BUILD_DIR and source the detection script:
    export SECONDO_BUILD_DIR=$HOME/secondo
    source $SECONDO_BUILD_DIR/CM-Scripts/secondo-detect.sh
    
    It is convenient to add these two lines to your ~/.zshrc, so the environment is set up automatically in every new terminal:
    echo 'export SECONDO_BUILD_DIR=$HOME/secondo' >> ~/.zshrc
    echo 'source $SECONDO_BUILD_DIR/CM-Scripts/secondo-detect.sh' >> ~/.zshrc
    
    Then download the sources and build the system as described on the Sources page (in short: run make in $SECONDO_BUILD_DIR).

Upgrading the macOS version

After an upgrade of the macOS operating system, the Xcode developer tools have to be reinstalled. If you have upgraded your system and the call of make produces the following error message:
xcrun: error: invalid active developer path
then you have to reinstall the Xcode developer tools. To do so, start a terminal and enter:
xcode-select --install
In the upcoming dialog, click on the button Installation and wait until the installation is finished. After that, the make process should run as before.

Installation Guides for Historical Distributions

Older operating-system releases (Fedora, SuSE, and older Ubuntu versions) were installed with per-version scripts that are no longer maintained. They are kept for reference on the historical installation guides page.

Last Changed: 2026-07-15 (JNI)