.. _installing_applications: ======================= Installing Applications ======================= .. contents:: In this section: :local: :depth: 2 On GridUnesp, you **do not have administrator (root) privileges**. This means you cannot install programs in the system's default directories (``/usr/``, ``/lib/``). However, there are several ways to install and use scientific applications in your own space. Installation Options ==================== 1. **Use already-installed modules** (recommended) 2. **Install locally** in your ``/home/`` 3. **Use Conda** to manage environments 4. **Use containers** (Apptainer) 5. **Request a global installation** from the team .. _installation_via_modules: Installation via Modules (Already Installed) ============================================ GridUnesp has dozens of pre-installed applications available as modules. Listing Available Modules ------------------------- .. code-block:: bash module avail To search for a specific module: .. code-block:: bash module avail partial_name Loading a Module ---------------- .. code-block:: bash module load module_name/version **Example:** .. code-block:: bash module load gcc/10.2.0 module load openmpi/4.1.5 Checking Loaded Modules ----------------------- .. code-block:: bash module list Unloading a Module ------------------ .. code-block:: bash module unload module_name .. tip:: For more details on modules, see the :ref:`system_administrator_installation` section. .. _local_installation: Local Installation in /home/ ============================ Many applications allow specifying an alternative installation directory. Using --prefix (configure/make) ------------------------------- .. code-block:: bash :caption: Example of local installation # Download and extraction wget https://example.com/application.tar.gz tar -xzf application.tar.gz cd application # Configure to install in /home/$USER/local ./configure --prefix=/home/$USER/local make make install # Add to PATH export PATH=/home/$USER/local/bin:$PATH export LD_LIBRARY_PATH=/home/$USER/local/lib:$LD_LIBRARY_PATH To make the installation permanent, add the ``PATH`` and ``LD_LIBRARY_PATH`` lines to your ``~/.bashrc``. .. _installation_via_conda: Installation via Conda ====================== Conda is a package manager that allows you to create isolated environments. Creating an Environment ----------------------- .. code-block:: bash # Load the Conda module module load miniconda/24.4.0-libmamba # Create environment conda create -n my_environment python=3.9 # Activate environment source activate my_environment Installing Packages ------------------- .. code-block:: bash conda install numpy pandas matplotlib conda install -c bioconda samtools # Specific channel Listing Environments and Packages --------------------------------- .. code-block:: bash conda info --envs # List environments conda list # List packages in current environment conda deactivate # Exit the environment Using in Submission Scripts --------------------------- .. code-block:: bash :caption: conda_script.sh #!/bin/bash #SBATCH -J my_job #SBATCH -n 1 #SBATCH -t 01:00:00 export INPUT="input.dat" export OUTPUT="output.dat" module load miniconda/24.4.0-libmamba source activate my_environment job-nanny python my_script.py .. _installation_via_apptainer: Installation via Apptainer (Containers) ======================================= Apptainer allows running applications in containers, useful when: - The application depends on specific libraries from another Linux distribution - You need a reproducible environment - Conventional installation is too complex Creating an Image ----------------- .. code-block:: bash :caption: build_container_script.sh #!/bin/bash #SBATCH -J build_container #SBATCH -t 02:00:00 #SBATCH -n 1 export INPUT="ubuntu.def" export OUTPUT="ubuntu.sif" job-nanny apptainer build ubuntu.sif ubuntu.def Definition file (ubuntu.def): .. code-block:: text Bootstrap: docker From: ubuntu:20.04 %post apt-get update apt-get install -y python3 python3-pip pip3 install numpy pandas %runscript python3 "$@" Running a Container ------------------- .. code-block:: bash :caption: run_container_script.sh #!/bin/bash #SBATCH -J run_container #SBATCH -t 01:00:00 #SBATCH -n 1 export INPUT="ubuntu.sif script.py data/" export OUTPUT="results/" job-nanny apptainer exec ubuntu.sif python3 script.py .. tip:: See the :ref:`containers` section for more advanced examples, including MPI and GPU. .. _system_administrator_installation: Requesting a Global Installation ================================ If the application: - Is too complex for local installation - Will be useful for several users - Requires special system configuration You can request from the GridUnesp team: **Email:** ``support.ncc@unesp.br`` **Required information:** - Application name - Desired version - Link to official documentation - Installation instructions (if available) .. note:: The team will evaluate the request and may: - Install globally as a module - Suggest local installation - Provide specific guidance Command Summary =============== .. list-table:: Commands for module management :header-rows: 1 :widths: 30 70 * - Command - Description * - ``module avail`` - List available modules * - ``module load name`` - Load module * - ``module list`` - View loaded modules * - ``module unload name`` - Unload module * - ``module purge`` - Unload all .. seealso:: - :ref:`installed_applications` - List of available applications - :ref:`containers` - Complete containers guide - :ref:`running_simulations` - How to use applications in jobs