def __environment(self):
        """Manually set the environment as an alternative to psxevars.sh"""

        basepath = '/opt/intel/psxe_runtime/linux'

        ld_library_path = []
        path = []
        env = {}

        if self.__daal:
            env['DAALROOT'] = posixpath.join(basepath, 'daal')
            ld_library_path.append(posixpath.join(basepath, 'daal', 'lib',
                                                  'intel64'))

        if self.__icc:
            ld_library_path.append(posixpath.join(basepath, 'compiler', 'lib',
                                                  'intel64_lin'))

        if self.__ifort:
            ld_library_path.append(posixpath.join(basepath, 'compiler', 'lib',
                                                  'intel64_lin'))

        if self.__ipp:
            env['IPPROOT' ] = posixpath.join(basepath, 'ipp')
            ld_library_path.append(posixpath.join(basepath, 'ipp', 'lib',
                                                  'intel64'))

        if self.__mkl:
            env['MKLROOT'] = posixpath.join(basepath, 'mkl')
            ld_library_path.append(posixpath.join(basepath, 'mkl', 'lib',
                                                  'intel64'))

        if self.__mpi:
            env['I_MPI_ROOT'] = posixpath.join(basepath, 'mpi')
            ld_library_path.append(posixpath.join(basepath, 'mpi', 'intel64',
                                                  'lib'))
            path.append(posixpath.join(basepath, 'mpi', 'intel64', 'bin'))

            if Version(self.__version) >= Version('2019'):
                env['FI_PROVIDER_PATH'] = posixpath.join(
                    basepath, 'mpi', 'intel64', 'libfabric', 'lib', 'prov')
                ld_library_path.append(posixpath.join(
                    basepath, 'mpi', 'intel64', 'libfabric', 'lib'))
                path.append(posixpath.join(basepath, 'mpi', 'intel64',
                                           'libfabric', 'bin'))

            if Version(self.__version) >= Version('2020'):
                ld_library_path.append(posixpath.join(
                    basepath, 'mpi', 'intel64', 'lib', 'release'))

        if self.__tbb:
            if int(self.__year) >= 2020:
                ld_library_path.append(posixpath.join(basepath, 'tbb', 'lib',
                                                      'intel64', 'gcc4.8'))
            else:
                ld_library_path.append(posixpath.join(basepath, 'tbb', 'lib',
                                                      'intel64', 'gcc4.7'))

        if ld_library_path:
            ld_library_path.append('$LD_LIBRARY_PATH')
            env['LD_LIBRARY_PATH'] = ':'.join(ld_library_path)

        if path:
            path.append('$PATH')
            env['PATH'] = ':'.join(path)

        return env
Manually set the environment as an alternative to psxevars.sh
hpccm/building_blocks/intel_psxe_runtime.py