Using ProDiMo in a conda Environment¶
We assume that you are somewhat familiar with conda and have either Miniconda, mini-forge or Anaconda installed. You might need to configure your conda environment to include the conda-forge repository (very useful in general).
Besides being likely the simplest way to install ProDiMo, using a conda environment has also the advantage that all libraries, python packages and environment settings required by ProDiMo do not interfere with the rest of your system.
Setup environment for gfortran (Mac OS X or Linux)¶
To create an environment called prodimo (you can change the name if you like) simply type
conda create -n prodimo && conda activate prodimo
The second command immediately activates the environment.
Please note, to run ProDiMo you need to be in the prodimo environment (i.e. you need to activate it if it is not already active).
Now we install all required software to compile and run ProDiMo.
conda install -c conda-forge gfortran cfitsio xraylib
This installs the most recent version of the packages. If you want to have a particular version you can e.g. use gfortran==13. If you do not have git installed you can also install it with conda (just add git to the conda install list ).
To test if the installation worked type e.g. gfortran --version.
Setup environment for ifx (Intel Fortran Compiler, only Linux)¶
If you want to use the Intel Compilers, it is also possible to use conda, with one exception, you need to compile and install the xraylib library yourself.
Create and activate an environment called prodimo.ifx and install python,cfitsio and git (if you do not have it already) with conda:
conda create -n prodimo.ifx python cfitsio git && conda activate prodimo.ifx
Now we install ifx and icx (required to compile xraylib):
conda install -c https://software.repos.intel.com/python/conda/ -c conda-forge ifx_linux-64 dpcpp_linux-64
To test if the installation worked type e.g. ifx --version.
If you have problems with installing ifx, please check the above links for ifx and icc, it can be that the installation via conda has changed.
Now we compile and install xraylib (skip this step if not needed, and continue with Compiling Prodimo). See also the xraylib documentation. I did not manage to use the meson build tool as suggested in the xraylib documentation, but with the autotools it works fine. The following commands download the library, unpack it, configure it, compile and install it (you might want to adapt the version number).
wget https://github.com/tschoonj/xraylib/releases/download/xraylib-4.1.5/xraylib-4.1.5.tar.xz
tar -xvf xraylib-4.1.5.tar.xz
cd xraylib-4.1.5
autoreconf -fi
export CC=icx FC=ifx
./configure --prefix=$CONDA_PREFIX
make
make check
make install
Please note with
--prefix=$CONDA_PREFIXit is ensured that xraylib is installed in the conda environment, which is important for ProDiMo to find it.
Compiling ProDiMo¶
If you have not done it yet, you need to download the ProDiMo source code via git. See Download the Code.
Now change into the src_develop directory of your local git ProDiMo repository (i.e. the source code, something like ~/git/prodimo/src_develop). There you should find a file called makefile.conda (i.e. try ls). If you are using ifx please use makefile.conda.ifx instead (i.e in the copy statement below replace makefile.conda with makefile.conda.ifx).
To compile ProDiMo simply type:
cp makefile.conda makefile
make
The compilation might take a while ... If the compilation is done, type
make install
With this command the ProDiMo executable is added to your environment path and also certain environment variables are set (e.g. OMP_STACKSIZE) and activate/deactivate scripts are generated.
After a
make installyou should always reactivate the environment (i.e.conda activate prodimo). Themake installstep is only required once, even if you recompile ProDiMo, but if you have problems the install step can also be repeated.
You should now be able to just type
prodimo
which should show you some output and an error message (no input files), but that is fine.
Although the make install step should take care of everything, it can easily be that the generated scripts do not work on every system. In that case, or if your first model crashes with something like stack overflow, please check out the OS environment section of the documentation.