Skip to content

Compilation Guide CMake

Jack Hagen edited this page May 8, 2024 · 12 revisions

These instructions assume you have CMake, a modern C compiler, and Conda installed with Conda set up and ready to go. Bertini is developed on MacOS and Linux, these instructions have not been tested on Windows

  1. Use a package manager to install relevant packages. We recommend Conda because it has all of the packages in one spot with the right versions.

    a. With conda: conda activate, conda install gmp mpfr automake autoconf libtool boost eigen conda-forge::libboost-python numpy. Your system also needs the build-essential package, it is likely installed by default.

    b. With another packager manager: $PACKAGE_MANAGER install gmp mpfr automake autoconf libtool boost eigen boost-python3 build-essential, pip install numpy. You will likely have to hunt for versioning issues and install methods inconsistencies if you choose this method.

  2. git clone https://github.com/bertiniteam/b2 && cd b2/core

  3. mkdir build && cd build

  4. cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX # The prefix is only necessary if built with cmake

  5. make install

    a. If your computer can handle the heat, try instead make install -j x, where x = a number dictating how much resources are dedicated towards compiling. It makes compiling much faster. A modern 32GB Ram laptop can comfortably run -j 4 =. 3 is a good starting point

If you just want the core software for use with C++, you can stop here. If you want to use Bertini2 with Python, keep going

  1. cd ../../python

  2. conda install conda-forge::eigenpy

  3. mkdir build && cd build

  4. cmake .. -DCMAKE_PREFIX_PATH=$CONDA_PREFIX # The prefix is only necessary if built with cmake

  5. make install

    a. See note on previous make install step

  6. cd ..

  7. pip install .

  8. Profit