diff --git a/CMakeLists.txt b/CMakeLists.txt index 180cd7b7..01be74f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,6 +157,8 @@ endfunction() file(WRITE dictionaries_mapping.dic "") cat(${DYNAWO_HOME}/share/dictionaries_mapping.dic dictionaries_mapping.dic) cat_filter(${DYNAWO_ALGORITHMS_HOME}/share/dictionaries_mapping.dic dictionaries_mapping.dic "Algorithms") +file(APPEND dictionaries_mapping.dic "DFLLog = LOG\n") +file(APPEND dictionaries_mapping.dic "DFLError = ERROR\n") install(FILES dictionaries_mapping.dic DESTINATION ${CMAKE_INSTALL_PREFIX}/share/) # MPI (required by algorithms) diff --git a/scripts/dynaflow-launcher.sh b/scripts/dynaflow-launcher.sh index 49ee3d9c..af721a91 100755 --- a/scripts/dynaflow-launcher.sh +++ b/scripts/dynaflow-launcher.sh @@ -6,6 +6,18 @@ error_exit() { exit ${RETURN_CODE} } +export_var_env() { + local var=$@ + local name=${var%%=*} + local value=${var#*=} + + if eval "[ \$$name ]"; then + eval "value=\${$name}" + return + fi + export $name="$value" +} + export_preload() { lib="tcmalloc" # uncomment to activate tcmalloc in debug when build is in debug @@ -34,7 +46,7 @@ export DYNAWO_HOME=$INSTALL export DYNAWO_ALGORITHMS_HOME=$INSTALL export LD_LIBRARY_PATH=$INSTALL/lib64:$INSTALL/lib:$LD_LIBRARY_PATH export IIDM_XML_XSD_PATH=$DYNAWO_HOME/share/iidm/xsd -export DYNAFLOW_LAUNCHER_LOCALE=en_GB +export_var_env DYNAFLOW_LAUNCHER_LOCALE=en_GB export DYNAFLOW_LAUNCHER_INSTALL=$INSTALL export DYNAWO_RESOURCES_DIR=$DYNAWO_HOME/share:$DYNAWO_HOME/share/xsd export DYNAWO_DICTIONARIES=dictionaries_mapping diff --git a/sources/main.cpp b/sources/main.cpp index c36bed2c..28564bc1 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -41,7 +41,7 @@ static inline std::string getMandatoryEnvVar(const std::string &key) { static void initializeDynawo(const std::string &locale) { DYN::IoDicos &dicos = DYN::IoDicos::instance(); dicos.addPath(getMandatoryEnvVar("DYNAWO_RESOURCES_DIR")); - dicos.addDicos(getMandatoryEnvVar("DYNAWO_DICTIONARIES")); + dicos.addDicos(getMandatoryEnvVar("DYNAWO_DICTIONARIES"), locale); dicos.addDico("DFLLOG", "DFLLog", locale); dicos.addDico("DFLERROR", "DFLError", locale); }