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=/usr/local/cuda')
        else:
            self.__configure_opts.append('--without-cuda')

        # GDRCOPY
        if self.__gdrcopy:
            if isinstance(self.__gdrcopy, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-gdrcopy={}'.format(self.__gdrcopy))
            else:
                # Boolean, let UCX try to figure out where to find it
                self.__configure_opts.append('--with-gdrcopy')
        elif self.__gdrcopy == False:
            self.__configure_opts.append('--without-gdrcopy')

        # KNEM
        if self.__knem:
            if isinstance(self.__knem, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-knem={}'.format(self.__knem))
            else:
                # Boolean, let UCX try to figure out where to find it
                self.__configure_opts.append('--with-knem')
        elif self.__knem == False:
            self.__configure_opts.append('--without-knem')

        # OFED
        if self.__ofed:
            if isinstance(self.__ofed, string_types):
                # Use specified path
                self.__configure_opts.extend(
                    ['--with-verbs={}'.format(self.__ofed),
                     '--with-rdmacm={}'.format(self.__ofed)])
            else:
                # Boolean, let UCX try to figure out where to find it
                self.__configure_opts.extend(['--with-verbs', '--with-rdmacm'])
        elif self.__ofed == False:
            self.__configure_opts.extend(['--without-verbs',
                                          '--without-rdmacm'])

        # XPMEM
        if self.__xpmem:
            if isinstance(self.__xpmem, string_types):
                # Use specified path
                self.__configure_opts.append(
                    '--with-xpmem={}'.format(self.__xpmem))
            else:
                # Boolean, let UCX try to figure out where to find it
                self.__configure_opts.append('--with-xpmem')
        elif self.__xpmem == False:
            self.__configure_opts.append('--without-xpmem')

        # Workaround for format warning considered an error on Power
        if hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
            if not self.__toolchain.CFLAGS:
                self.__toolchain.CFLAGS = '-Wno-error=format'
Setup configure options based on user parameters
hpccm/building_blocks/ucx.py