def runtime(self, _from=None, exclude=[]):
        """Generate the set of instructions to install the runtime specific
        components from a previous stage.

        This method invokes the runtime() method for every layer in
        the stage.  If a layer does not have a runtime() method, then
        it is skipped.

        # Arguments

        _from: The name of the stage from which to copy the runtime.
        The default is `0`.

        exclude: List of building blocks to exclude when generating
        the runtime. The default is an empty list.

        # Examples
        ```python
        Stage0 += baseimage(image='nvidia/cuda:9.0-devel')
        Stage0 += gnu()
        Stage0 += boost()
        Stage0 += ofed()
        Stage0 += openmpi()
        ...
        Stage1 += baseimage(image='nvidia/cuda:9.0-base')
        Stage1 += Stage0.runtime(exclude=['boost'])
        ```

        """

        # If the name of the stage is not explicitly specified, use
        # the name of the Stage if available, otherwise 0 (Docker's
        # default)
        if not _from and self.name:
            _from = self.name
        elif not _from:
            if hpccm.config.g_ctype == container_type.SINGULARITY:
                logging.warning('Multi-stage Singularity containers require a named first stage')
            _from = '0'

        instructions = []
        for layer in self.__layers:
            runtime = getattr(layer, 'runtime', None)
            if callable(runtime) and layer.__class__.__name__ not in exclude:
                inst = layer.runtime(_from=_from)
                if inst:
                    instructions.append(inst)

        return self.__separator.join(instructions)
Generate the set of instructions to install the runtime specific
        components from a previous stage.

        This method invokes the runtime() method for every layer in
        the stage.  If a layer does not have a runtime() method, then
        it is skipped.

        # Arguments

        _from: The name of the stage from which to copy the runtime.
        The default is `0`.

        exclude: List of building blocks to exclude when generating
        the runtime. The default is an empty list.

        # Examples
        ```python
        Stage0 += baseimage(image='nvidia/cuda:9.0-devel')
        Stage0 += gnu()
        Stage0 += boost()
        Stage0 += ofed()
        Stage0 += openmpi()
        ...
        Stage1 += baseimage(image='nvidia/cuda:9.0-base')
        Stage1 += Stage0.runtime(exclude=['boost'])
        ```

        
hpccm/Stage.py