示例#1
0
 def __configure(self):
     UtilsUI.print_step_begin("Configuring")
     build_dir = os.path.join(self.arg_dest, self.REPO_FOLDER,
                              self.BUILD_FOLDER)
     if not os.path.exists(build_dir):
         os.mkdir(build_dir)
     else:
         print("You may have to clear the folder:\n" + build_dir)
     os.chdir(build_dir)
     # Check and test, which options can be disabled to get required libs
     # Print dependencies with two following cmake: cmake -D...; cmake -D...
     options = []
     options.append("-DCMAKE_BUILD_TYPE=Release")
     options.append("-DBUILD_apps=OFF")
     options.append("-DBUILD_examples=OFF")
     options.append("-DBUILD_geometry=OFF")
     options.append("-DBUILD_global_tests=OFF")
     options.append("-DBUILD_io=OFF")
     options.append("-DBUILD_segmentation=OFF")
     options.append("-DBUILD_surface=OFF")
     options.append("-DBUILD_surface_on_nurbs=OFF")
     options.append("-DBUILD_tracking=OFF")
     options.append("-DBUILD_visualization=OFF")
     cmake_cmd = "cmake " + ' '.join(options) + " ../"
     call(cmake_cmd, shell=True)
     UtilsUI.print_step_end("Configuring")
     return True
示例#2
0
 def __download(self):
     UtilsUI.print_step_begin("Downloading")
     repo = "https://bitbucket.org/eigen/eigen/"
     repo_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     call("hg clone " + repo + " " + repo_dir, shell=True)
     UtilsUI.print_step_end("Downloading")
     return True
示例#3
0
 def __download(self):
     UtilsUI.print_step_begin("Downloading")
     repo = "https://bitbucket.org/eigen/eigen/"
     repo_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     call("hg clone " + repo + " " + repo_dir, shell=True)
     UtilsUI.print_step_end("Downloading")
     return True
示例#4
0
    def _post_install(self):
        include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER, "MNE")
        UtilsUI.print_env_var("MNE_INCLUDE_DIR", include_dir)

        library_path = os.path.join(self.arg_dest, self.REPO_FOLDER, "lib")
        UtilsUI.print_env_var("MNE_LIBRARY_DIR", library_path)
        return True
示例#5
0
 def __download(self):
     UtilsUI.print_step_begin("Downloading")
     repo = "https://github.com/mne-tools/mne-cpp.git"
     repo_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     call("git clone " + repo + " " + repo_dir, shell=True)
     UtilsUI.print_step_end("Downloading")
     return True
示例#6
0
 def __initialize(self):
     UtilsUI.print_step_begin("Initializing")
     repo_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     os.chdir(repo_dir)
     call("git checkout " + self.arg_version, shell=True)
     UtilsUI.print_step_end("Initializing")
     return True
示例#7
0
 def __initialize(self):
     UtilsUI.print_step_begin("Initializing")
     repo_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     os.chdir(repo_dir)
     version = "3.2.2"
     call("hg update " + version, shell=True)
     UtilsUI.print_step_end("Initializing")
     return True
示例#8
0
 def __initialize(self):
     UtilsUI.print_step_begin("Initializing")
     repo_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     os.chdir(repo_dir)
     version = "38667b56a09aa2e15c58eba85f455d99c42ce880"  # 2014-11-19
     call("git checkout " + version, shell=True)
     UtilsUI.print_step_end("Initializing")
     return True
示例#9
0
 def __compile(self):
     UtilsUI.print_step_begin("Compiling")
     mne_dir = os.path.join(self.arg_dest, self.REPO_FOLDER, "MNE")
     os.chdir(mne_dir)
     jobs = UtilsUI.ask_for_make_jobs()
     call("make -j" + str(jobs), shell=True)
     UtilsUI.print_step_end("Compiling")
     return True
示例#10
0
 def __configure(self):
     UtilsUI.print_step_begin("Configuring")
     mne_dir = os.path.join(self.arg_dest, self.REPO_FOLDER, "MNE")
     os.chdir(mne_dir)
     mne_configure = self.arg_qmake5 + " -recursive"
     call(mne_configure, shell=True)
     UtilsUI.print_step_end("Configuring")
     return True
示例#11
0
    def _install(self):
        success = True

        if success and UtilsUI.ask_for_execute("Download " + self.name):
            success = success and self.__download()
        if success and UtilsUI.ask_for_execute("Initialize " + self.name):
            success = success and self.__initialize()

        return success
示例#12
0
    def _install(self):
        success = True

        if success and UtilsUI.ask_for_execute("Download " + self.name):
            success = success and self.__download()
        if success and UtilsUI.ask_for_execute("Initialize " + self.name):
            success = success and self.__initialize()

        return success
示例#13
0
    def _post_install(self):
        envs = {}

        root_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
        envs['CXXTEST_ROOT'] = root_dir

        include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
        envs['CXXTEST_INCLUDE_DIR'] = include_dir

        UtilsUI.print_env_var(envs)

        return True
示例#14
0
    def _post_install(self):
        envs = {}

        root_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
        envs['CXXTEST_ROOT'] = root_dir

        include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
        envs['CXXTEST_INCLUDE_DIR'] = include_dir

        UtilsUI.print_env_var(envs)

        return True
示例#15
0
def main():
    # Prepare CLI arguments
    parser = argparse.ArgumentParser(formatter_class=RawTextHelpFormatter)
    parser.name = 'PackBacker'
    parser.description = 'PackBacker is a light tool to download and install 3rd party libraries.'
    parser.add_argument("job", help="Job file.")
    parser.epilog = 'PackBacker  Copyright (C) 2014  Christof Pieloth\n' \
                    'This program comes with ABSOLUTELY NO WARRANTY; see LICENSE file.\n' \
                    'This is free software, and you are welcome to redistribute it\n' \
                    'under certain conditions; see LICENSE file.'
    args = parser.parse_args()

    UtilsUI.print('PackBacker started ...')
    # Read job
    job = Job.read_job(args.job)

    # Execute job
    errors = 0
    if job:
        errors += job.execute()
    else:
        UtilsUI.print_error('Could not create job. Cancel installations!')
        errors += 1

    if errors == 0:
        UtilsUI.print('PackBacker finished.')
        return 0
    else:
        UtilsUI.print_error('PackBacker finished with errors: ' + str(errors))
        return 1
示例#16
0
 def _pre_install(self):
     UtilsUI.print(
         "NOTE: Before installing PCL from source, please try to install prebuilt binaries:"
     )
     UtilsUI.print("      http://www.pointclouds.org/downloads/")
     success = True
     success = success and Utils.check_program("git", "--version")
     success = success and Utils.check_program("cmake", "--version")
     success = success and Utils.check_program("make", "--version")
     if not Utils.check_program("g++",
                                "--version") and not Utils.check_program(
                                    "c++", "--version"):
         success = False
     return success
示例#17
0
    def install(self):
        """Starts the installation process."""
        UtilsUI.print_install_begin(self.label)

        try:
            success = self._pre_install()
            if success:
                success = self._install()

            if success:
                success = self._post_install()
        except Exception as ex:
            success = False
            self.log.error("Unexpected error:\n" + str(ex))

        UtilsUI.print_install_end(self.label)
        return success
示例#18
0
    def install(self):
        """Starts the installation process."""
        UtilsUI.print_install_begin(self.label)

        try:
            success = self._pre_install()
            if success:
                success = self._install()

            if success:
                success = self._post_install()
        except Exception as ex:
            success = False
            self.log.error("Unexpected error:\n" + str(ex))

        UtilsUI.print_install_end(self.label)
        return success
示例#19
0
    def _post_install(self):
        ftb_buffer_include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER, self.FTB_BUFFER_INCLUDE)
        UtilsUI.print_env_var("FTB_BUFFER_INCLUDE_DIR=", ftb_buffer_include_dir)

        ftb_buffer_lib = os.path.join(self.arg_dest, self.REPO_FOLDER, self.FTB_BUFFER_INCLUDE,
                                      self.FTB_BUFFER_LIBRARY)
        UtilsUI.print_env_var("FTB_BUFFER_LIBRARY=", ftb_buffer_lib)

        ftb_client_include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER, self.FTB_CLIENT_INCLUDE)
        UtilsUI.print_env_var("FTB_CLIENT_INCLUDE_DIR=", ftb_client_include_dir)

        ftb_client_lib = os.path.join(self.arg_dest, self.REPO_FOLDER, self.FTB_CLIENT_INCLUDE,
                                      self.FTB_CLIENT_LIBRARY)
        UtilsUI.print_env_var("FTB_CLIENT_LIBRARY=", ftb_client_lib)
        return True
示例#20
0
    def execute(self):
        errors = 0
        for i in self._installers:
            if not UtilsUI.ask_for_execute('Install ' + i.label):
                continue

            try:
                if i.install():
                    Job.log.info(i.name + ' executed.')
                else:
                    errors += 1
                    Job.log.error('Error on executing ' + i.name + '!')
            except Exception as ex:
                errors += 1
                Job.log.error('Unknown error:\n' + str(ex))
        return errors
示例#21
0
文件: job.py 项目: cpieloth/CppMath
    def execute(self):
        errors = 0
        for i in self._installers:
            if not UtilsUI.ask_for_execute('Install ' + i.label):
                continue

            try:
                if i.install():
                    Job.log.info(i.name + ' executed.')
                else:
                    errors += 1
                    Job.log.error('Error on executing ' + i.name + '!')
            except Exception as ex:
                errors += 1
                Job.log.error('Unknown error:\n' + str(ex))
        return errors
示例#22
0
 def __compile_install(self):
     UtilsUI.print_step_begin("Compiling & Installing")
     build_dir = os.path.join(self.arg_dest, self.REPO_FOLDER,
                              self.BUILD_FOLDER)
     os.chdir(build_dir)
     jobs = UtilsUI.ask_for_make_jobs()
     call("make -j" + str(jobs), shell=True)
     if UtilsUI.ask_for_execute(
             "Install PCL to system? (requires root/sudo)"):
         call("sudo make install", shell=True)
     UtilsUI.print_step_end("Compiling & Installing")
     return True
示例#23
0
    def _post_install(self):
        ftb_buffer_include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER,
                                              self.FTB_BUFFER_INCLUDE)
        UtilsUI.print_env_var("FTB_BUFFER_INCLUDE_DIR=",
                              ftb_buffer_include_dir)

        ftb_buffer_lib = os.path.join(self.arg_dest, self.REPO_FOLDER,
                                      self.FTB_BUFFER_INCLUDE,
                                      self.FTB_BUFFER_LIBRARY)
        UtilsUI.print_env_var("FTB_BUFFER_LIBRARY=", ftb_buffer_lib)

        ftb_client_include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER,
                                              self.FTB_CLIENT_INCLUDE)
        UtilsUI.print_env_var("FTB_CLIENT_INCLUDE_DIR=",
                              ftb_client_include_dir)

        ftb_client_lib = os.path.join(self.arg_dest, self.REPO_FOLDER,
                                      self.FTB_CLIENT_INCLUDE,
                                      self.FTB_CLIENT_LIBRARY)
        UtilsUI.print_env_var("FTB_CLIENT_LIBRARY=", ftb_client_lib)
        return True
示例#24
0
 def __compile(self):
     UtilsUI.print_step_begin("Compiling")
     self.__compile_ftb_buffer()
     self.__compile_ftb_client()
     UtilsUI.print_step_end("Compiling")
     return True
示例#25
0
 def _post_install(self):
     include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     UtilsUI.print_env_var('EIGEN3_INCLUDE_DIR', include_dir)
     return True
示例#26
0
 def _post_install(self):
     include_dir = os.path.join(self.arg_dest, self.REPO_FOLDER)
     UtilsUI.print_env_var('EIGEN3_INCLUDE_DIR', include_dir)
     return True
示例#27
0
 def __compile(self):
     UtilsUI.print_step_begin("Compiling")
     self.__compile_ftb_buffer()
     self.__compile_ftb_client()
     UtilsUI.print_step_end("Compiling")
     return True
示例#28
0
 def _post_install(self):
     pcl_dir = os.path.join(self.arg_dest, self.REPO_FOLDER,
                            self.BUILD_FOLDER)
     UtilsUI.print_env_var("PCL_DIR=", pcl_dir)
     return True