def __configure(self):
        """Setup configure options based on user parameters"""

        # CUDA
        if self.__cuda:
            if isinstance(self.__cuda, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-cuda={}'.format(self.__cuda))
            elif self.__toolchain.CUDA_HOME:
                self.__configure_opts.append(
                    '--with-cuda={}'.format(self.__toolchain.CUDA_HOME))
            else:
                # Default location
                self.__configure_opts.append('--with-cuda')
        else:
            self.__configure_opts.append('--without-cuda')

        # PMI
        if self.__pmi:
            if isinstance(self.__pmi, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-pmi={}'.format(self.__pmi))
            else:
                self.__configure_opts.append('--with-pmi')

        # PMIX
        if self.__pmix:
            if isinstance(self.__pmix, string_types):
                # Use specified path
                self.__configure_opts.append('--with-pmix={}'.format(
                    self.__pmix))
            else:
                self.__configure_opts.append('--with-pmix')

        # InfiniBand
        if self.__infiniband:
            self.__configure_opts.append('--with-verbs')
        else:
            self.__configure_opts.append('--without-verbs')

        # UCX
        if self.__ucx:
            if isinstance(self.__ucx, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-ucx={}'.format(self.__ucx))
            else:
                self.__configure_opts.append('--with-ucx')

        # Workaround when using the NVIDIA compilers
        if self.__toolchain.CC and re.match('.*nvc', self.__toolchain.CC):
            if not self.__toolchain.CFLAGS:
                self.__toolchain.CFLAGS = '-O1'

        # PIC workaround when using the NVIDIA compilers
        if self.__toolchain.FC and re.match('.*nvfortran',
                                            self.__toolchain.FC):
            if not self.__toolchain.FCFLAGS:
                self.__toolchain.FCFLAGS = '-fpic -DPIC'
Setup configure options based on user parameters
hpccm/building_blocks/openmpi.py