.. _install-mfix-linux: Installing MFiX on Linux ------------------------ MFiX has been developed and tested on the following Linux distributions: - Ubuntu 22.04 - Ubuntu 23.04 - CentOS 7 - CentOS 8 Other recent releases of Linux are also likely to work. If you have an issue running or installing MFiX on your system, ask for help at :ref:`support-forum`. Install Miniforge3 """""""""""""""""" `Miniforge3` is a minimal version of the Anaconda Python distribution, which is used for many scientific computing projects. MFiX uses many supporting libraries, and the easiest way to install MFiX and its dependencies is via the `conda` packages hosted at `conda-forge` and NETL. As of the 23.4 release we recommend the `Miniforge3/mamba` installation over Anaconda for easier installation. (However, you may continue to use an existing Anaconda installation, see below.) Note that the terms `conda package` and `conda environment` refer generically to both Miniforge and Anaconda. First, **download** the Linux x86_64 version of the `Miniforge3 installer `__ (~33MB). (There are also Miniforge installers for Linux on arm64 and ppc64 architectures, if you have such a system, see the `main Miniforge page `__.) Next, go to your Downloads folder and **run** the downloaded file. #. Open the Terminal application for your Linux desktop. #. ``cd`` to the directory of the downloaded installer (for example ``~/Downloads``). #. Run the downloaded installer: ``bash Miniforge3-Linux-x86_64.sh⏎`` (If you use `zsh` or some other shell, replace `bash` with the name of your shell). #. When prompted for an installation location, hit enter to use the default, or enter the directory of your choice. #. When prompted to run ``conda init``, say ``yes``. Miniforge is now installed. In order for the changes to take effect, close the terminal and open a new one. Verify that your ``PATH`` was updated by running ``mamba`` or ``conda`` in the new terminal. If you are upgrading from a previous version of MFiX and you already have Miniforge or Anaconda installed, you may skip this step (but see note below). .. note:: If you have previously installed MFiX with Anaconda, you can continue to use your existing Anaconda installation. We are recommending `Miniforge` for new installations, because it is a smaller download, and it includes the `mamba` package manager which works much better than `conda` (it is a multi-threaded version, reimplemented in C++. Many scientific computing packages have switched over from Anaconda to Miniforge and mamba.) If you are using Anaconda, we recommend installing `mamba` in the base environment. .. code-block:: shell bash$ conda activate base (base)$ conda config --add channels conda-forge (base)$ conda config --set channel_priority strict (base)$ conda install mamba After doing this, you can use the `mamba` command in place of `conda`. (Note that the channel name `conda-forge` remains unchanged). If there are problems with `mamba` you can always try the same command with `conda` instead. Install MFiX """""""""""" After installing Miniforge, install MFiX: #. Open a terminal. #. Browse to `MFiX Download `__ (requires registration and login) #. Copy the installation command. #. Paste it in the terminal. #. Press enter to run the command. .. note:: If you have previously installed this version of MFiX, you will see the following message. Select ``y`` to confirm. This will delete the previous MFiX installation and replace it. .. code-block:: batch WARNING: A conda environment already exists at ... Remove existing environment (y/[n])? y MFiX will be installed in a new conda environment. The process may take a few minutes to complete. .. _activate-env-linux: Run MFiX """""""" To run MFiX: #. Open a terminal #. Run |conda_act_inline| #. Run ``mfix⏎`` to start MFiX Your prompt should look something like this: .. code-block:: bash :substitutions: $ mamba env create -n mfix-|version| mfix==|version| ... $ mamba env list # conda environments: # base * /home/user/miniforge3 mfix-|version| /home/user/miniforge3/envs/mfix-|version| $ conda activate mfix-|version| (mfix-|version|)$ conda env list # conda environments: # base /home/user/miniforge3 mfix-|version| * /home/user/miniforge3/envs/mfix-|version| (mfix-|version|)$ mfix You are now ready to proceed to the :ref:`user-guide` and :ref:`tutorials`. .. note:: Activating a conda environment sets certain environment variables such as PATH in the current shell. It does not create a new shell session. You will need to activate the environment every time before running MFiX. Deactivate conda environment """""""""""""""""""""""""""" After using MFiX you can just ``exit`` to leave the terminal session. However, if you need to deactivate the |conda_env_inline| conda environment, you can do so with: .. code-block:: bash :substitutions: (mfix-|version|)> mamba deactivate > This returns to the base conda environment. Uninstall MFiX """""""""""""" To remove an MFiX version, installed from conda packages, simply remove the conda environment (if you have the environment activated, deactivate it first): .. code-block:: bash :substitutions: (mfix-|version|)> mamba deactivate > mamba env remove -n mfix-|version| To uninstall Miniforge entirely, remove the directory you installed it to. By default, this is ``~/miniforge3`` in your home directory. From the terminal: .. code-block:: bash > cd ~ > rm -rf miniforge3/ For Anaconda, the default directory is `anaconda3`. Also be sure to edit your shell startup files to remove the `conda init` section at the end. .. note:: To learn more about managing conda environments, visit the `conda documentation `__ . To learn more about miniforge, see the `Miniforge3 README `__.