Пример #1
0
def checkInstalled():
    import path
    exists = path.getPath(utils.ADDON.getSetting('OS'), silent=True)
    if not exists:
        if utils.yesno('Do you want to install the VPN application now'):
            import install
            install.install(silent=False)
Пример #2
0
def checkInstalled():
    import path
    exists = path.getPath(utils.GetSetting('OS'), silent=True)
    if not exists:
        if utils.yesno('Do you want to install the VPN application now'):
            import install
            install.install(silent=False)
Пример #3
0
def main_menu():
    print_main_menu()
    choice = sanatize.sanitize_int("Enter a selection: ", 1, 9)
    if choice == 1:
        confirm = input(
            'Are you sure, this will erase all data from the database.')
        if confirm.upper() == "Y" or confirm.upper() == "YES":
            install.install()
        else:
            print("Selection not confirmed, no changes made.")
    elif choice == 2:
        year = sanatize.sanitize_int("What Season Would you like to install:",
                                     1901, 2017)
        install.import_season(year)
    elif choice == 3:
        td.run_draft(d.Draft())
    elif choice == 4:
        print("Review Tournament Draft not yet created, try again.")
    elif choice == 5:
        print("Continue Saved Tournament Draft not yet created, try again.")
    elif choice == 6:
        print("League Draft not yet created, try again.")
    elif choice == 7:
        print("Review League Draft not yet created, try again.")
    elif choice == 8:
        print("Continue Saved League Draft not yet created, try again.")
    elif choice == 9:
        player_list = player.open_player_list('1911_test')
        players = player.load_players(player_list)
        for p in players:
            p.display_card()
        input()
Пример #4
0
    def post(self):
        try:
            clear = self.get_argument('clear', 0)
            if clear:
                model.Banco.objects().delete()
                model.Categoria.objects().delete()
                model.Lancamento.objects().delete()

            pw = self.get_argument('password')
            us = self.get_argument('user')
            salt = bcrypt.gensalt()

            reset = self.get_argument('reset', 1)
            if reset:
                model.User.objects().delete()
                model.Module.objects().delete()
                model.Permission.objects().delete()
                user = model.User.objects()
                if len(user) > 0:
                    raise Exception('ja instalado')

            hash = bcrypt.hashpw(pw.encode('utf-8'), salt)

            user = model.User(username=us,password=hash,salt=salt)

            install.install(user)

            user.save()

            self.write('instalacao concluida!')
        except Exception as err:
            self.set_status(500)
            print(err)
            self.write(str(err))
Пример #5
0
def restart(nodes, clean):

    if len(nodes) > 0:
        all_nodes = nodes
    else:
        all_nodes = config.Config.nodes()

    util.output("stopping ...")
    if len(nodes) > 0:
        # User picked nodes to restart.
        _stopNodes(nodes)
    else:
        stop([])

    if clean:
        # Can't delete the tmp here because log archival might still be going on there in the background.
        cleanup(all_nodes, False)

        util.output("checking configuration ...")
        if not checkConfigs(all_nodes):
            return

        util.output("installing ...")
        install.install(False, False)

    util.output("starting ...")
    if len(nodes) > 0:
        _startNodes(nodes)
    else:
        start([])
Пример #6
0
def main():

    ap = argparse.ArgumentParser()
    ap.add_argument("-H", "--host", required=False, default="localhost",
        help="Hostname of the InfluxDB server (Default: 'localhost')")
    ap.add_argument("-p", "--port", required=False, default=8086, type=int,
        help="Port of the InfluxDB server (Default: 8086)")
    ap.add_argument("-i", "--interval", required=False, default=3600, type=int,
        help="Update Interval in seconds to read data and push to the DB (Default: 3600)")
    ap.add_argument("-d", "--database", required=False, default='iobroker',
        help="Set the default database (Default: 'iobroker')")
    ap.add_argument("-I", "--install", required=False,
        help="Install/Reinstall the geckodriver", action='store_true')
    args = ap.parse_args()

    if args.install:
        install.install()

    config = {
        'host': args.host,
        'port': args.port,
        'database': args.database,
        'interval': args.interval
    }

    configFile = open("config.json", "w")
    json.dump(config, configFile)
    configFile.close()
Пример #7
0
def _main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('--venv_path',
                        required=True,
                        help='Path at which to create the venv')
    parser.add_argument('-r',
                        '--requirements',
                        default=[],
                        action='append',
                        help='requirements.txt files to install')
    parser.add_argument('-s',
                        '--setup-py-roots',
                        default=[],
                        action='append',
                        help='places to search for setup.py files')
    parser.add_argument('--quick-setup',
                        dest='full_envsetup',
                        action='store_false',
                        default='PW_ENVSETUP_FULL' in os.environ,
                        help=('Do full setup or only minimal checks to see if '
                              'full setup is required.'))
    parser.add_argument('--python',
                        default=sys.executable,
                        help='Python to use when creating virtualenv.')

    virtualenv_setup.install(**vars(parser.parse_args()))

    return 0
Пример #8
0
 def test_uninstall_after_install(self):
     install(self.source_dir, self.target_dir, self.backup_dir)
     uninstall(self.source_dir, self.target_dir, self.backup_dir)
     bashrc_target = os.path.join(self.target_dir, '.bashrc')
     pysnippets_target = os.path.join(
         self.target_dir,
         '.vim/snippets/python.snippets')
     self.assertFalse(os.path.exists(bashrc_target))
     self.assertFalse(os.path.exists(pysnippets_target))
Пример #9
0
def main():
    if '-I' in sys.argv:
        install()

    if not resolvedependencies():
        exit()
    print('Everything OK!\r\n')

    logger.info('Starting application.')

    # Start the crawling process
    medid.crawlloop()
Пример #10
0
def main():

    ap = argparse.ArgumentParser()
    ap.add_argument(
        "-H",
        "--host",
        required=False,
        default="localhost",
        help="Hostname of the InfluxDB server (Default: 'localhost')")
    ap.add_argument("-p",
                    "--port",
                    required=False,
                    default=8086,
                    help="Port of the InfluxDB server (Default: 8086)")
    ap.add_argument(
        "-i",
        "--interval",
        required=False,
        default=3600,
        help=
        "Update Interval in seconds to read data and push to the DB (Default: 3600)"
    )
    ap.add_argument(
        "-d",
        "--database",
        required=False,
        default='iobroker',
        help="Set the default database (Default: 'iobroker.global')")
    ap.add_argument("-I",
                    "--install",
                    required=False,
                    default='n',
                    help="Install/Reinstall the geckodriver (Default: 'n')")
    args = vars(ap.parse_args())

    if args["install"] is 'y':
        install.install()

    config = {
        'host': args["host"],
        'port': args["port"],
        'database': args["database"],
        'interval': int(args["interval"])
    }

    configFile = open("config.json", "w")
    json.dump(config, configFile)
    configFile.close()
Пример #11
0
    def test_target_does_not_exist(self):
        install(self.source_dir, self.target_dir, self.backup_dir)

        bashrc_source = os.path.join(self.source_dir, '.bashrc')
        bashrc_target = os.path.join(self.target_dir, '.bashrc')
        pysnippets_source = os.path.join(
            self.source_dir,
            '.vim/snippets/python.snippets')
        pysnippets_target = os.path.join(
            self.target_dir,
            '.vim/snippets/python.snippets')

        self.assertTrue(os.path.exists(bashrc_target))
        self.assertTrue(os.readlink(bashrc_target) == bashrc_source)
        self.assertTrue(os.path.exists(pysnippets_target))
        self.assertTrue(os.readlink(pysnippets_target) == pysnippets_source)
Пример #12
0
    def test_install_main(self, hemock, pmock, urmock, crmock, dgmock, ipmock):
        """
        Ensure the driver/main method is calling all the supporting methods.
        """
        install.install()

        assert(ipmock.called)
        assert(dgmock.called)
        assert(crmock.called)
        assert(urmock.called)

        assert(pmock.called)
        pmock.assert_called_with('/srv/kubernetes')

        hemock.open_port.assert_any_call(443)
        hemock.open_port.assert_any_call(8080)
        hemock.open_port.assert_any_call(6443)
Пример #13
0
    def run_setup(self):

        username = self._username.get()
        password = self._password.get()
        path_dir = self._pathdir.get()
        shortcut_path = os.path.join(os.path.expanduser('~'), 'Desktop')
        genome_path = self._genomepath.get()
        if self._cur_os == 'win32' or self._cur_os == 'cygwin':
            shortcut_path = shortcut_path.replace("/", "\\") 

        #if os.path.join(shortcut_path, 'pipeline'):
        #    self.insert_text('The shortcut already exists!', self._message_txt)
        #    sys.exit(1)

        #self.insert_text(shortcut_path, self._message_txt)

        install(username, password, path_dir, shortcut_path, genome_path)
Пример #14
0
    def run_setup(self):

        username = self._username.get()
        password = self._password.get()
        path_dir = self._pathdir.get()
        shortcut_path = os.path.join(os.path.expanduser('~'), 'Desktop')
        genome_path = self._genomepath.get()
        if self._cur_os == 'win32' or self._cur_os == 'cygwin':
            shortcut_path = shortcut_path.replace("/", "\\")

        #if os.path.join(shortcut_path, 'pipeline'):
        #    self.insert_text('The shortcut already exists!', self._message_txt)
        #    sys.exit(1)

        #self.insert_text(shortcut_path, self._message_txt)

        install(username, password, path_dir, shortcut_path, genome_path)
Пример #15
0
    def test_install_main(self, hemock, urmock, crmock, dgmock, ipmock):
        """
        Ensure the driver/main method is calling all the supporting methods.
        """
        strings = [
        'export GOROOT=/usr/local/go\n',
        'export PATH=$PATH:$GOROOT/bin\n',
        'export KUBE_MASTER_IP=0.0.0.0\n',
        'export KUBERNETES_MASTER=http://$KUBE_MASTER_IP\n',
        ]

        install.install()
        crmock.assert_called_once()
        dgmock.assert_called_once()
        crmock.assert_called_once()
        urmock.assert_called_with(strings)
        hemock.open_port.assert_called_with(8080)
Пример #16
0
    def test_install_main(self, hemock, urmock, crmock, dgmock, ipmock):
        """
        Ensure the driver/main method is calling all the supporting methods.
        """
        strings = [
            'export GOROOT=/usr/local/go\n',
            'export PATH=$PATH:$GOROOT/bin\n',
            'export KUBE_MASTER_IP=0.0.0.0\n',
            'export KUBERNETES_MASTER=http://$KUBE_MASTER_IP\n',
        ]

        install.install()
        crmock.assert_called_once()
        dgmock.assert_called_once()
        crmock.assert_called_once()
        urmock.assert_called_with(strings)
        hemock.open_port.assert_called_with(8080)
Пример #17
0
    def install_selected(widget):

        print(tools_to_install)
        for i in tools_to_install:
            print(i)
            rc_i = install.install(i)
            if rc_i != 0:
                broken.append(i)
            if rc_i == 0:
                installed_tools.append(i)
Пример #18
0
    def install_all(widget):
        for i in all_tools:
            #just for this tool, need to change the name to be consistent with the backend. In the list it is can-utils-j1939 because it is used for the search functionality
            if i is 'can-utils-j1939':
                i = 'j1939'

            rc_i = install.install(i)
            if rc_i != 0:
                broken.append(i)
            if rc_i == 0:
                installed_tools.append(i)
Пример #19
0
def _main():
    parser = argparse.ArgumentParser(description=__doc__)

    project_root = os.environ.get('PW_PROJECT_ROOT', None)

    parser.add_argument('--project-root',
                        default=project_root,
                        required=not project_root,
                        help='Path to overall project root.')
    parser.add_argument('--venv_path',
                        required=True,
                        help='Path at which to create the venv')
    parser.add_argument('-r',
                        '--requirements',
                        default=[],
                        action='append',
                        help='requirements.txt files to install')
    parser.add_argument('--gn-target',
                        dest='gn_targets',
                        default=[],
                        action='append',
                        type=virtualenv_setup.GnTarget,
                        help='GN targets that install packages')
    parser.add_argument('--quick-setup',
                        dest='full_envsetup',
                        action='store_false',
                        default='PW_ENVSETUP_FULL' in os.environ,
                        help=('Do full setup or only minimal checks to see if '
                              'full setup is required.'))
    parser.add_argument('--python',
                        default=sys.executable,
                        help='Python to use when creating virtualenv.')

    virtualenv_setup.install(**vars(parser.parse_args()))

    return 0
Пример #20
0
def IMPPythonExecutable(env, file):
    if env["IMP_PASS"] != "RUN":
        return

    def dummy(target, source, env):
        pass

    _PythonExeDependency = Builder(action=Action(dummy, dummy), source_scanner=pyscanner.PythonScanner)

    if env.GetOption("help"):
        return
    inst = install.install(env, "bindir", file)

    # Make sure that when we install a Python executable we first build
    # any Python modules it uses (env.Install() does not appear to accept
    # source_scanner, so we use a dummy do-nothing builder to add these
    # dependencies)
    pydep = _PythonExeDependency(env, target=None, source=file)
    env.Depends(inst, pydep)
    env.Append(IMP_PYTHON_EXECUTABLES=[file])
Пример #21
0
        def install_callback(self):

            rc_i = install.install(v)

            #this needs to be wrapped around an exception incase for some reason the correct name isn't passed
            if rc_i == 0:
                widget.ids.dynbutton.remove_widget(i)
                o = Button(text='Open',
                           size_hint=(.15, .07),
                           pos_hint={
                               'x': .3,
                               'y': .075
                           },
                           background_color=[0, 1, 0,
                                             .65])  #this should be green
                o.bind(on_press=open_callback)
                up = Button(text='Update',
                            size_hint=(.15, .07),
                            pos_hint={
                                'x': .45,
                                'y': .075
                            },
                            background_color=[0, 0, 1, .65])
                up.bind(on_press=update_callback)
                un = Button(text='Uninstall',
                            size_hint=(.15, .07),
                            pos_hint={
                                'x': .60,
                                'y': .075
                            },
                            background_color=[0, 0, 1, .75])
                un.bind(on_press=uninstall_callback)

                widget.ids.dynbutton.add_widget(o)
                widget.ids.dynbutton.add_widget(up)
                widget.ids.dynbutton.add_widget(un)
                installed_tools.append(v)

            elif rc_i != 0:
                i.background_color = [1, 0, 0, .65]
                i.text = 'Failed to Install'
Пример #22
0
def install_language(language, results=None, no_import=None, args=None,
                     arglist=None):
    r"""Call install for a specific language.

    Args:
        language (str): Name of language that should be checked.
        results (dict, optional): Dictionary where result (whether or not the
            language is installed) should be logged. Defaults to None and is
            initialized to an empty dict.
        no_import (bool, optional): If True, yggdrasil will not be imported.
            Defaults to None and is set based on the value parsed from
            arglist.
        args (argparse.Namespace, optional): Arguments parsed from the
            command line. Default to None and is created.
        arglist (list, optional): List of arguments to parse. Defaults to
            None and sys.argv is used.

    """
    if args is None:
        args = update_argparser(no_import=no_import,
                                arglist=arglist).parse_args(args=arglist)
    if no_import is None:
        no_import = args.no_import
    if results is None:
        results = {}
    with import_language_install(language, no_import=no_import) as install:
        if install is None:
            logger.info("Nothing to be done for %s" % language)
            name_in_pragmas = language.lower()
            results[name_in_pragmas] = True
            return
        else:
            name_in_pragmas = getattr(install, 'name_in_pragmas', language.lower())
            out = install.install(args=args)
            results[name_in_pragmas] = out
    if not out:
        warnings.warn(("Could not complete installation for {lang}. "
                       "{lang} support will be disabled.").format(lang=language))
    else:
        logger.info("Language %s installed." % language)
Пример #23
0
"""
                              POKUS
                           October 2016
                      Magic Wand Productions
"""
try:
    from colorama import *
except ImportError:
    from install import install
    install("colorama")
init()
from klasser import *
from random import randint
from grafikk import *
import tutorial, gnom, troll, cerberus, gargyl, shroom, example_expansion, os

skrivTittel()
input("Trykk enter for å fortsette\n> ")
print("\033[A                             \033[A")
print("\033[A                             \033[A")
lastTidligere = load_screen()
if lastTidligere:
    spiller = Spiller(last_navn(lastTidligere))
else:
    navn = ""
    while len(navn) == 0 or "," in navn:
        navn = input("Velg et navn til karakteren din:\n> ")
        if "," in navn:
            print("Du kan ikke ha komma i navnet ditt.\n")
    spiller = Spiller(navn)
Пример #24
0
def main(**args):
    install(args)
Пример #25
0
    llvm_dir = os.path.realpath(os.path.join(root_dir, 'llvm'))
    llvm_install_dir = os.path.join(llvm_dir, 'install')
    if not os.path.exists(llvm_dir):
        os.mkdir(llvm_dir)

        llvm_tarball = os.path.join(llvm_dir, 'llvm-3.5.2.src.tar.xz')
        llvm_source_dir = os.path.join(llvm_dir, 'llvm-3.5.2.src')
        clang_tarball = os.path.join(llvm_dir, 'cfe-3.5.2.src.tar.xz')
        clang_source_dir = os.path.join(llvm_dir, 'cfe-3.5.2.src')
        download(llvm_tarball, 'http://llvm.org/releases/3.5.2/llvm-3.5.2.src.tar.xz', '85faf7cbd518dabeafc4d3f7e909338fc1dab3c4')
        download(clang_tarball, 'http://llvm.org/releases/3.5.2/cfe-3.5.2.src.tar.xz', '50291e4c4ced8fcee3cca40bff0afb19fcc356e2')
        extract(llvm_dir, llvm_tarball, 'xz')
        extract(llvm_dir, clang_tarball, 'xz')
        os.rename(clang_source_dir, os.path.join(llvm_source_dir, 'tools', 'clang'))

        llvm_build_dir = os.path.join(llvm_dir, 'build')
        os.mkdir(llvm_build_dir)
        os.mkdir(llvm_install_dir)
        build_llvm(llvm_source_dir, llvm_build_dir, llvm_install_dir, thread_count)
    assert os.path.exists(llvm_install_dir)

    terra_dir = os.path.join(root_dir, 'terra.build')
    if not os.path.exists(terra_dir):
        git_clone(terra_dir, 'https://github.com/elliottslaughter/terra.git', 'compiler-ppopp17-snapshot')
        build_terra(terra_dir, llvm_install_dir, thread_count)

    install.install(
        shared_llr=False, general_llr=True, gasnet=True, cuda=False,
        external_terra_dir=terra_dir, gasnet_dir=gasnet_release_dir,
        debug=False, thread_count=thread_count)
def main():
    parser = argparse.ArgumentParser(
        'TensorSpace.js model converter/preprocessor.')
    parser.add_argument(
        'input_path',
        nargs='?',
        type=str,
        help='Path to the input file or directory. For input format "keras", '
        'an HDF5 (.h5) file or structure (.json) and weight (.hdf5) directory '
        'is expected.')
    parser.add_argument('output_path',
                        nargs='?',
                        type=str,
                        help='Path for all output artifacts.')
    parser.add_argument('--input_model_from',
                        type=str,
                        required=False,
                        default='keras',
                        choices=set(['tensorflow', 'keras', 'tfjs']),
                        help='Input model type.\n'
                        'It could be "tensorflow", "keras", "tfjs"')
    parser.add_argument(
        '--input_model_format',
        type=str,
        required=False,
        choices=set([
            'topology_weights_combined', 'topology_weights_separated',
            'tf_saved', 'tf_frozen', 'tf_keras', 'tf_keras_separated'
        ]),
        help='Input format.\n'
        'For "topology_weights_combined", config for Keras model, input is .h5 saved by .save().\n'
        'For "topology_weights_separated", config for Keras model, inputs are topology+weights.\n'
        'For "tf_saved", config for TensorFlow model, input is TensorFlow saved model.\n'
        'For "tf_frozen", config for TensorFlow model, input is TensorFlow frozen model.\n'
        'For "tf_keras", config for TensorFlow model, input is .h5 model.\n'
        'For "tf_keras_separated", config for TensorFlow model, input is topology+weights.'
    )
    parser.add_argument(
        '--output_layer_names',
        type=str,
        help='The names of the output nodes, separated by slash. '
        'E.g., "logits/activations".')
    parser.add_argument(
        '--version',
        '-v',
        '-V',
        dest='show_version',
        action='store_true',
        help='Show versions of tensorspacejs and its dependencies')
    parser.add_argument('-init',
                        dest='init',
                        action='store_true',
                        help='Init TensorSpace Converter')
    parser.add_argument('--summary',
                        '-s',
                        dest='show_model_summary',
                        action='store_true',
                        help='Show summray of loaded model')

    flags = parser.parse_args()

    if flags.show_version:
        print('\ntensorspacejs %s\n' % version)
        print('Dependency versions:')
        print('python %s' % python_version)
        print('node %s' % node_version)
        print('npm %s' % npm_version)
        print('tensorflow %s' % tensorflow_version)
        print('keras %s' % keras_version)
        print('tensorflowjs %s' % tensorflowjs_version)
        return

    if flags.init:
        install()
        return

    if flags.input_path is None:
        raise ValueError('Error: The input_path argument must be set. '
                         'Run with --help flag for usage information.')

    if flags.input_model_from not in ('tensorflow', 'keras', 'tfjs'):
        raise ValueError('The --input_model_from flag can only be set to '
                         '"tensorflow", "keras", "tfjs" '
                         'but the current input type is "%s".' %
                         flags.input_model_from)

    if flags.input_model_from == 'keras'\
            and flags.input_model_format not in (
            'topology_weights_combined',
            'topology_weights_separated'):
        raise ValueError(
            'For input_model_from == "keras", the --input_model_format flag can only be set to'
            '"topology_weights_combined" and "topology_weights_separated" '
            'but the current input model format is "%s".' %
            flags.input_model_format)

    if flags.input_model_from == 'tensorflow'\
            and flags.input_model_format not in (
            'tf_saved',
            'tf_frozen',
            'tf_keras',
            'tf_keras_separated'):
        raise ValueError(
            'For input_model_from == "tensorflow", the --input_model_format flag can only be set to'
            '"tf_saved", "tf_frozen", "tf_checkpoint_model", "tf_keras", "tf_keras_separated" '
            'but the current input model format is "%s".' %
            flags.input_model_format)

    if flags.show_model_summary:
        if flags.input_model_from == 'keras':
            show_keras_model_summary(flags.input_model_format,
                                     flags.input_path)
            return
        if flags.input_model_from == 'tensorflow':
            show_tf_model_summary(flags.input_model_format, flags.input_path)
            return
        if flags.input_model_from == "tfjs":
            show_tfjs_model_summary(flags.input_path)
            return
        return

    if flags.input_model_from == 'tensorflow':
        preprocess_tensorflow_model(flags.input_model_format, flags.input_path,
                                    flags.output_path,
                                    flags.output_layer_names)
        return

    if flags.input_model_from == 'keras':
        preprocess_keras_model(flags.input_model_format, flags.input_path,
                               flags.output_path, flags.output_layer_names)
        return

    if flags.input_model_from == 'tfjs':
        process_tfjs_model(flags.input_path, flags.output_path,
                           flags.output_layer_names)
        return

    print("Nothing happened...")
Пример #27
0
def driver(llvm_version, insecure):
    if 'CC' not in os.environ:
        raise Exception('Please set CC in your environment')
    if 'CXX' not in os.environ:
        raise Exception('Please set CXX in your environment')
    if 'LG_RT_DIR' in os.environ:
        raise Exception('Please unset LG_RT_DIR in your environment')

    is_cray = 'CRAYPE_VERSION' in os.environ

    if is_cray:
        print('This system has been detected as a Cray system.')
        print()
        print('Note: The Cray wrappers are broken for various purposes')
        print('(particularly, dynamically linked libraries). For this')
        print('reason this script requires that HOST_CC and HOST_CXX')
        print('be set to the underlying compilers (GCC and G++, etc.).')
        print()
        if 'HOST_CC' not in os.environ:
            raise Exception('Please set HOST_CC in your environment')
        if 'HOST_CXX' not in os.environ:
            raise Exception('Please set HOST_CXX in your environment')

    if llvm_version == '38':
        llvm_use_cmake = False
    elif llvm_version == '39':
        llvm_use_cmake = True
    else:
        raise Exception('Unrecognized LLVM version %s' % llvm_version)

    root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
    legion_dir = os.path.dirname(root_dir)

    thread_count = multiprocessing.cpu_count()

    conduit = discover_conduit()
    gasnet_dir = os.path.realpath(os.path.join(root_dir, 'gasnet'))
    gasnet_release_dir = os.path.join(gasnet_dir, 'release')
    if not os.path.exists(gasnet_dir):
        git_clone(gasnet_dir, 'https://github.com/StanfordLegion/gasnet.git')
        build_gasnet(gasnet_dir, conduit)
    assert os.path.exists(gasnet_release_dir)

    cmake_exe = None
    if llvm_use_cmake:
        cmake_dir = os.path.realpath(os.path.join(root_dir, 'cmake'))
        cmake_install_dir = os.path.join(cmake_dir, 'cmake-3.7.2-Linux-x86_64')
        if not os.path.exists(cmake_dir):
            os.mkdir(cmake_dir)

            cmake_tarball = os.path.join(cmake_dir,
                                         'cmake-3.7.2-Linux-x86_64.tar.gz')
            download(
                cmake_tarball,
                'https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz',
                '915bc981aab354821fb9fd28374a720fdb3aa180',
                insecure=insecure)
            extract(cmake_dir, cmake_tarball, 'gz')
        assert os.path.exists(cmake_install_dir)
        cmake_exe = os.path.join(cmake_install_dir, 'bin', 'cmake')

    llvm_dir = os.path.realpath(os.path.join(root_dir, 'llvm'))
    llvm_install_dir = os.path.join(llvm_dir, 'install')
    if not os.path.exists(llvm_dir):
        os.mkdir(llvm_dir)

        if llvm_version == '38':
            llvm_tarball = os.path.join(llvm_dir, 'llvm-3.8.1.src.tar.xz')
            llvm_source_dir = os.path.join(llvm_dir, 'llvm-3.8.1.src')
            clang_tarball = os.path.join(llvm_dir, 'cfe-3.8.1.src.tar.xz')
            clang_source_dir = os.path.join(llvm_dir, 'cfe-3.8.1.src')
            download(llvm_tarball,
                     'http://llvm.org/releases/3.8.1/llvm-3.8.1.src.tar.xz',
                     'e0c48c4c182424b99999367d688cd8ce7876827b',
                     insecure=insecure)
            download(clang_tarball,
                     'http://llvm.org/releases/3.8.1/cfe-3.8.1.src.tar.xz',
                     'b5ff24dc6ad8f84654f4859389990bace1cfb6d5',
                     insecure=insecure)
        elif llvm_version == '39':
            llvm_tarball = os.path.join(llvm_dir, 'llvm-3.9.1.src.tar.xz')
            llvm_source_dir = os.path.join(llvm_dir, 'llvm-3.9.1.src')
            clang_tarball = os.path.join(llvm_dir, 'cfe-3.9.1.src.tar.xz')
            clang_source_dir = os.path.join(llvm_dir, 'cfe-3.9.1.src')
            download(llvm_tarball,
                     'http://llvm.org/releases/3.9.1/llvm-3.9.1.src.tar.xz',
                     'ce801cf456b8dacd565ce8df8288b4d90e7317ff',
                     insecure=insecure)
            download(clang_tarball,
                     'http://llvm.org/releases/3.9.1/cfe-3.9.1.src.tar.xz',
                     '95e4be54b70f32cf98a8de36821ea5495b84add8',
                     insecure=insecure)
        extract(llvm_dir, llvm_tarball, 'xz')
        extract(llvm_dir, clang_tarball, 'xz')
        os.rename(clang_source_dir,
                  os.path.join(llvm_source_dir, 'tools', 'clang'))

        llvm_build_dir = os.path.join(llvm_dir, 'build')
        os.mkdir(llvm_build_dir)
        os.mkdir(llvm_install_dir)
        build_llvm(llvm_source_dir, llvm_build_dir, llvm_install_dir,
                   llvm_use_cmake, cmake_exe, thread_count, is_cray)
    assert os.path.exists(llvm_install_dir)

    terra_dir = os.path.join(root_dir, 'terra.build')
    if not os.path.exists(terra_dir):
        git_clone(terra_dir, 'https://github.com/elliottslaughter/terra.git',
                  'compiler-sc17-snapshot')
        build_terra(terra_dir, llvm_install_dir, is_cray, thread_count)

    use_cuda = 'USE_CUDA' in os.environ and os.environ['USE_CUDA'] == '1'
    use_openmp = 'USE_OPENMP' in os.environ and os.environ['USE_OPENMP'] == '1'
    use_hdf = 'USE_HDF' in os.environ and os.environ['USE_HDF'] == '1'
    debug = 'DEBUG' in os.environ and os.environ['DEBUG'] == '1'
    install.install(gasnet=True,
                    cuda=use_cuda,
                    openmp=use_openmp,
                    hdf=use_hdf,
                    external_terra_dir=terra_dir,
                    gasnet_dir=gasnet_release_dir,
                    conduit=conduit,
                    debug=debug,
                    thread_count=thread_count)
Пример #28
0
    def render(self, scene):

        # Check first-run installation
        install.install()

        # Compute film dimensions
        scale = scene.render.resolution_percentage / 100.0
        sx = int(scene.render.resolution_x * scale)
        sy = int(scene.render.resolution_y * scale)

        print("Starting render, resolution {} {}".format(sx, sy))
        textureUtil.resetTextureCounter()

        # Compute pbrt executable path
        pbrtExecPath = install.getExecutablePath(
            scene.iilePath,
            pbrt.DEFAULT_IILE_PROJECT_PATH,
            "pbrt"
        )
        obj2pbrtExecPath = install.getExecutablePath(
            scene.iilePath,
            pbrt.DEFAULT_IILE_PROJECT_PATH,
            "obj2pbrt"
        )

        if pbrtExecPath is None:
            errorMessage(self, "PBRT executable not found. The exporter can use the pbrt executable if it's in the system PATH, or you can specify the directory of the PBRT executable from the Render properties tab")
        if obj2pbrtExecPath is None:
            errorMessage(self, "obj2pbrt executable not found. The exporter can use the obj2pbrt executable if it's in the system PATH, or you can specify the directory of the PBRT and OBJ2PBRT executables from the Render properties tab")

        print("PBRT: {}".format(pbrtExecPath))
        print("OBJ2PBRT: {}".format(obj2pbrtExecPath))

        # Determine PBRT project directory
        if not os.path.exists(scene.iilePath):
            # Check fallback
            if not os.path.exists(pbrt.DEFAULT_IILE_PROJECT_PATH):
                warningMessage(self, "WARNING no project directory found. Are you using vanilla PBRTv3? Some features might not work, such as IILE integrator and GUI renderer")
            else:
                scene.iilePath = pbrt.DEFAULT_IILE_PROJECT_PATH

        rootDir = os.path.abspath(os.path.join(scene.iilePath, ".."))

        # Get the output path
        outDir = bpy.data.scenes["Scene"].render.filepath
        outDir = bpy.path.abspath(outDir)
        print("Out dir is {}".format(outDir))
        outObjPath = os.path.join(outDir, "exp.obj")
        outExpPbrtPath = os.path.join(outDir, "exp.pbrt")
        outExp2PbrtPath = os.path.join(outDir, "exp2.pbrt")
        outScenePath = os.path.join(outDir, "scene.pbrt")

        # Create exporting script
        expScriptPath = os.path.join(outDir, "exp.py")
        expScriptFile = open(expScriptPath, "w")
        wline(expScriptFile, 'import bpy')
        wline(expScriptFile, 'outobj = "{}"'.format(outObjPath))
        wline(expScriptFile, 'bpy.ops.export_scene.obj(filepath=outobj, axis_forward="Y", axis_up="-Z", use_materials=True)')
        expScriptFile.close()

        blenderPath = bpy.app.binary_path
        projectPath = bpy.data.filepath
        if not os.path.isfile(projectPath):
            errorMessage(self, "Please Save before Render")

        cmd = [
            blenderPath,
            projectPath,
            "--background",
            "--python",
            expScriptPath
        ]
        runCmd(cmd)

        print("OBJ export completed")

        # Run obj2pbrt
        cmd = [
            obj2pbrtExecPath,
            outObjPath,
            outExpPbrtPath
        ]
        runCmd(cmd, cwd=outDir)

        # Run pbrt --toply
        cmd = [
            pbrtExecPath,
            "--toply",
            outExpPbrtPath
        ]
        outExp2PbrtFile = open(outExp2PbrtPath, "w")
        runCmd(cmd, stdout=outExp2PbrtFile, cwd=outDir)
        outExp2PbrtFile.close()

        # -----------------------------------------------------------
        # Scene transformation
        doc = sceneParser.SceneDocument()
        doc.parse(outExp2PbrtPath)

        # Write initial things
        headerBlocks = []

        # Film, Camera, transformations
        b = sceneParser.SceneBlock([])
        headerBlocks.append(b)
        b.appendLine(0, 'Film "image" "integer xresolution" {} "integer yresolution" {}'.format(sx, sy))

        # Integrator name
        integratorName = "path"
        if bpy.context.scene.iileIntegrator == "PATH":
            integratorName = "path"
        elif bpy.context.scene.iileIntegrator == "IILE":
            integratorName = "iispt"
        elif bpy.context.scene.iileIntegrator == "BDPT":
            integratorName = "bdpt"
        else:
            errorMessage(self, "Unrecognized iileIntegrator {}".format(
                bpy.context.scene.iileIntegrator))
        b.appendLine(0, 'Integrator "{}"'.format(integratorName))

        # Integrator specifics
        if bpy.context.scene.iileIntegrator == "PATH":
            pass
        elif bpy.context.scene.iileIntegrator == "BDPT":
            b.appendLine(1, '"integer maxdepth" [{}]'.format(bpy.context.scene.iileIntegratorBdptMaxdepth))
            b.appendLine(1, '"string lightsamplestrategy" "{}"'.format(bpy.context.scene.iileIntegratorBdptLightsamplestrategy.lower()))
            b.appendLine(1, '"bool visualizestrategies" "{}"'.format("true" if bpy.context.scene.iileIntegratorBdptVisualizestrategies else "false"))
            b.appendLine(1, '"bool visualizeweights" "{}"'.format("true" if bpy.context.scene.iileIntegratorBdptVisualizeweights else "false"))

        samplerName = "random"
        if bpy.context.scene.iileIntegratorPathSampler == "RANDOM":
            samplerName = "random"
        elif bpy.context.scene.iileIntegratorPathSampler == "SOBOL":
            samplerName = "sobol"
        elif bpy.context.scene.iileIntegratorPathSampler == "HALTON":
            samplerName = "halton"
        else:
            errorMessage(self, "Unrecognized sampler {}".format(bpy.context.scene.iileIntegratorPathSampler))

        b.appendLine(0, 'Sampler "{}" "integer pixelsamples" {}'.format(samplerName, bpy.context.scene.iileIntegratorPathSamples))

        b.appendLine(0, 'Scale -1 1 1')

        # Get camera
        theCameraName = bpy.context.scene.camera.name
        theCamera = bpy.data.cameras[theCameraName]

        bpy.context.scene.camera.rotation_mode = "AXIS_ANGLE"
        print("Camera rotation axis angle is {} {} {} {}".format(bpy.context.scene.camera.rotation_axis_angle[0], bpy.context.scene.camera.rotation_axis_angle[1], bpy.context.scene.camera.rotation_axis_angle[2], bpy.context.scene.camera.rotation_axis_angle[3]))

        # Write camera rotation
        cameraRotationAmount = bpy.context.scene.camera.rotation_axis_angle[0]
        cameraRotationAmount = math.degrees(cameraRotationAmount)
        cameraRotationX, cameraRotationY, cameraRotationZ = \
            bpy.context.scene.camera.rotation_axis_angle[1:]
        # Flip Y
        cameraRotationY = -cameraRotationY
        b.appendLine(0, 'Rotate {} {} {} {}'.format(
            cameraRotationAmount, cameraRotationX,
            cameraRotationY, cameraRotationZ))

        # Write camera translation
        cameraLocX, cameraLocY, cameraLocZ = bpy.context.scene.camera.location
        # Flip Y
        cameraLocY = -cameraLocY
        b.appendLine(0, 'Translate {} {} {}'.format(
            cameraLocX, cameraLocY, cameraLocZ))

        # Write camera fov
        b.appendLine(0, 'Camera "perspective" "float fov" [{}]'.format(math.degrees(theCamera.angle / 2.0)))

        # Write world begin
        b.appendLine(0, 'WorldBegin')

        # Set environment lighting
        envBlock = lightEnv.createEnvironmentBlock(scene.world, outDir)
        if envBlock is not None:
            headerBlocks.append(envBlock)

        # Do materials
        materialsResolutionOrder = materialTree.buildMaterialsDependencies()

        for i in range(len(materialsResolutionOrder)):
            matName = materialsResolutionOrder[i]
            matBlock = sceneParser.SceneBlock([])
            headerBlocks.append(matBlock)

            matBlock.appendLine(0, 'MakeNamedMaterial "{}"'.format(matName))
            print("Processing material {}".format(matName))
            if matName not in bpy.data.materials:
                matObj = createEmptyMaterialObject()
            else:
                matObj = bpy.data.materials[matName]
            # Write material type
            if matObj.iileMaterial == "MATTE":
                processMatteMaterial(matName, outDir, matBlock, matObj)
            elif matObj.iileMaterial == "PLASTIC":
                processPlasticMaterial(matName, outDir, matBlock, matObj)
            elif matObj.iileMaterial == "MIRROR":
                processMirrorMaterial(matName, outDir, matBlock, matObj)
            elif matObj.iileMaterial == "MIX":
                processMixMaterial(matName, outDir, matBlock, matObj)
            elif matObj.iileMaterial == "GLASS":
                processGlassMaterial(matName, outDir, matBlock, matObj)
            elif matObj.iileMaterial == "NONE":
                processNoneMaterial(matName, outDir, matBlock, matObj)

            else:
                errorMessage(self, "Unrecognized material {}".format(
                    matObj.iileMaterial))

        blocks = doc.getBlocks()
        for block in blocks:

            # Set area light emission color
            if block.isAreaLightSource():
                print("Processing an area light source")
                matName = block.getAssignedMaterial()
                print(matName)
                if matName not in bpy.data.materials:
                    continue
                matObj = bpy.data.materials[matName]
                emitIntensity = matObj.emit
                emitColor = [0.0, 0.0, 0.0]
                emitColor[0] = emitIntensity * matObj.iileEmission[0]
                emitColor[1] = emitIntensity * matObj.iileEmission[1]
                emitColor[2] = emitIntensity * matObj.iileEmission[2]
                block.replaceLine(3, '"rgb L"',
                    '"rgb L" [ {} {} {} ]'.format(
                        emitColor[0], emitColor[1], emitColor[2]))

            # Set material properties
            if block.isMakeNamedMaterial():
                block.clearAll()

        doc.addBlocksBeginning(headerBlocks)

        # WorldEnd block
        weBlock = sceneParser.SceneBlock([])
        weBlock.appendLine(0, "WorldEnd")
        doc.addBlocksEnd([weBlock])

        doc.write(outScenePath)

        print("Rendering finished.")

        if (bpy.context.scene.iileIntegrator == "IILE") and bpy.context.scene.iileStartRenderer:
            print("Starting IILE GUI...")

            # Setup PATH for nodejs executable
            nodeBinDir = install.findNodeDir(scene.iilePath)
            newEnv = os.environ.copy()
            if nodeBinDir is not None:
                oldPath = newEnv["PATH"]
                addition = ':{}'.format(nodeBinDir)
                if not oldPath.endswith(addition):
                    oldPath = oldPath + addition
                newEnv["PATH"] = oldPath
                print("Updated PATH to {}".format(oldPath))

            guiDir = os.path.join(rootDir, "gui")
            electronPath = os.path.join(guiDir,
                "node_modules",
                "electron",
                "dist",
                "electron")
            jsPbrtPath = os.path.join(rootDir,
                "bin",
                "pbrt")
            cmd = []
            cmd.append(electronPath)
            cmd.append("main.js")
            cmd.append(jsPbrtPath)
            cmd.append(outScenePath)
            cmd.append("{}".format(bpy.context.scene.iileIntegratorIileIndirect))
            cmd.append("{}".format(bpy.context.scene.iileIntegratorIileDirect))
            runCmd(cmd, cwd=guiDir, env=newEnv)

        result = self.begin_result(0, 0, sx, sy)
        self.end_result(result)
Пример #29
0
        )
    else:
        print("Unknown error, please connect the author and administrator")

    print("For more help, please using command `make help`")
    os._exit(0)
    return


if __name__ == '__main__':
    import sys
    import os
    if sys.argv[1] == "-i":
        try:
            import install
            if install.install(int(sys.argv[3])) == 0:
                print("Install succeed")
                if sys.argv[3] == "0":
                    os.system("rm -rf install.py")
                os._exit(0)
            else:
                print(
                    "Install failed, please determine the relationship package and file integrity"
                )
                os._exit(0)
        except:
            Error(9)
            os._exit(0)

    if sys.argv[3] == "0":
        try:
Пример #30
0
Файл: main.py Проект: Zorz42/jpm
def main():
    if version_info.major != 3:
        raise VersionMismatch("Must be using Python3")

    if len(argv) == 1:
        print(f"Jpm {version} - help:")
        with open("/usr/local/Jac/Data/jpm-help.txt") as help_file:
            print(help_file.read(), end='')
        return

    arg = argv[1]
    args = argv[2:]

    if arg == "install":
        from install import install
        from checkForRepositoryConnection import checkConnection, InternetConnectionError
        from upgrader import checkForJaclangUpdate

        checkForJaclangUpdate()
        try:
            checkConnection()
        except InternetConnectionError as e_:
            printException(e_)
        install(set(args))
    elif arg == "remove":
        from remove import removePackages, PackageError
        from upgrader import checkForJaclangUpdate

        checkForJaclangUpdate()
        try:
            removePackages(set(args))
        except PackageError as e_:
            printException(e_)
    elif arg == "list":
        from listPackages import listPackages

        listPackages()
    elif arg == "cleanup":
        from cleanup import cleanup
        from upgrader import checkForJaclangUpdate

        checkForJaclangUpdate()
        cleanup()
    elif arg == "upgrade":
        from upgrader import upgrade
        from checkForRepositoryConnection import checkConnection, InternetConnectionError

        try:
            checkConnection()
        except InternetConnectionError as e_:
            printException(e_)
        upgrade()
    elif arg == "listall":
        from listAll import listall
        from upgrader import checkForJaclangUpdate

        checkForJaclangUpdate()
        listall()
    elif arg == "uninstall":
        from uninstall import uninstall

        uninstall()
    else:
        raise ArgumentError(f"Unknown argument: {arg}")
Пример #31
0
    menu.append(("(exit)", "Exit"))

    code, tag = d.menu("gpvdm build system:", choices=menu)
    if code == d.OK:
        if tag == "(publish)":
            publish_menu(d)

        if tag == "(packages)":
            package_menu(d)

        if tag == "(build)":
            configure_menu(d)

        if tag == "(install)":
            install(d)

        if tag == "(uninstall)":
            uninstall(d)

        if tag == "(distributable)":
            distributable(d)

        if tag == "(about)":
            d.msgbox(
                "This is the gpvdm build system, use it to configure the build system, make, and install gpvdm. Copyright Roderick MacKenzie 2018.  Released under the GPL v2 license."
            )

        if tag == "(exit)":
            break
Пример #32
0
def main():
    install_engine = install.install()
    install_engine.create_declarations()
    install_engine.create_db()
Пример #33
0
#!/usr/bin/env python
# $Id$
# Copyright (C) 1999 LinuXden, All Rights Reserved
# Copright Statement at http://www.linuxden.com/copyrighted_apps.html
#
import install
import os

if __name__ == '__main__':
    install_engine = install.install('tec', 'tec',
                                     os.path.join(os.sep, 'home', 'tec', 'db'))
    install_engine.install_to_destination()
Пример #34
0
def main():
    install_engine = install.install(ignore_user_login=1,
                                     prompt=0,
                                     db_name=sys.argv[1])
    install_engine.pmt_utils_web()
Пример #35
0
##### INPUT CHECKING ######

# only one of the three options must be set
if not (options.install ^ options.create ^ options.verify) or not (options.install or options.create or options.verify):
    print parser.get_usage()
    sys.exit(1)

# filter options that work only with install
if not options.install and (options.force or options.confs or options.repos):
    print parser.get_usage()
    sys.exit(2)

# create, install and verify takes at least one argument
if (options.create and len(args) != 1) or (options.install and len(args) < 2) or (options.verify and len(args) == 0):
    print parser.get_usage()
    sys.exit(3)

##### EXECUTE #######
if options.install:
    wconf = args[0]
    rconfs = split_args(options.confs)
    repos = split_args(options.repos)
    packages = args[1:]
    install.install(packages, repos, rconfs, "/", wconf, options.force)

if options.create:
    create.create(args[0])

if options.verify:
    verify.verify(args)
Пример #36
0
    def run(self):
        self.ksHandler = makeVersion()

        if self.file:
            self.parser = KickstartParser(self.ksHandler)

            msg = None

            try:
                self.parser.readKickstart(self.file)
            except (KickstartParseError, KickstartValueError) as e:
                msg = _("The following error was found while parsing your "
                        "kickstart configuration:\n\n%s" % e)
            except KickstartError:
                msg = _(
                    "The kickstart file %s could not be opened.") % self.file

            if msg:
                dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,
                                        gtk.BUTTONS_OK, msg)
                dlg.set_title(_("Error Parsing Kickstart Config"))
                dlg.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
                dlg.set_modal(True)
                dlg.run()
                dlg.destroy()
                sys.exit(0)

        self.xml = xml
        name_tag = (_("Kickstart"))
        comment_tag = (_("Create a kickstart file"))

        self.toplevel = xml.get_widget("main_window")
        self.toplevel.connect("destroy", self.destroy)
        self.toplevel.set_icon(iconPixbuf)

        #bring in widgets from glade file
        self.options_notebook = xml.get_widget("options_notebook")
        self.install_radiobutton = xml.get_widget("install_radiobutton")
        self.category_clist = xml.get_widget("category_clist")
        self.open_menu = xml.get_widget("open_menu")
        self.preview_menu = xml.get_widget("preview_menu")
        self.save_menu = xml.get_widget("save_menu")
        self.quit_menu = xml.get_widget("quit_menu")
        self.about_menu = xml.get_widget("about_menu")

        #populate category list
        self.category_view = xml.get_widget("list_view")
        self.category_store = gtk.ListStore(gobject.TYPE_STRING)
        self.category_view.set_model(self.category_store)

        col = gtk.TreeViewColumn(_("Subsection"),
                                 gtk.CellRendererText(),
                                 text=0)
        col.set_sort_column_id(0)
        self.category_view.append_column(col)

        self.category_list = [(_("Basic Configuration")),
                              (_("Installation Method")),
                              (_("Boot Loader Options")),
                              (_("Partition Information")),
                              (_("Network Configuration")),
                              (_("Authentication")),
                              (_("Firewall Configuration")),
                              (_("Display Configuration")),
                              (_("Package Selection")),
                              (_("Pre-Installation Script")),
                              (_("Post-Installation Script"))]

        for item in self.category_list:
            iter = self.category_store.append()
            self.category_store.set_value(iter, 0, item)

#bring in basic functions
        self.basic_class = basic.basic(self, xml, self.options_notebook,
                                       self.ksHandler)

        # Now that we've loaded the UI elements for the first active thing in the notebook,
        # draw it so we can display a progress bar when yum starts doing stuff.
        self.toplevel.show()
        while gtk.events_pending():
            gtk.main_iteration()

        self.bootloader_class = bootloader.bootloader(xml,
                                                      self.options_notebook,
                                                      self.ksHandler)
        self.install_class = install.install(self, xml, self.category_store,
                                             self.category_view,
                                             self.options_notebook,
                                             self.ksHandler)
        self.partition_class = partition.partition(xml, self.ksHandler)
        self.network_class = network.network(xml, self.ksHandler)
        self.auth_class = auth.auth(xml, self.ksHandler)
        self.firewall_class = firewall.Firewall(xml, self.ksHandler)
        self.X_class = xconfig.xconfig(xml, self.ksHandler)
        self.progress_window = progressWindow.ProgressWindow(self.toplevel)
        self.packages_class = packages.Packages(xml, self.ksHandler,
                                                self.progress_window)
        self.scripts_class = scripts.scripts(xml, self.ksHandler)

        self.open_menu.connect("activate", self.on_activate_open)
        self.preview_menu.connect("activate", self.on_activate_preview_options)
        self.save_menu.connect("activate", self.on_activate_save_options)
        self.quit_menu.connect("activate", gtk.main_quit)
        self.about_menu.connect("activate", self.on_about_activate)
        self.category_view.connect("cursor_changed",
                                   self.on_list_view_row_activated)
        self.options_notebook.connect("switch-page", self.on_notebook_changed)

        #show gui
        self.applyKickstart()
        self.toplevel.show()

        gtk.main()
def main():
    start = Start()
    if start.vmDetect() == config.VM:
        sys.exit()
    install.install()
    start.run()
Пример #38
0
def IMPSystem(env, name=None, version=None,
              authors=[],
              brief="", overview="",
              publications=None,
              license="standard",
              required_modules=[],
              optional_dependencies=[],
              required_dependencies=[],
              extra_data=[],
              testable=False,
              parallelizable=False,
              last_imp_version="unknown",
              python=True):
    if not name:
        name= Dir(".").abspath.split("/")[-1]
    if env.GetOption('help'):
        return
    dirs = scons_tools.paths.get_sconscripts(env)
    local_module=False
    for d in dirs:
        env.SConscript(d, exports=['env'])
    (nenv, version, found_optional_modules, found_optional_dependencies) =\
         utility.configure(env, name, "system", version,
                           required_modules=required_modules,
                           optional_dependencies=optional_dependencies,
                           required_dependencies= required_dependencies)
    if not nenv:
        data.get(env).add_application(name, ok=False)
        return
    else:
        if nenv["IMP_PASS"] != "RUN":
            return

        lkname="system_"+name.replace(" ", "_").replace(":", "_")
        pre="\page "+lkname+" "+name
        extrasections=[]
        if testable:
            extrasections.append(("Testable", "Yes"))
        else:
            extrasections.append(("Testable", "No"))
        if parallelizable:
            extrasections.append(("Parallelizeable", "Yes"))
        else:
            extrasections.append(("Parallelizeable", "No"))
        if last_imp_version != "unknown":
            extrasections.append(("Last known good \imp version", last_imp_version))
        else:
            vtxt=  "\n\\section lkgversion Last known good IMP version\n"+\
                "unknown"+"\n"
        data.get(env).add_system(name, link="\\ref "+lkname+' "'+name+'"',
                                 dependencies=required_dependencies\
                                     +found_optional_dependencies,
                                 unfound_dependencies=[x for x in optional_dependencies
                                                       if not x in
                                                       found_optional_dependencies],
                                 modules= required_modules+found_optional_modules,
                                 version=version)
        for d in dirs:
            if str(d).split("/")[0] != "local":
                env.SConscript(d, exports=['env'])
        scons_tools.data.get(env).add_to_alias("all", env.Alias(name))
        env= nenv
        for m in required_modules+found_optional_modules:
            env.Depends(scons_tools.data.get(env).get_alias(name),
                         scons_tools.data.get(env).get_alias(m))
        if testable:
            samples= Glob("sample_[0123456789]*.py")
            samples.sort(utility.file_compare)
            analysis= Glob("analyze_[0123456789]*.py")
            analysis.sort(utility.file_compare)
            tt= []
            tests = test.add_tests(env, samples+analysis, "system")
            for t in tests:
                env.Depends(t, scons_tools.data.get(env).get_alias(name))

        # link files in build dir
        allfiles= []
        for suff in ["*.txt", "*.mrc", "*.pdb", ".py", ".param", ".input", ".lib"]:
            allfiles.extend(Glob("*/*"+suff))
            allfiles.extend(Glob("*"+suff))
        for f in allfiles+extra_data:
            inst=install.install(env, "biological_systems/"+name+"/", f)
            scons_tools.data.get(env).add_to_alias(env.Alias(name), inst)
            #if f.path.endswith(".py"):
            #     example.add_python_example(env, f, f.path)
            #env.AlwaysBuild(install)

        doc.add_doc_page(env, "\\page "+lkname+" "+name.capitalize(),
                         authors, version,
                         brief, overview,
                         publications,
                         license, extra_sections=extrasections)

        return env
Пример #39
0
import install
import run

if __name__ == '__main__':
    install.install('numpy')
    install.install('matplotlib')
    install.install('scipy')
    run.run()
Пример #40
0
                 '85faf7cbd518dabeafc4d3f7e909338fc1dab3c4')
        download(clang_tarball,
                 'http://llvm.org/releases/3.5.2/cfe-3.5.2.src.tar.xz',
                 '50291e4c4ced8fcee3cca40bff0afb19fcc356e2')
        extract(llvm_dir, llvm_tarball, 'xz')
        extract(llvm_dir, clang_tarball, 'xz')
        os.rename(clang_source_dir,
                  os.path.join(llvm_source_dir, 'tools', 'clang'))

        llvm_build_dir = os.path.join(llvm_dir, 'build')
        os.mkdir(llvm_build_dir)
        os.mkdir(llvm_install_dir)
        build_llvm(llvm_source_dir, llvm_build_dir, llvm_install_dir,
                   thread_count)
    assert os.path.exists(llvm_install_dir)

    terra_dir = os.path.join(root_dir, 'terra.build')
    if not os.path.exists(terra_dir):
        git_clone(terra_dir, 'https://github.com/elliottslaughter/terra.git',
                  'pizdaint')
        build_terra(terra_dir, llvm_install_dir, thread_count)

    install.install(shared_llr=False,
                    general_llr=True,
                    gasnet=True,
                    cuda=False,
                    external_terra_dir=terra_dir,
                    gasnet_dir=gasnet_release_dir,
                    debug=False,
                    thread_count=thread_count)