コード例 #1
0
    def run(self):
        log.debug("running AmiciDevelop")

        if not self.no_clibs:
            generate_swig_interface_files()
            self.get_finalized_command('build_clib').run()

        develop.run(self)
コード例 #2
0
    def run_swig(self):
        """Run swig

        Returns:

        """

        if not self.dry_run:  # --dry-run
            # We create two SWIG interfaces, one with HDF5 support, one without
            generate_swig_interface_files()
コード例 #3
0
    def run(self):
        log.debug("running AmiciDevelop")

        if not self.no_clibs:
            generate_swig_interface_files(
                swig_outdir=os.path.join(os.path.abspath(os.getcwd()),
                                         "amici"))
            self.get_finalized_command('build_clib').run()

        develop.run(self)
コード例 #4
0
    def run(self):
        """Copy the generated clibs to the extensions folder to be included in
        the wheel
        """

        log.debug("running AmiciBuildExt")

        no_clibs = 'develop' in self.distribution.command_obj \
                   and self.get_finalized_command('develop').no_clibs
        no_clibs |= 'install' in self.distribution.command_obj \
                    and self.get_finalized_command('install').no_clibs

        if no_clibs:
            # Nothing to build
            return

        if not self.dry_run and self.distribution.has_c_libraries():
            # get the previously built static libraries
            build_clib = self.get_finalized_command('build_clib')
            libraries = build_clib.get_library_names() or []

            # Module build directory where we want to copy the generated
            # libs to
            if self.inplace == 0:
                build_dir = self.build_lib
            else:
                build_dir = os.getcwd()
            target_dir = os.path.join(build_dir, 'amici', 'libs')
            self.mkpath(target_dir)

            # Copy the generated libs
            for lib in libraries:
                libfilenames = glob.glob(
                    f"{build_clib.build_clib}{os.sep}*{lib}.*")
                assert len(libfilenames) == 1, \
                    f"Found unexpected number of files: {libfilenames}"
                src = libfilenames[0]
                dest = os.path.join(target_dir, os.path.basename(src))
                log.info(f"copying {src} -> {dest}")
                copyfile(src, dest)

            generate_swig_interface_files(
                swig_outdir=os.path.join(build_dir, 'amici'))

        # Always force recompilation. The way setuptools/distutils check for
        # whether sources require recompilation is not reliable and may lead
        # to crashes or wrong results. We rather compile once too often...
        self.force = True

        # Continue with the actual extension building
        build_ext.run(self)
コード例 #5
0
 def run(self):
     if not self.no_clibs:
         generate_swig_interface_files()
     install.run(self)