From fbed320e83835b58f52a71c5d979178f54ed4920 Mon Sep 17 00:00:00 2001 From: Thomas Applencourt Date: Wed, 10 Jun 2015 18:16:29 +0200 Subject: [PATCH] Working ninja --- COMPILE_RUN.md | 11 ++++------ scripts/compilation/qp_create_ninja.py | 28 ++++++++++++-------------- src/Hartree_Fock/EZFIO.cfg | 5 +++++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/COMPILE_RUN.md b/COMPILE_RUN.md index 4f97e72e..9b4263e7 100644 --- a/COMPILE_RUN.md +++ b/COMPILE_RUN.md @@ -12,7 +12,8 @@ The script to create the dependency file (aka `build.ninja`) is * If you only want the binaries (for production workflow) use the flag `--production` in when calling this script. It's quicker * Else if you are a developer and you want to be able to compile specific - modules use: `--development` + modules use: `--development`. It will create for you the `build.ninja` in each + module ## Compilation Flags @@ -23,12 +24,7 @@ used. You can edit these files to modify the compiling options. ## Example to create the Ninja file -`qp_create_ninja.py --production $QP_ROOT/config/ifort.cfg` - -# WARNING - -For now you need to execute this command if you add a `irp.f` or `EZFIO.cfg` -file or modify the `NEED_CHILDREN_MODULE`! +`qp_create_ninja.py create --production $QP_ROOT/config/ifort.cfg` ## Compiling @@ -37,5 +33,6 @@ elsewhere). The compilation will take approximately 3 min. If you have set the `--developement` flag in a specific module you can go in the corresponding module directory and run `ninja` to build only this module. +You can type `ninja all` in a module for compiling all the submodule Finally, go in `$QP_ROOT/ocaml` and type `make` diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index e780939c..a7ccbb47 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -247,11 +247,7 @@ def ninja_ezfio_build(l_ezfio_config, l_util): l_ezfio_from_cfg = [i.ez_config.abs for i in l_util.itervalues()] str_ = " ".join(l_ezfio_config + l_ezfio_from_cfg) - - ezfio_make_config = join(QP_ROOT_EZFIO, "make.config") - l_string = ["build {0} {1}: build_ezfio {2}".format(EZFIO_LIB, - ezfio_make_config, - str_), ""] + l_string = ["build {0}: build_ezfio {1}".format(EZFIO_LIB, str_), ""] return l_string @@ -381,8 +377,7 @@ def ninja_irpf90_make_rule(): # c m d # # ~#~#~ # - l_cmd = ["cd $module", "rm -rf IRPF90_temp IRPF90_man" - ] + l_flag + ["irpf90 $include_dir $IRPF90_FLAGS"] + l_cmd = ["cd $module"] + l_flag + ["irpf90 $include_dir $IRPF90_FLAGS"] # ~#~#~#~#~#~ # # s t r i n g # @@ -559,7 +554,7 @@ def ninja_binaries_rule(): # c m d # # ~#~#~ # - l_cmd = ["cd $module/IRPF90_temp", "ninja $out"] + l_cmd = ["cd $module/IRPF90_temp", "ninja $out && touch $out"] # ~#~#~#~#~#~ # # s t r i n g # @@ -653,15 +648,18 @@ def ninja_dot_tree_build(path_module): def create_ninja_module(path_module): path_ninja_root = join(QP_ROOT, "build.ninja") - l_string = [ - "rule update_ninja_common", " command = qp_create_ninja.py update", - "", "rule make_local_binaries", - " command = ninja -f {0} module_{1}".format(path_ninja_root, - path_module.rel), "" - ] + l_string = ["rule update_ninja_common", + " command = qp_create_ninja.py update", ""] + + l_string += ["rule make_local_binaries", + " command = ninja -j 1 -f {0} module_{1}".format( + path_ninja_root, path_module.rel), + " description = Compile only {0}".format(path_module.rel), + ""] l_string += ["rule make_all_binaries", - " command = ninja -f {0}".format(path_ninja_root), ""] + " command = ninja -j 1 -f {0}".format(path_ninja_root), + " description = Compile all the module", ""] l_string += ["build dumy_target: update_ninja_common", "", "build all: make_all_binaries dumy_target", "", diff --git a/src/Hartree_Fock/EZFIO.cfg b/src/Hartree_Fock/EZFIO.cfg index e2b0ea5a..6410df46 100644 --- a/src/Hartree_Fock/EZFIO.cfg +++ b/src/Hartree_Fock/EZFIO.cfg @@ -20,3 +20,8 @@ default: Huckel type: double precision doc: Calculated HF energy interface: output + +[energy_sdfsdf] +type: double precision +doc: Calculated HF energy +interface: output