diff --git a/.gitignore b/.gitignore index 206563718..68123c1d9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ .cache .ccls .coverage +compile_commands.json MANIFEST _build _generate diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d9024c6d7..a8362aa8f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -32,14 +32,36 @@ with micromamba. To build libsemigroups (with the above environment active): +First, clone and prepare the libsemigroups repository: + .. code-block:: console git clone https://github.com/libsemigroups/libsemigroups cd libsemigroups - ./autogen.sh && ./configure --disable-hpcombi && make -j8 + ./autogen.sh + +Then choose one of the following installation methods: + +**Option 1: System-wide installation** + +For a system-wide installation (requires sudo): + +.. code-block:: console + + ./configure --disable-hpcombi + make -j8 sudo make install -where ``-j8`` instructs the compiler to use 8 threads. +**Option 2: Install into conda/mamba environment** + +.. code-block:: console + + ./configure --prefix=$CONDA_PREFIX --disable-hpcombi + make -j8 + make install + +In both cases, ``-j8`` instructs the compiler to use 8 threads (adjust based on your +system). To build the Python bindings (with CCache) inside the ``libsemigroups_pybind11`` directory: diff --git a/etc/make-dev-environment.sh b/etc/make-dev-environment.sh index 221a4d636..7d5915024 100755 --- a/etc/make-dev-environment.sh +++ b/etc/make-dev-environment.sh @@ -49,7 +49,17 @@ fi echo Setting environment variables ... echo -./etc/set-conda-environment-variables.sh -m $dev_env_pkg_manager + +# Use conda for environment variable setup if both mamba and conda are available +# as mamba and conda CLIs are no longer equivalent for this operation +env_var_pkg_manager=$dev_env_pkg_manager +if [[ $dev_env_pkg_manager == "mamba" ]] && command -v conda >/dev/null 2>&1; then + echo "Using conda for environment variable setup (mamba CLI not compatible) ..." + env_var_pkg_manager=conda +fi + +./etc/set-conda-environment-variables.sh -m $env_var_pkg_manager +unset env_var_pkg_manager echo echo Reactivating environment ...