def __setup(self):
        """Construct the series of shell commands, i.e., fill in
           self.__commands"""

        # Use tarball from local build context
        tarball = posixpath.basename(self.__tarball)

        # Figure out the version from the tarball name
        match = re.match(r'pgilinux-\d+-(?P<year>\d\d)0?(?P<month>[1-9][0-9]?)',
                         tarball)
        if match and match.groupdict()['year'] and match.groupdict()['month']:
            self.__version = '{0}.{1}'.format(match.groupdict()['year'],
                                              match.groupdict()['month'])
        else:
            logging.warning('could not determine PGI version')
            self.__version = '19.10'

        self.__commands.append(self.untar_step(
            tarball=posixpath.join(self.__wd, tarball),
            directory=posixpath.join(self.__wd, 'pgi')))

        flags = {'PGI_ACCEPT_EULA': 'accept',
                 'PGI_INSTALL_DIR': self.__prefix,
                 'PGI_INSTALL_MPI': 'false',
                 'PGI_INSTALL_NVIDIA': 'true',
                 'PGI_MPI_GPU_SUPPORT': 'false',
                 'PGI_SILENT': 'true'}
        if not self.__eula:
            # This will fail when building the container
            logging.warning('PGI EULA was not accepted')
            flags['PGI_ACCEPT_EULA'] = 'decline'
            flags['PGI_SILENT'] = 'false'
        if self.__system_cuda:
            flags['PGI_INSTALL_NVIDIA'] = 'false'
        if self.__mpi:
            flags['PGI_INSTALL_MPI'] = 'true'
            flags['PGI_MPI_GPU_SUPPORT'] = 'true'
        flag_string = ' '.join('{0}={1}'.format(key, val)
                               for key, val in sorted(flags.items()))

        self.__commands.append('cd {0} && {1} ./install'.format(
            posixpath.join(self.__wd, 'pgi'), flag_string))

        # Create siterc to specify use of the system CUDA
        siterc = posixpath.join(self.__basepath, self.__version, 'bin', 'siterc')
        if self.__system_cuda:
            self.__commands.append('echo "set CUDAROOT=/usr/local/cuda;" >> {}'.format(siterc))

        # Create siterc to respect LIBRARY_PATH
        # https://www.pgroup.com/support/faq.htm#lib_path_ldflags
        self.__commands.append(r'echo "variable LIBRARY_PATH is environment(LIBRARY_PATH);" >> {}'.format(siterc))
        self.__commands.append(r'echo "variable library_path is default(\$if(\$LIBRARY_PATH,\$foreach(ll,\$replace(\$LIBRARY_PATH,":",), -L\$ll)));" >> {}'.format(siterc))
        self.__commands.append(r'echo "append LDLIBARGS=\$library_path;" >> {}'.format(siterc))

        # Override the installer behavior and force the use of the
        # system libnuma library
        if self.__system_libnuma:
            self.__commands.append('ln -sf {0} {1}'.format(
                posixpath.join(self.__libnuma_path, 'libnuma.so.1'),
                posixpath.join(self.__basepath, self.__version, 'lib',
                               'libnuma.so')))
            self.__commands.append('ln -sf {0} {1}'.format(
                posixpath.join(self.__libnuma_path, 'libnuma.so.1'),
                posixpath.join(self.__basepath, self.__version, 'lib',
                               'libnuma.so.1')))

        # Some installed files are owned by uid 921 / gid 1004.
        # Fix it so that all files are owned by root.
        if self.__fix_ownership:
            self.__commands.append('chown -R root.root {}'.format(
                self.__prefix))

        # Cleanup
        self.__commands.append(self.cleanup_step(
            items=[posixpath.join(self.__wd, tarball),
                   posixpath.join(self.__wd, 'pgi')]))

        # libnuma.so and libnuma.so.1 must be symlinks to the system
        # libnuma library.  They are originally symlinks, but Docker
        # "COPY -from" copies the file pointed to by the symlink,
        # converting them to files, so recreate the symlinks.
        self.__runtime_commands.append('ln -sf {0} {1}'.format(
            posixpath.join(self.__libnuma_path, 'libnuma.so.1'),
            posixpath.join(self.__basepath, self.__version, 'lib',
                           'libnuma.so')))
        self.__runtime_commands.append('ln -sf {0} {1}'.format(
            posixpath.join(self.__libnuma_path, 'libnuma.so.1'),
            posixpath.join(self.__basepath, self.__version, 'lib',
                           'libnuma.so.1')))

        # Set the environment
        self.environment_variables = self.__environment()
        self.runtime_environment_variables = self.__environment(runtime=True)
Construct the series of shell commands, i.e., fill in
           self.__commands
hpccm/building_blocks/pgi.py