Installation
============


Install from PyPI
-----------------

.. note::

    CASM is built for macOS x86_64 (Intel), macOS arm64 (Apple Silicon), Linux x86_64, and Linux aarch64.

The latest release of casm-bset can be installed with:

.. code-block:: bash

    pip install casm-bset


.. _casm-bset-configuration:

Environment variable configuration
----------------------------------

.. attention::

    CASM clexulator require a compiler with support for C++17. For GCC, version 10 or later is required.

    If the compiler is made available using a command like ``module load gcc/12.2.1`` make sure to perform that step first.


1. Using an shell script
^^^^^^^^^^^^^^^^^^^^^^^^

To determine the environment variables needed to compile and link the clexulator generated by casm-bset (see :func:`~libcasm.clexulator.make_clexulator`) use:

.. code-block:: bash

    python -m casm.bset --autoconfigure --shfile casmenv.sh

If configuration is successful, this will create a file `casmenv.sh` that can be sourced to set the necessary environment variables before using CASM:

.. code-block:: bash

    source ./casmenv.sh


2. In a Python process
^^^^^^^^^^^^^^^^^^^^^^

Configuration can also be done during a Python process using :func:`~casm.bset.autoconfigure`:

.. code-block:: Python

    import casm.bset
    casm.bset.autoconfigure()

By default, if configuration is successful, this method will set the environment variables found for the current process. If not successful, it will raise an exception.


Install from source
-------------------

See the `casm contribution guide`_.


For contributors
----------------

See the `casm contribution guide`_.


.. _`casm contribution guide`: https://prisms-center.github.io/CASMcode_docs/pages/contributing_to_casm_packages/
