From dbbe9da571bf7b147bb6750a011f89f91296773f Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Wed, 17 Jun 2015 19:00:31 +0200 Subject: [PATCH] First travis module --- .travis.yml | 1 + plugins/Hartree_Fock/Hartree_Fock | 1 - scripts/compilation/qp_create_ninja.py | 7 ++- scripts/module/qp_install_module.py | 64 ++++++++++++++++---------- 4 files changed, 44 insertions(+), 29 deletions(-) delete mode 120000 plugins/Hartree_Fock/Hartree_Fock diff --git a/.travis.yml b/.travis.yml index 0e5f92ea..2ec605ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ before_script: script: - ./configure --production ./config/gfortran.cfg - source ./quantum_package.rc + - qp_install_module.py install Full_CI Hartree_Fock - ninja - cd ocaml ; make ; cd - - cd testing_no_regression ; ./unit_test.py diff --git a/plugins/Hartree_Fock/Hartree_Fock b/plugins/Hartree_Fock/Hartree_Fock deleted file mode 120000 index ca3fae3a..00000000 --- a/plugins/Hartree_Fock/Hartree_Fock +++ /dev/null @@ -1 +0,0 @@ -/home/razoa/quantum_package/bulk/Hartree_Fock \ No newline at end of file diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index ac6f009d..cd0e3d8f 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -517,7 +517,7 @@ def get_binaries(path_module): return [] elif "No such file or directory" not in stdout: l_bin = [i.replace(".irp.f", "", 1) for i in stdout.split()] - return [Path(bin_, os.path.basename(bin_)) for bin_ in l_bin] + return [Path(os.path.realpath(bin_), os.path.basename(bin_)) for bin_ in l_bin] else: return [] @@ -540,7 +540,6 @@ def get_dict_binaries(l_module, mode="production"): # Ake module => binaries generated for module in l_module: l_binaries = get_binaries(module) - if l_binaries: d_binaries[module] += l_binaries @@ -561,8 +560,8 @@ def get_dict_binaries(l_module, mode="production"): l_binaries = [] for binaries in d_binaries[module]: - p_abs = join(QP_ROOT_SRC, root_module.rel, module.rel, - binaries.rel) + p_abs = real_join(QP_ROOT_SRC, root_module.rel) + p_abs = join(p_abs, module.rel, binaries.rel) p_rel = binaries.rel p = Path(p_abs, p_rel) l_binaries.append(p) diff --git a/scripts/module/qp_install_module.py b/scripts/module/qp_install_module.py index 03dbd350..8e9f149c 100755 --- a/scripts/module/qp_install_module.py +++ b/scripts/module/qp_install_module.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ -Usage: qp_install_module.py list [--installed|--avalaible-local|--avalaible-remote] - qp_install_module.py install -n +Usage: qp_install_module.py list (--installed|--avalaible-local|--avalaible-remote) + qp_install_module.py install ... qp_install_module.py create -n [...] qp_install_module.py download -n [...] @@ -64,18 +64,19 @@ if __name__ == '__main__': if arguments["--installed"]: l_repository = [qp_root_src] + if arguments["--avalaible-local"]: + l_repository = [qp_root_plugin] m_instance = ModuleHandler(l_repository) for module in m_instance.l_module: - print module + print "* {0}".format(module) elif arguments["create"]: - m_instance = ModuleHandler(l_repository) + m_instance = ModuleHandler([qp_root_src]) l_children = arguments[""] - qp_root = os.environ['QP_ROOT'] path = os.path.join(qp_root_src, arguments[""]) print "You will create the module:" @@ -100,33 +101,48 @@ if __name__ == '__main__': save_new_module(path, l_child_reduce) elif arguments["download"]: - - d_local = get_dict_child([qp_root_src]) - d_remote = get_dict_child(arguments[""]) - - d_child = d_local.copy() - d_child.update(d_remote) - - name = arguments[""] - l_module_descendant = get_l_module_descendant(d_child, [name]) - - for module in l_module_descendant: - if module not in d_local: - print "you need to install", module + pass +# d_local = get_dict_child([qp_root_src]) +# d_remote = get_dict_child(arguments[""]) +# +# d_child = d_local.copy() +# d_child.update(d_remote) +# +# name = arguments[""] +# l_module_descendant = get_l_module_descendant(d_child, [name]) +# +# for module in l_module_descendant: +# if module not in d_local: +# print "you need to install", module elif arguments["install"]: d_local = get_dict_child([qp_root_src]) - d_plugin = get_dict_child([qp_root_plugin]) d_child = d_local.copy() d_child.update(d_plugin) - name = arguments[""] - l_module_descendant = get_l_module_descendant(d_child, [name]) + l_name = arguments[""] - module_to_cp = [module for module in l_module_descendant if module not in d_local] + for name in l_name: + if name in d_local: + print "{0} Is already installed".format(name) - print "For ln -s by hand the module" - print module_to_cp + l_module_descendant = get_l_module_descendant(d_child, l_name) + + l_module_to_cp = [module for module in l_module_descendant if module not in d_local] + + if l_module_to_cp: + + print "You will need all these modules" + print l_module_to_cp + + print "Installation...", + + for module_to_cp in l_module_to_cp: + src = os.path.join(qp_root_plugin, module_to_cp) + des = os.path.join(qp_root_src, module_to_cp) + os.symlink(src, des) + print "Done" + print "You can now compile as usual"