Source code for pycif.plugins.models.template.compile

import os
import subprocess
from shutil import copytree, ignore_patterns, rmtree, copy
from logging import info, debug


[docs]def compile(self): """ The ``compile`` function initializes all model information and executables prior to any run. Files must be copied in ``$workdir/model``. This includes: - copying executable if exist .. warning:: It is recommended to copy executable files to make sure than later simulations in the present pyCIF computation use the same executable. Indeed, it can happen that one runs very long inversions in the background and carries on developments, forgetting about the background inversions, thus potentially breaking the background inversions, or worse, changing the result without error... - copy sources and compile if no executable is around, or if explicitly required to re-compile. .. note:: As much as possible, the model should be compiled within pyCIF to guarantee a traceability of the options used for compiling and also dealing with ``platform`` specificities through the ``platform`` Plugin (see details :doc:`here </documentation/plugins/platforms/index>`) - copy extra configuration files, e.g., templates for namelists, etc. """