Install#

This guide will walk you through the steps to install the SARComp library, including enabling the necessary features for multi-threading and multiprocessing.

Prerequisites#

Before installing SARComp, ensure you have the following prerequisites installed on your system:

  • Python 3.x

  • C compiler with OpenMP support (e.g., GCC)

  • Required Python packages (you can install these using pip)

Installation Steps#

  1. Clone the Repository

    First, clone the SARComp repository from the source:

    git clone sarcomp.git # contact us to get the ressources
    cd sarcomp
    
  2. Run the Configure Script

    To configure the build environment, run the configure script. This script prepares the build with the necessary parameters. If you want to enable OpenMP support for multi-threading, you need to include the –enable-omp flag.

    ./configure --enable-python-api --enable-omp
    

    This command generates a setup file with all the relevant parameters for building SARComp with OpenMP support.

    Note

    OpenMP (Open Multi-Processing) is an API that supports multi-platform shared memory multiprocessing programming.

  3. Build the Library

    Once the configuration is complete, build the SARComp library:

    make pylibsarcomp
    
  4. Install the Library

    After building the library, install it using the following command:

    make pyinstall
    

    This command installs the SARComp library with Python bindings.

Post-Installation Steps#

  1. Verify Installation

    To verify that SARComp is installed correctly, you can run a simple Python script to import the library and call a test function:

    import sarcomp
    print(sarcomp.get_info())
    
    SARComp version 1.0 successfully installed.
    OpenMP is enabled. SC_NUM_THREADS is set to 4.
    

    If the installation was successful, the script should run without errors and display the expected output.

  2. Set Environment Variables

    If you plan to use SARComp’s multi-threading capabilities, set the OMP_NUM_THREADS environment variable to specify the number of threads. For example, to use 4 threads:

    export OMP_NUM_THREADS=4
    

    This command sets OMP_NUM_THREADS to 4, instructing OpenMP to use 4 threads. Adjust the number as needed for your system and workload.

  3. Integration with Caramba

    If you wish to use SARComp within Caramba workflows, set the CARAMBA_USE_SARCOMP environment variable to 1:

    export CARAMBA_USE_SARCOMP=1
    

Troubleshooting#

If you encounter any issues during the installation, consider the following troubleshooting steps:

  • Check Dependencies: Ensure all prerequisites are installed and properly configured.

  • Review Logs: Check the build and runtime logs for any errors or warnings.

  • Environment Variables: Verify that the necessary environment variables are set correctly in your shell session.

For further assistance, refer to the SARComp documentation or seek help from the SARComp community.

Additional Resources#