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.
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
SECONDO_BUILD_DIR and source the detection script:
export SECONDO_BUILD_DIR=$HOME/secondo source $SECONDO_BUILD_DIR/CM-Scripts/secondo-detect.shIt 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' >> ~/.bashrcThen download the sources and build the system as described on the Sources page (in short: run
make
in $SECONDO_BUILD_DIR).
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.
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.
make, system headers):
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install flex bison berkeley-db gsl jpeg-turbo boost gmp libxml2 readline nlohmann-jsonHomebrew'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
brew install openjdk@21Follow the
caveats printed by Homebrew to make this JDK visible to the
system (or install an equivalent JDK 21, e.g. Temurin).
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-prologchange 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-prologThis 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.
SECONDO_BUILD_DIR and source the detection script:
export SECONDO_BUILD_DIR=$HOME/secondo source $SECONDO_BUILD_DIR/CM-Scripts/secondo-detect.shIt 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' >> ~/.zshrcThen download the sources and build the system as described on the Sources page (in short: run
make
in $SECONDO_BUILD_DIR).
make
produces the following error message:
xcrun: error: invalid active developer paththen you have to reinstall the Xcode developer tools. To do so, start a terminal and enter:
xcode-select --installIn the upcoming dialog, click on the button
Installation and wait until the
installation is finished. After that, the make process should run
as before.
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.