Beispiel #1
0
    def finalize_options(self):
        """Extract options from the flags invoked by the user at compile time.
    This method performs error checking of the options specified by
    the user at compile time, and initialize the config.configurations
    class instance. The method conclude with a call to the
    configurations.setup_extension_modules class method which builds
    a list of C/C++/CUDA extension modules to be passed to the distutils
    setup method at the end of this script.
    """

        # Run the install command parent class' finalize_options method
        install.finalize_options(self)

        config.with_ccache = self.with_ccache

        # Check that the user specified a supported C++ compiler
        if self.cc not in ['gcc']:
            raise DistutilsOptionError \
                  ('Must supply the -cc flag with one of the supported ' +
                   'C++ compilers: gcc')
        else:
            config.cc = self.cc

        # Build the openmoc.gnu.single and/or openmoc.gnu.double
        # extension module(s)
        if self.with_gcc:
            config.cpp_compilers += ['gcc']

        # Build a list of the C/C++/CUDA extension modules to be built
        # for this distribution
        config.setup_extension_modules()
Beispiel #2
0
  def finalize_options(self):
    """Extract options from the flags invoked by the user at compile time.
    This method performs error checking of the options specified by
    the user at compile time, and initialize the config.configurations
    class instance. The method conclude with a call to the
    configurations.setup_extension_modules class method which builds
    a list of C/C++/CUDA extension modules to be passed to the distutils
    setup method at the end of this script.
    """

    # Run the install command parent class' finalize_options method
    install.finalize_options(self)

    config.with_ccache = self.with_ccache
    
    # Check that the user specified a supported C++ compiler
    if self.cc not in ['gcc']:
      raise DistutilsOptionError \
            ('Must supply the -cc flag with one of the supported ' +
             'C++ compilers: gcc')
    else:
      config.cc = self.cc

    # Build the openmoc.gnu.single and/or openmoc.gnu.double
    # extension module(s)
    if self.with_gcc:
      config.cpp_compilers += ['gcc']

    # Build a list of the C/C++/CUDA extension modules to be built
    # for this distribution
    config.setup_extension_modules()
Beispiel #3
0
    def finalize_options(self):
        """Extract options from the flags invoked by the user at compile time.

    This method performs error checking of the options specified by
    the user at compile time, and initialize the config.configurations
    class instance. The method conclude with a call to the
    configurations.setup_extension_modules class method which creates
    the C/C++/CUDA extension modules to be passed to the distutils
    setup method at the end of this script.
    """

        # Run the install command parent class' finalize_options method
        install.finalize_options(self)

        # Set the configuration options specified to be the default
        # unless the corresponding flag was invoked by the user
        config.with_cuda = self.with_cuda
        config.debug_mode = self.debug_mode
        config.sanitizer_mode = self.sanitizer_mode
        config.profile_mode = self.profile_mode
        config.coverage_mode = self.coverage_mode
        config.with_ccache = self.with_ccache

        # Check that the user specified a supported C++ compiler
        if self.cc not in ['gcc', 'clang', 'icpc', 'bgxlc', 'mpicc']:
            raise DistutilsOptionError \
                  ('Must supply the -cc flag with one of the supported ' +
                   'C++ compilers: gcc, clang, icpc, bgxlc, mpicc')
        else:
            config.cc = self.cc

        # Check that the user specified a supported floating point precision
        if self.fp not in ['single', 'double']:
            raise DistutilsOptionError \
                ('Must supply the -cc flag with one of the supported ' +
                 'floating point precision levels: single, double')
        else:
            config.fp = self.fp

        # Build the C/C++/CUDA extension modules for this distribution
        config.setup_extension_modules()
Beispiel #4
0
  def finalize_options(self):
    """Extract options from the flags invoked by the user at compile time.

    This method performs error checking of the options specified by
    the user at compile time, and initialize the config.configurations
    class instance. The method conclude with a call to the
    configurations.setup_extension_modules class method which creates
    the C/C++/CUDA extension modules to be passed to the distutils
    setup method at the end of this script.
    """

    # Run the install command parent class' finalize_options method
    install.finalize_options(self)

    # Set the configuration options specified to be the default
    # unless the corresponding flag was invoked by the user
    config.with_cuda = self.with_cuda
    config.debug_mode = self.debug_mode
    config.profile_mode = self.profile_mode
    config.with_ccache = self.with_ccache

    # Check that the user specified a supported C++ compiler
    if self.cc not in ['gcc', 'clang', 'icpc', 'bgxlc']:
      raise DistutilsOptionError \
            ('Must supply the -cc flag with one of the supported ' +
             'C++ compilers: gcc, clang, icpc, bgxlc')
    else:
      config.cc = self.cc

    # Check that the user specified a supported floating point precision
    if self.fp not in ['single', 'double']:
      raise DistutilsOptionError \
          ('Must supply the -cc flag with one of the supported ' +
           'floating point precision levels: single, double')
    else:
      config.fp = self.fp

    # Build the C/C++/CUDA extension modules for this distribution
    config.setup_extension_modules()
Beispiel #5
0
  def finalize_options(self):
    """Extract options from the flags invoked by the user at compile time.

    This method performs error checking of the options specified by
    the user at compile time, and initialize the config.configurations
    class instance. The method conclude with a call to the
    configurations.setup_extension_modules class method which builds
    a list of C/C++/CUDA extension modules to be passed to the distutils
    setup method at the end of this script.
    """

    # Run the install command parent class' finalize_options method
    install.finalize_options(self)

    # Set the configuration options specified to be the default
    # unless the corresponding flag was invoked by the user
    config.with_cuda = self.with_cuda
    config.debug_mode = self.debug_mode
    config.with_ccache = self.with_ccache
    config.with_papi = self.with_papi
    config.with_numpy = not self.no_numpy

    # Check that the user specified a supported C++ compiler
    if self.cc not in ['gcc', 'icpc', 'bgxlc']:
      raise DistutilsOptionError \
            ('Must supply the -cc flag with one of the supported ' +
             'C++ compilers: gcc, icpc, bgxlc')
    else:
      config.cc = self.cc

    # Check that the user specified a supported floating point precision
    if self.fp not in ['single', 'double']:
      raise DistutilsOptionError \
          ('Must supply the -cc flag with one of the supported ' +
           'floating point precision levels: single, double')
    else:
      config.fp = self.fp

    # Build the openmoc.gnu.single and/or openmoc.gnu.double
    # extension module(s)
    if self.with_gcc:
      config.cpp_compilers += ['gcc']

      # If a precision level was not specified, use the default
      if not any([self.with_sp, self.with_dp]):
        config.fp_precision += [self.fp]


    # Build the openmoc.intel.single and/or openmoc.intel.double
    # extension module(s)
    if self.with_icpc:

      config.cpp_compilers += ['icpc']

      # If a precision level was not specified, use the default
      if not any([self.with_sp, self.with_dp]):
        config.fp_precision += [self.fp]


    # Build the openmoc.bgxlc.single and/or openmoc.bgxlc.double
    # extension module(s)
    if self.with_bgxlc:
      config.cpp_compilers += ['bgxlc']

      # If a precision level was not specified, use the default
      if not any([self.with_sp, self.with_dp]):
        config.fp_precision += [self.fp]

    # If the user requested to build extra modules (ie, openmoc.gnu.single)
    # using single precision floating point
    if self.with_sp:

      # If no compiler was specified, thrown an error
      if not any([self.with_gcc, self.with_icpc, not self.with_bgxlc]):
        raise DistutilsOptionError \
            ('Must supply either with-gcc/with-icpc/with-bgxlc for ' +
             'the with-sp option')

      # Otherwise add the single precision option
      else:
        config.fp_precision += ['single']


    # If the user requested to build extra modules (ie, openmoc.gnu.single)
    # using single precision floating point
    if self.with_dp:

      # If no compiler was specified, thrown an error
      if not any([self.with_gcc, self.with_icpc, not self.with_bgxlc]):
        raise DistutilsOptionError \
            ('Must supply either with-gcc/with-icpc/with-bgxlc for ' +
             'the with-dp option')

      # Otherwise add the double precision option
      else:
        config.fp_precision += ['double']

    # Build a list of the C/C++/CUDA extension modules to be built
    # for this distribution
    config.setup_extension_modules()
Beispiel #6
0
    def finalize_options(self):
        """Extract options from the flags invoked by the user at compile time.

    This method performs error checking of the options specified by
    the user at compile time, and initialize the config.configurations
    class instance. The method conclude with a call to the
    configurations.setup_extension_modules class method which builds
    a list of C/C++/CUDA extension modules to be passed to the distutils
    setup method at the end of this script.
    """

        # Run the install command parent class' finalize_options method
        install.finalize_options(self)

        # Set the configuration options specified to be the default
        # unless the corresponding flag was invoked by the user
        config.with_cuda = self.with_cuda
        config.debug_mode = self.debug_mode
        config.with_ccache = self.with_ccache
        config.with_papi = self.with_papi
        config.with_numpy = not self.no_numpy

        # Check that the user specified a supported C++ compiler
        if self.cc not in ["gcc", "icpc", "bgxlc"]:
            raise DistutilsOptionError(
                "Must supply the -cc flag with one of the supported " + "C++ compilers: gcc, icpc, bgxlc"
            )
        else:
            config.cc = self.cc

        # Check that the user specified a supported floating point precision
        if self.fp not in ["single", "double"]:
            raise DistutilsOptionError(
                "Must supply the -cc flag with one of the supported "
                + "floating point precision levels: single, double"
            )
        else:
            config.fp = self.fp

        # Build the openmoc.gnu.single and/or openmoc.gnu.double
        # extension module(s)
        if self.with_gcc:
            config.cpp_compilers += ["gcc"]

            # If a precision level was not specified, use the default
            if not any([self.with_sp, self.with_dp]):
                config.fp_precision += [self.fp]

        # Build the openmoc.intel.single and/or openmoc.intel.double
        # extension module(s)
        if self.with_icpc:

            config.cpp_compilers += ["icpc"]

            # If a precision level was not specified, use the default
            if not any([self.with_sp, self.with_dp]):
                config.fp_precision += [self.fp]

        # Build the openmoc.bgxlc.single and/or openmoc.bgxlc.double
        # extension module(s)
        if self.with_bgxlc:
            config.cpp_compilers += ["bgxlc"]

            # If a precision level was not specified, use the default
            if not any([self.with_sp, self.with_dp]):
                config.fp_precision += [self.fp]

        # If the user requested to build extra modules (ie, openmoc.gnu.single)
        # using single precision floating point
        if self.with_sp:

            # If no compiler was specified, thrown an error
            if not any([self.with_gcc, self.with_icpc, not self.with_bgxlc]):
                raise DistutilsOptionError(
                    "Must supply either with-gcc/with-icpc/with-bgxlc for " + "the with-sp option"
                )

            # Otherwise add the single precision option
            else:
                config.fp_precision += ["single"]

        # If the user requested to build extra modules (ie, openmoc.gnu.single)
        # using single precision floating point
        if self.with_dp:

            # If no compiler was specified, thrown an error
            if not any([self.with_gcc, self.with_icpc, not self.with_bgxlc]):
                raise DistutilsOptionError(
                    "Must supply either with-gcc/with-icpc/with-bgxlc for " + "the with-dp option"
                )

            # Otherwise add the double precision option
            else:
                config.fp_precision += ["double"]

        # Build a list of the C/C++/CUDA extension modules to be built
        # for this distribution
        config.setup_extension_modules()