Building sygnm from source

From sygnm
Jump to: navigation, search

Operating systems

The current version can be built on Linux. The Windows and Haiku OS ports are work in progress. On Arch Linux, sygnm can be installed from the AUR (see Downloading and installing sygnm).

Getting the source code

The source code can be downloaded from the git repository (, or from the download section of the website.


To build the latest release, a C++17-compatible C++ compiler, cmake (>=3.3.0), and the following dependencies will be needed:

  • sygnm-core
    • Boost (>=1.55)
    • ICU (>= 56)
  • sygnm packages
    • Flint (>= 2.5)
    • GMP (>= 6.1)
    • Arb (>= 2.13.0)
    • Eigen (>= 3.3)
    • SQLite 3
    • GMP-ECM (>= 7.0.0)
    • MPFR (>= 3.1)
    • MPC (>= 1.0)
    • GeNuSys (only if the genusys package is explicitly enabled with CMake option SYGNM_ENABLE_PACKAGE_GENUSYS)
  • sygnm-cli
    • GNU Readline
  • sygnm-irc
    • Qt5
  • sygnm python interface
    • Python libs (>= 3.0.0)
    • SWIG (>=3.0.11)
  • sygnm ruby interface
    • Ruby (>= 2.5)
    • SWIG (>=3.0.11)
  • sygnm java interface
    • Java JNI
    • SWIG (>=3.0.11)

To (optionally) run the code generator instead of using the generated files that come with the source code, the following are also needed:

  • Python 3
  • python-dominate (optional, only needed for generating HTML documentation)

Running the code generator (optional)

Normally there is no need to run the code generator, since the generated files are already part of the source code download. However, the code generator must be rerun if the source code of any package was changed.

Assuming that the source code is in the sygnm directory, use the following commands:

cd sygnm
./sygnm-codegen/sygnm-codegen packages ./sygnm --generate-python --force --no-formatting --generate-docs

Leave out the --generate-python option to disable code generation for the Python interface (in this case SWIG is not needed). For more information, run the code generator with the --help option.

Optionally, the Artistic Style (astyle) code formatter utility is used to format the generated files (--no-formatting disables this).

Run sygnm-codegen --help to see all options.


Assuming that the source code is in the sygnm directory, the following commands can be used to build the base sygnm framework (core, packages and command line interface):

cd sygnm
mkdir build
cd build

To build additional components, the following CMake configuration options can be used:

  • SYGNM_BUILD_BASE: Core, packages and command line interface
  • SYGNM_BUILD_CLI: Command line interface
  • SYGNM_BUILD_CODEGEN: Code generator
  • SYGNM_BUILD_PYTHON_INTERFACE: The sygnm python interface
  • SYGNM_BUILD_JAVA_INTERFACE: The sygnm java interface
  • SYGNM_BUILD_RUBY_INTERFACE: The sygnm ruby interface
  • SYGNM_BUILD_JUPYTER: The Jupyter Notebook kernel
  • SYGNM_BUILD_ALL: All components

Additional configuration options for CMake:

  • SYGNM_THREAD_SAFE_NODE_POINTERS: If enabled, sygnm node pointers can be used concurrently from different threads, but this is usually not needed. Decreases performance, disabled by default.
  • SYGNM_CORE_PROFILING: Enable additional log messages with performance and timing information (in sygnm core).
  • SYGNM_PROFILING: Enable additional log messages with performance and timing information (outside of sygnm core).
  • CMAKE_BUILD_TYPE=Debug: Enable debug mode.
  • SYGNM_SAFE_MODE: Enables some additional runtime type safety checks, but decreases performance. Useful for debugging. Disabled by default.
  • SYGNM_ENABLE_SYSLOG: Enable the syslog integration in sygnm core. This is disabled by default, since it can be used to send log messages to a remote syslog server.
  • SYGNM_NO_DOLLAR_SIGN: Do not define define function call macros: $(...), $$(...), $v(...) and $$v(...).

After a successful build, use make install to install the built components to the system. Alternatively, it is possible to run sygnm directly from the build directory without installation.

Enabling/disabling specific packages

Use SYGNM_DISABLE_PACKAGE_PKGNAME defines to selectively disable packages. Some packages are disabled by default, these can be enabled with SYGNM_ENABLE_PACKAGE_PKGNAME (replace PKGNAME with the name of the package).

Statically linking packages

Packages can be statically linked into the sygnm core binary to avoid runtime package loading. Set the SYGNM_STATIC_PACKAGES CMake option to a semicolon-separated list of package names. If a package is statically linked, then all of its dependencies must be statically linked too.

Packaging (Ubuntu)

There is an experimental script in the repository to produce deb packages using checkinstall (complete build, all dependencies must be installed). However, this is not the proper way to create deb packages, and it is not officially supported.