From ce868eab0a57961cc83cf52caf5571ed17a3188a Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 6 Feb 2023 17:58:43 +0100 Subject: [PATCH] Added possible LIB file --- scripts/compilation/qp_create_ninja | 30 +++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/scripts/compilation/qp_create_ninja b/scripts/compilation/qp_create_ninja index c0ba8c6a..aad85778 100755 --- a/scripts/compilation/qp_create_ninja +++ b/scripts/compilation/qp_create_ninja @@ -99,9 +99,20 @@ def ninja_create_env_variable(pwd_config_file): l_string = ["builddir = {0}".format(os.path.dirname(ROOT_BUILD_NINJA)), ""] + for flag in ["FC", "FCFLAGS", "IRPF90", "IRPF90_FLAGS"]: str_ = "{0} = {1}".format(flag, get_compilation_option(pwd_config_file, flag)) + for directory in [real_join(QP_SRC, m) for m in sorted(os.listdir(QP_SRC))]: + includefile = real_join(directory, flag) + try: + content = "" + with open(includefile,'r') as f: + content = f.read() + str_ += " "+content + except IOError: + pass + l_string.append(str_) lib_lapack = get_compilation_option(pwd_config_file, "LAPACK_LIB") @@ -110,17 +121,20 @@ def ninja_create_env_variable(pwd_config_file): str_lib = " ".join([lib_lapack, EZFIO_LIB, ZMQ_LIB, LIB, lib_usr]) # Read all LIB files in modules - libfile = "LIB" - try: - content = "" - with open(libfile,'r') as f: - content = f.read() - str_lib += " "+content - except IOError: - pass + for directory in [real_join(QP_SRC, m) for m in sorted(os.listdir(QP_SRC))]: + libfile = real_join(directory, "LIB") + try: + content = "" + with open(libfile,'r') as f: + content = f.read().replace('\n','') + str_lib += " "+content + except IOError: + pass l_string.append("LIB = {0} ".format(str_lib)) + + l_string.append("CONFIG_FILE = {0}".format(pwd_config_file)) l_string.append("") return l_string