From 85e7c2d5c9625437b1813d5a2428c57aa3ae9d52 Mon Sep 17 00:00:00 2001 From: bruno <97033386+bruno-at-orange@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:53:35 +0200 Subject: [PATCH] Generate wiews from dd files in cmake (#80) Add generates_gui module in CMake. Its purpose is to replace the files genereall.cmd This cmake function generates_gui is redrirected to a portable python script. This script calls the genere binary who produces *View.h/cpp starting from .dd files. The .dd files may be used in multiple projects. The genere_all.cmd were usually called in the .dd directory. generate_gui is called where the view .cpp/h files are used. In this way it exposes the dependency between the target library and the dd file. While the dd.log file can be considered as source file (the cmake projects depend on it for the genere_views command), we prefer not to track them on git. Pro is obviously that we don't clone/pull log files, cons is the sources and dd.log files may be not synchronized and may cause some issue int the generate_views process. --- .gitignore | 4 +- CMakeLists.txt | 7 +- CMakePresets.json | 1 + scripts/generate_gui.cmake | 84 +++++++++++++++++++ scripts/generate_gui.py | 31 +++++++ src/Learning/CMakeLists.txt | 4 +- src/Learning/KDDomainKnowledge/CMakeLists.txt | 9 ++ src/Learning/KWLearningProblem/CMakeLists.txt | 24 +++++- .../KWLearningProblem/KWAnalysisSpec.dd | 2 +- src/Learning/KWLearningProblem/genereall.cmd | 17 ---- src/Learning/KWModeling/CMakeLists.txt | 22 +++++ src/Learning/KWModeling/genereall.cmd | 11 --- src/Learning/KWUserInterface/CMakeLists.txt | 45 +++++++++- .../KWUserInterface/KWAttributeAxisName.dd | 3 - .../KWSTDatabaseTextFileFormat.dd | 4 - src/Learning/KWUserInterface/genereall.cmd | 55 ------------ src/Learning/MHHistograms/CMakeLists.txt | 10 ++- src/Learning/MHHistograms/genereall.cmd | 5 -- src/Learning/MODL_Coclustering/CMakeLists.txt | 21 ++++- src/Learning/MODL_Coclustering/genereall.cmd | 15 ---- src/Learning/genum/CMakeLists.txt | 12 ++- src/Learning/genum/genereall.cmd | 5 -- src/Learning/samples/sample1/CMakeLists.txt | 4 + src/Learning/samples/sample2/CMakeLists.txt | 4 + src/Learning/samples/sample3/CMakeLists.txt | 15 ++++ src/Learning/samples/sample3/genereall.cmd | 7 -- src/Norm/CMakeLists.txt | 3 + src/Norm/basetest/CMakeLists.txt | 13 ++- src/Norm/basetest/genereall.cmd | 3 - src/Norm/genere/genere.cpp | 3 +- src/Norm/generetest/CMakeLists.txt | 11 +++ src/Norm/generetest/genereall.cmd | 1 - src/Norm/samples/sample1/CMakeLists.txt | 4 + src/Norm/samples/sample1/main.cpp | 3 +- src/Norm/samples/sample2/CMakeLists.txt | 12 +++ src/Norm/samples/sample2/genereall.cmd | 3 - src/Norm/samples/sample3/CMakeLists.txt | 4 + src/Norm/samples/sample3/genereall.cmd | 5 -- src/Parallel/PLSamples/CMakeLists.txt | 9 +- src/Parallel/PLSamples/genereall.cmd | 3 - src/genere.cmd | 20 ----- 41 files changed, 343 insertions(+), 175 deletions(-) create mode 100644 scripts/generate_gui.cmake create mode 100644 scripts/generate_gui.py delete mode 100644 src/Learning/KWLearningProblem/genereall.cmd delete mode 100644 src/Learning/KWModeling/genereall.cmd delete mode 100644 src/Learning/KWUserInterface/KWAttributeAxisName.dd delete mode 100644 src/Learning/KWUserInterface/KWSTDatabaseTextFileFormat.dd delete mode 100644 src/Learning/KWUserInterface/genereall.cmd delete mode 100644 src/Learning/MHHistograms/genereall.cmd delete mode 100644 src/Learning/MODL_Coclustering/genereall.cmd delete mode 100644 src/Learning/genum/genereall.cmd create mode 100644 src/Learning/samples/sample1/CMakeLists.txt create mode 100644 src/Learning/samples/sample2/CMakeLists.txt create mode 100644 src/Learning/samples/sample3/CMakeLists.txt delete mode 100644 src/Learning/samples/sample3/genereall.cmd delete mode 100644 src/Norm/basetest/genereall.cmd delete mode 100644 src/Norm/generetest/genereall.cmd create mode 100644 src/Norm/samples/sample1/CMakeLists.txt create mode 100644 src/Norm/samples/sample2/CMakeLists.txt delete mode 100644 src/Norm/samples/sample2/genereall.cmd create mode 100644 src/Norm/samples/sample3/CMakeLists.txt delete mode 100644 src/Norm/samples/sample3/genereall.cmd delete mode 100644 src/Parallel/PLSamples/genereall.cmd delete mode 100644 src/genere.cmd diff --git a/.gitignore b/.gitignore index ff8f41f1d..93bb10bff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ .vs/ .vscode/ -# Log file using genere tool -genere.log +# Log file using genere tool and the cmake module genere-views +*.dd.log # CMake User Preset CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 45757fbc6..2f4923264 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,7 @@ option(MPI "Use MPI libraries (ON,OFF)" ON) option(TESTING "Build unit tests (ON,OFF)" OFF) option(BUILD_LEX_YACC "Re-generate parsing files with lex & yacc" OFF) option(BUILD_JARS "Re-generate norm.jar and khiops.jar" OFF) +option(GENERATE_VIEWS "Generate views sources from dd files" OFF) option(C11 "Build whith C++11 libraries (ON,OFF)" ON) # Print the options @@ -53,6 +54,7 @@ message(" TESTING=\"${TESTING}\"") message(" C11=\"${C11}\"") message(" BUILD_LEX_YACC=\"${BUILD_LEX_YACC}\"") message(" BUILD_JARS=\"${BUILD_JARS}\"") +message(" GENERATE_VIEWS=\"${GENERATE_VIEWS}\"") message("\n") # Check if the os is a linux fedora-like distro (CentOS, Rocky etc...) @@ -105,7 +107,7 @@ message(STATUS "Executables will be stored in ${CMAKE_BINARY_DIR}/bin/") message(STATUS "Libraries will be stored in ${CMAKE_BINARY_DIR}/lib/") # Set module path for the project -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/packaging") +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/packaging" ; "${CMAKE_CURRENT_SOURCE_DIR}/scripts") # Use "-fPIC" / "-fPIE" for all targets by default, including static libs set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -287,6 +289,9 @@ function(display_variables) endforeach() endfunction() +# Load module to generate views from .dd files +include(generate_gui) + # Add targets for Norm Parallel and Learning modules add_subdirectory(src/Norm) add_subdirectory(src/Parallel) diff --git a/CMakePresets.json b/CMakePresets.json index 5a7a9a7d7..5560440cb 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -16,6 +16,7 @@ "TESTING": "ON", "BUILD_JARS": "ON", "BUILD_LEX_YACC": "OFF", + "GENERATE_VIEWS": "OFF", "C11": "ON" }, "binaryDir": "${sourceDir}/build/${presetName}" diff --git a/scripts/generate_gui.cmake b/scripts/generate_gui.cmake new file mode 100644 index 000000000..30307b2cc --- /dev/null +++ b/scripts/generate_gui.cmake @@ -0,0 +1,84 @@ +# Launch genere binary +# cmake-format: off +# The funtion api is almost the same as genere: +# +# Genere [options] +# : base name for generated classes +# : label for generated classes +# : name of the file (.dd) containing the attribute specifications +# : name of the log file, it must be included in the source files of the binary/library +# +# Options: +# -nomodel no generation of class +# -noarrayview no generation of class ArrayView +# -noview no generation of classes View and ArrayView +# -nousersection no generation of user sections +# -specificmodel name of a specific model class, to use instead of ClassName +# -super name of the parent class +# +# Do nothing if GENERATE_VIEWS is set to OFF +# +# Example to use genere binary in CMakeLists.txt: +# +# include(genere) +# generate_gui_add_view(FOO "Foo Example" Foo.dd Foo.dd.log -noarrayview) +# add_executable(basetest Foo.cpp) +# if(GENERATE_VIEWS) +# target_sources(basetest PRIVATE Foo.dd.log) # Foo.dd.log is genereted by generate_gui_add_view +# endif() +# generate_gui_add_view_add_dependency(basetest) +# +# The log file Foo.dd.log is generated by generate_gui_add_view and must be added as a source of the target. +# Whithout it, generate_gui_add_view is never triggered. +# +# Note for developpers: we cannot set the h/cpp view files as output of add_custom_command because they are inputs +# and outputs. They would be removed at each clean. So we use the logs as output of add_custom_command and as +# source files of the binary/library target. This way we have the desired mechanic: The views are generated +# only when GENERATE_VIEWS=ON and a .dd file was modified. +# +# cmake-format: on + +function(generate_gui_add_view ClassName ClassLabel AttributeFileName LogFile) + + if(GENERATE_VIEWS) + find_package(Python REQUIRED) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${LogFile} + COMMAND + ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/ generate_gui_add_view.py + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genere ${ARGN} ${ClassName} ${ClassLabel} ${AttributeFileName} ${LogFile} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + DEPENDS ${AttributeFileName} + MAIN_DEPENDENCY ${AttributeFileName} + COMMENT "Generating ${AttributeFileName} views") + endif() +endfunction() + +# Create dependency between the target parameter and the genere binary. This function should be used with +# generate_gui_add_view to ensure that: +# +# - genere is built before the target +# - the target is re-built if genere is modified +# +# Do nothing if GENERATE_VIEWS is set to OFF +function(generate_gui_add_view_add_dependency target) + if(GENERATE_VIEWS) + add_dependencies(${target} genere) + endif() +endfunction() + +# Helper function: it builds the list of the .dd.log files starting from the .dd file in the source directory. The list +# is empty if GENERATE_VIEWS is set to OFF. +function(generate_gui_add_view_get_log_list OutVariable) + if(GENERATE_VIEWS) + file( + GLOB ddlogfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.dd) + list(TRANSFORM ddlogfiles APPEND ".log") + set(${OutVariable} + ${ddlogfiles} + PARENT_SCOPE) + endif() +endfunction() diff --git a/scripts/generate_gui.py b/scripts/generate_gui.py new file mode 100644 index 000000000..693f4d491 --- /dev/null +++ b/scripts/generate_gui.py @@ -0,0 +1,31 @@ +import sys +import os +from subprocess import Popen, PIPE + + +# script called from generate_gui_add_view.cmake +# The argument is the command line to launch genere, for example: +# /bin//genere -outputdir /khiops/src/Learning/KWLearningProblem KWAnalysisSpec Parameters \ +# KWAnalysisSpec.dd KWAnalysisSpec.dd.log +# The command line is executed as it is and the stdout is redirect to the log file (last element of the command line). +# The content of the log is displayed to stdout +# If the command fails, the log file is removed and it exits with an error +def main(): + args = sys.argv[1:] + log_path = args[-1] + with open(log_path, "w") as log_file: + process = Popen(args[:-1], stdout=log_file) + process.wait() + log_file.close() + with open(log_path, "r") as log_file: + for line in log_file: + print("genere: " + line.strip()) + if process.returncode != 0: + os.remove(log_path) + exit(1) + else: + exit(0) + + +if __name__ == "__main__": + main() diff --git a/src/Learning/CMakeLists.txt b/src/Learning/CMakeLists.txt index 9cb566e7d..15281aad7 100644 --- a/src/Learning/CMakeLists.txt +++ b/src/Learning/CMakeLists.txt @@ -1,14 +1,11 @@ add_subdirectory(DTForest) add_subdirectory(genum) add_subdirectory(khisto) - add_subdirectory(KDDomainKnowledge) add_subdirectory(KhiopsNativeInterface) add_subdirectory(KIInterpretation) - add_subdirectory(KMDRRuleLibrary) add_subdirectory(KNITransfer) - add_subdirectory(KWData) add_subdirectory(KWDataPreparation) add_subdirectory(KWDataUtils) @@ -21,6 +18,7 @@ add_subdirectory(MHHistograms) add_subdirectory(MODL) add_subdirectory(MODL_Coclustering) add_subdirectory(SNBPredictor) +add_subdirectory(samples/sample3) # build norm.jar if(BUILD_JARS) diff --git a/src/Learning/KDDomainKnowledge/CMakeLists.txt b/src/Learning/KDDomainKnowledge/CMakeLists.txt index bfbc57303..9e2878239 100644 --- a/src/Learning/KDDomainKnowledge/CMakeLists.txt +++ b/src/Learning/KDDomainKnowledge/CMakeLists.txt @@ -1,7 +1,16 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) add_library(KDDomainKnowledge STATIC "${cppfiles}") +if(GENERATE_VIEWS) + target_sources(KDDomainKnowledge PRIVATE KDTextFeatureSpec.dd.log) +endif() + set_khiops_options(KDDomainKnowledge) target_include_directories(KDDomainKnowledge PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(KDDomainKnowledge PUBLIC KWDataPreparation) + +generate_gui_add_view(KDTextFeatureSpec "Text feature parameters" ../KWUserInterface/KDTextFeatureSpec.dd + KDTextFeatureSpec.dd.log -noview) + +generate_gui_add_view_add_dependency(KDDomainKnowledge) diff --git a/src/Learning/KWLearningProblem/CMakeLists.txt b/src/Learning/KWLearningProblem/CMakeLists.txt index 4e159fd2a..2934e6bc7 100644 --- a/src/Learning/KWLearningProblem/CMakeLists.txt +++ b/src/Learning/KWLearningProblem/CMakeLists.txt @@ -4,7 +4,9 @@ if(NOT MSVC) endif(NOT MSVC) file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -add_library(KWLearningProblem STATIC "${cppfiles}") +generate_gui_add_view_get_log_list(ddlogfiles) + +add_library(KWLearningProblem STATIC "${cppfiles}" "${ddlogfiles}") set_khiops_options(KWLearningProblem) target_include_directories(KWLearningProblem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) @@ -18,3 +20,23 @@ target_link_libraries( KWUserInterface SNBPredictor MHHistograms) + +# cmake-format: off + +# Generate cpp files from dd file + +# On ne genere que la partie modele, la partie vue etant uniquement composee de deux sous-fiches + generate_gui_add_view(KWModelingSpec "Predictors" KWModelingSpec.dd KWModelingSpec.dd.log -noview -noarrayview) + +# On ne genere la partie vue uniquement pour deux vues distinct sur le modele + generate_gui_add_view(KWModelingAdvancedSpec "Advanced predictor parameters" KWModelingAdvancedSpec.dd KWModelingAdvancedSpec.dd.log -nomodel -noarrayview -specificmodel KWModelingSpec) + generate_gui_add_view(KWModelingExpertSpec "Expert predictor parameters" KWModelingExpertSpec.dd KWModelingExpertSpec.dd.log -nomodel -noarrayview -specificmodel KWModelingSpec) + generate_gui_add_view(KWAnalysisSpec "Parameters" KWAnalysisSpec.dd KWAnalysisSpec.dd.log -noarrayview) + generate_gui_add_view(KWRecoderSpec "Recoders" KWRecoderSpec.dd KWRecoderSpec.dd.log -noarrayview) + +# remarque: tous les champs de choix de noms de fichiers sont exclus de la vue (Invisible a true dans le fichier .dd) + generate_gui_add_view(KWAnalysisResults "Results" KWAnalysisResults.dd KWAnalysisResults.dd.log -noarrayview) + +# Add dependency to ensure that genere will be built before the gui generation + generate_gui_add_view_add_dependency(KWLearningProblem) +# cmake-format: on diff --git a/src/Learning/KWLearningProblem/KWAnalysisSpec.dd b/src/Learning/KWLearningProblem/KWAnalysisSpec.dd index a800db5a8..4338ebc92 100644 --- a/src/Learning/KWLearningProblem/KWAnalysisSpec.dd +++ b/src/Learning/KWLearningProblem/KWAnalysisSpec.dd @@ -1,3 +1,3 @@ Rank;Name;Type;Style;Label 1;TargetAttributeName ;ALString; ;Target variable -2;MainTargetModality ;ALString; ;Main target value +2;MainTargetModality ;ALString; ;Main target value \ No newline at end of file diff --git a/src/Learning/KWLearningProblem/genereall.cmd b/src/Learning/KWLearningProblem/genereall.cmd deleted file mode 100644 index 2b2ee6e78..000000000 --- a/src/Learning/KWLearningProblem/genereall.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@echo off - -echo. > genere.log - -rem On ne call ..\..\genere que la partie modele, la partie vue etant uniquement composee de deux sous-fiches -call ..\..\genere -noview -noarrayview KWModelingSpec "Predictors" KWModelingSpec.dd >> genere.log - -rem On call ..\..\genere la partie vue uniquement pour deux vues distinct sur le modele -call ..\..\genere -nomodel -noarrayview -specificmodel KWModelingSpec KWModelingAdvancedSpec "Advanced predictor parameters" KWModelingAdvancedSpec.dd >> genere.log -call ..\..\genere -nomodel -noarrayview -specificmodel KWModelingSpec KWModelingExpertSpec "Expert predictor parameters" KWModelingExpertSpec.dd >> genere.log - -call ..\..\genere -noarrayview KWAnalysisSpec "Parameters" KWAnalysisSpec.dd >> genere.log - -call ..\..\genere -noarrayview KWRecoderSpec "Recoders" KWRecoderSpec.dd >> genere.log - -rem remarque: tous les champs de choix de noms de fichiers sont exclus de la vue (Invisible à true dans le fichier .dd) -call ..\..\genere -noarrayview KWAnalysisResults "Results" KWAnalysisResults.dd >> genere.log diff --git a/src/Learning/KWModeling/CMakeLists.txt b/src/Learning/KWModeling/CMakeLists.txt index 6b90cd902..689d7dcdd 100644 --- a/src/Learning/KWModeling/CMakeLists.txt +++ b/src/Learning/KWModeling/CMakeLists.txt @@ -1,6 +1,28 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +generate_gui_add_view_get_log_list(ddlogfiles) + add_library(KWModeling STATIC "${cppfiles}") + +if(GENERATE_VIEWS) + target_sources(KWModeling PRIVATE "${ddlogfiles}" KWRecodingSpec.dd.log) +endif() + set_khiops_options(KWModeling) target_include_directories(KWModeling PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(KWModeling PUBLIC KDDomainKnowledge KWDataPreparation) + +# Generate cpp files from dd file +# cmake-format: off + +# La partie vue est geree dans la librairie KWUserInterface + generate_gui_add_view(KWTrainParameters "Train parameters" KWTrainParameters.dd KWTrainParameters.dd.log -noview) + +# La partie vue est geree dans la librairie KWUserInterface + generate_gui_add_view(KWSelectionParameters "Selection parameters" KWSelectionParameters.dd KWSelectionParameters.dd.log -noview) + generate_gui_add_view(KWRecodingSpec "Recoding parameters" ../KWUserInterface/KWRecodingSpec.dd KWRecodingSpec.dd.log -noview) + +# cmake-format: on + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(KWModeling) diff --git a/src/Learning/KWModeling/genereall.cmd b/src/Learning/KWModeling/genereall.cmd deleted file mode 100644 index a547cb19d..000000000 --- a/src/Learning/KWModeling/genereall.cmd +++ /dev/null @@ -1,11 +0,0 @@ -@echo off - -echo. > genere.log - -rem La partie vue est geree dans la librairie KWUserInterface -call ..\..\genere -noview KWTrainParameters "Train parameters" KWTrainParameters.dd >> genere.log -call ..\..\genere -outputdir ..\KWUserInterface -nomodel -noarrayview KWTrainParameters "Train parameters" KWTrainParameters.dd >> genere.log - -rem La partie vue est geree dans la librairie KWUserInterface -call ..\..\genere -noview KWSelectionParameters "Selection parameters" KWSelectionParameters.dd >> genere.log -call ..\..\genere -outputdir ..\KWUserInterface -nomodel -noarrayview KWSelectionParameters "Selection parameters" KWSelectionParameters.dd >> genere.log diff --git a/src/Learning/KWUserInterface/CMakeLists.txt b/src/Learning/KWUserInterface/CMakeLists.txt index d6aefa75c..f3dced537 100644 --- a/src/Learning/KWUserInterface/CMakeLists.txt +++ b/src/Learning/KWUserInterface/CMakeLists.txt @@ -1,7 +1,50 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +generate_gui_add_view_get_log_list(ddlogfiles) + add_library(KWUserInterface STATIC "${cppfiles}") +if(GENERATE_VIEWS) + target_sources(KWUserInterface PRIVATE "${ddlogfiles}" KWSelectionParameters.dd.log KWTrainParameters.dd.log) +endif() set_khiops_options(KWUserInterface) target_include_directories(KWUserInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(KWUserInterface PUBLIC KDDomainKnowledge KWDataPreparation KWModeling MHHistograms) + +# Generate cpp files from dd file + +# Dans la plus cas, on ne genere que les classe de type vue, les classe de type modele etant geree par ailleur +# cmake-format: off + generate_gui_add_view(KWDatabase "Database" KWDatabase.dd KWDatabase.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWDatabaseSampling "Sampling" KWDatabaseSampling.dd KWDatabaseSampling.dd.log -nomodel -noarrayview -specificmodel KWDatabase) + generate_gui_add_view(KWDatabaseSelection "Selection" KWDatabaseSelection.dd KWDatabaseSelection.dd.log -nomodel -noarrayview -specificmodel KWDatabase) + generate_gui_add_view(KWSTDatabaseTextFileData "Data" KWSTDatabaseTextFileData.dd KWSTDatabaseTextFileData.dd.log -nomodel -noarrayview -specificmodel KWSTDatabaseTextFile) + generate_gui_add_view(KWMTDatabaseTextFileData "Data" KWMTDatabaseTextFileData.dd KWMTDatabaseTextFileData.dd.log -nomodel -noarrayview -specificmodel KWMTDatabaseTextFile) + generate_gui_add_view(KWMTDatabaseMapping "Multi-table mapping" KWMTDatabaseMapping.dd KWMTDatabaseMapping.dd.log -nomodel) + generate_gui_add_view(KWClassSpec "Dictionary" KWClassSpec.dd KWClassSpec.dd.log) + generate_gui_add_view(KWAttributeSpec "Variable" KWAttributeSpec.dd KWAttributeSpec.dd.log) + generate_gui_add_view(KWAttributeName "Variable" KWAttributeName.dd KWAttributeName.dd.log -nomodel) + generate_gui_add_view(KWAttributePairName "Variable pair" KWAttributePairName.dd KWAttributePairName.dd.log -nomodel) + generate_gui_add_view(KWEvaluatedPredictorSpec "Evaluated predictor" KWEvaluatedPredictorSpec.dd KWEvaluatedPredictorSpec.dd.log) + generate_gui_add_view(KWPreprocessingSpec "Preprocessing parameters" KWPreprocessingSpec.dd KWPreprocessingSpec.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWPreprocessingAdvancedSpec "Unsupervised parameters" KWPreprocessingAdvancedSpec.dd KWPreprocessingAdvancedSpec.dd.log -nomodel -noarrayview -specificmodel KWPreprocessingSpec) + generate_gui_add_view(KWDataGridOptimizerParameters "Data Grid optimization" KWDataGridOptimizerParameters.dd KWDataGridOptimizerParameters.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWBenchmarkSpec "Benchmark" KWBenchmarkSpec.dd KWBenchmarkSpec.dd.log -nomodel) + generate_gui_add_view(KWLearningBenchmark "Learning benchmark" KWLearningBenchmark.dd KWLearningBenchmark.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWBenchmarkClassSpec "Benchmark dictionary" KWBenchmarkClassSpec.dd KWBenchmarkClassSpec.dd.log -nomodel -noarrayview) + +# La partie modele est geree dans la librairie KWModeling + generate_gui_add_view(KWRecodingSpec "Recoding parameters" KWRecodingSpec.dd KWRecodingSpec.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWAttributePairsSpec "Variable pairs parameters" KWAttributePairsSpec.dd KWAttributePairsSpec.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWAttributeConstructionSpec "Feature engineering parameters" KWAttributeConstructionSpec.dd KWAttributeConstructionSpec.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWSelectionParameters "Selection parameters" ../KWModeling/KWSelectionParameters.dd KWSelectionParameters.dd.log -nomodel -noarrayview) + generate_gui_add_view(KWTrainParameters "Train parameters" ../KWModeling/KWTrainParameters.dd KWTrainParameters.dd.log -nomodel -noarrayview) + +# La partie modele est geree dans la librairie KDDomainKnowledge + generate_gui_add_view(KDTextFeatureSpec "Text feature parameters" KDTextFeatureSpec.dd KDTextFeatureSpec.dd.log -nomodel -noarrayview) + generate_gui_add_view(KDConstructionDomain "Variable construction parameters" KDConstructionDomain.dd KDConstructionDomain.dd.log -nomodel -noarrayview) + generate_gui_add_view(KDConstructionRule "Construction rule" KDConstructionRule.dd KDConstructionRule.dd.log -nomodel) + +# cmake-format: on + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(KWUserInterface) diff --git a/src/Learning/KWUserInterface/KWAttributeAxisName.dd b/src/Learning/KWUserInterface/KWAttributeAxisName.dd deleted file mode 100644 index 6f63ca4fc..000000000 --- a/src/Learning/KWUserInterface/KWAttributeAxisName.dd +++ /dev/null @@ -1,3 +0,0 @@ -Rank;Name;Type;Style;Label -1;AttributeName ;ALString; ;Attribute name -2;OwnerAttributeName ;ALString; ;Owner attribute name diff --git a/src/Learning/KWUserInterface/KWSTDatabaseTextFileFormat.dd b/src/Learning/KWUserInterface/KWSTDatabaseTextFileFormat.dd deleted file mode 100644 index 4b85a8726..000000000 --- a/src/Learning/KWUserInterface/KWSTDatabaseTextFileFormat.dd +++ /dev/null @@ -1,4 +0,0 @@ -Rank;Name;Type;Style;Label -1;DatabaseName ;ALString;FileChooser;Data table file -2;HeaderLineUsed ;boolean ;CheckBox;Header line used -3;FieldSeparator ;char ; ;Field separator diff --git a/src/Learning/KWUserInterface/genereall.cmd b/src/Learning/KWUserInterface/genereall.cmd deleted file mode 100644 index 82276ef41..000000000 --- a/src/Learning/KWUserInterface/genereall.cmd +++ /dev/null @@ -1,55 +0,0 @@ -@echo off - -echo. > genere.log - -rem Dans la plus cas, on ne call ..\..\genere que les classe de type vue, les classe de type modele etant geree par ailleur - -call ..\..\genere -nomodel -noarrayview KWDatabase "Database" KWDatabase.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview -specificmodel KWDatabase KWDatabaseSampling "Sampling" KWDatabaseSampling.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview -specificmodel KWDatabase KWDatabaseSelection "Selection" KWDatabaseSelection.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview -specificmodel KWSTDatabaseTextFile KWSTDatabaseTextFileData "Data" KWSTDatabaseTextFileData.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview -specificmodel KWMTDatabaseTextFile KWMTDatabaseTextFileData "Data" KWMTDatabaseTextFileData.dd >> genere.log - -call ..\..\genere -nomodel KWMTDatabaseMapping "Multi-table mapping" KWMTDatabaseMapping.dd >> genere.log - -call ..\..\genere KWClassSpec "Dictionary" KWClassSpec.dd >> genere.log - -call ..\..\genere KWAttributeSpec "Variable" KWAttributeSpec.dd >> genere.log - -call ..\..\genere -nomodel KWAttributeName "Variable" KWAttributeName.dd >> genere.log - -call ..\..\genere -nomodel KWAttributePairName "Variable pair" KWAttributePairName.dd >> genere.log - -call ..\..\genere KWEvaluatedPredictorSpec "Evaluated predictor" KWEvaluatedPredictorSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KWPreprocessingSpec "Preprocessing parameters" KWPreprocessingSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview -specificmodel KWPreprocessingSpec KWPreprocessingAdvancedSpec "Unsupervised parameters" KWPreprocessingAdvancedSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KWDataGridOptimizerParameters "Data Grid optimization" KWDataGridOptimizerParameters.dd >> genere.log - -call ..\..\genere -nomodel KWBenchmarkSpec "Benchmark" KWBenchmarkSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KWLearningBenchmark "Learning benchmark" KWLearningBenchmark.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KWBenchmarkClassSpec "Benchmark dictionary" KWBenchmarkClassSpec.dd >> genere.log - -rem La partie modele est geree dans la librairie KWModeling -call ..\..\genere -outputdir ..\KWModeling -noview KWRecodingSpec "Recoding parameters" KWRecodingSpec.dd >> genere.log -call ..\..\genere -nomodel -noarrayview KWRecodingSpec "Recoding parameters" KWRecodingSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KWAttributePairsSpec "Variable pairs parameters" KWAttributePairsSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KWAttributeConstructionSpec "Feature engineering parameters" KWAttributeConstructionSpec.dd >> genere.log - -rem La partie modele est geree dans la librairie KDDomainKnowledge -call ..\..\genere -outputdir ..\KDDomainKnowledge -noview KDTextFeatureSpec "Text feature parameters" KDTextFeatureSpec.dd >> genere.log -call ..\..\genere -nomodel -noarrayview KDTextFeatureSpec "Text feature parameters" KDTextFeatureSpec.dd >> genere.log - -call ..\..\genere -nomodel -noarrayview KDConstructionDomain "Variable construction parameters" KDConstructionDomain.dd >> genere.log - -call ..\..\genere -nomodel KDConstructionRule "Construction rule" KDConstructionRule.dd >> genere.log diff --git a/src/Learning/MHHistograms/CMakeLists.txt b/src/Learning/MHHistograms/CMakeLists.txt index 74f4db474..9b005c4b4 100644 --- a/src/Learning/MHHistograms/CMakeLists.txt +++ b/src/Learning/MHHistograms/CMakeLists.txt @@ -1,6 +1,14 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -add_library(MHHistograms STATIC ${cppfiles}) +generate_gui_add_view_get_log_list(ddlogfiles) +add_library(MHHistograms STATIC ${cppfiles} ${ddlogfiles}) + set_khiops_options(MHHistograms) target_include_directories(MHHistograms PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(MHHistograms KWData KWDataPreparation KWUtils) + +# Generate cpp files from dd file +generate_gui_add_view(MHHistogramSpec "Histogram parameters" MHHistogramSpec.dd MHHistogramSpec.dd.log -noarrayview) + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(MHHistograms) diff --git a/src/Learning/MHHistograms/genereall.cmd b/src/Learning/MHHistograms/genereall.cmd deleted file mode 100644 index 08b958952..000000000 --- a/src/Learning/MHHistograms/genereall.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off - -echo. > genere.log - -call ..\..\genere -noarrayview MHHistogramSpec "Histogram parameters" MHHistogramSpec.dd >> genere.log diff --git a/src/Learning/MODL_Coclustering/CMakeLists.txt b/src/Learning/MODL_Coclustering/CMakeLists.txt index f002447ef..d173d5a3e 100644 --- a/src/Learning/MODL_Coclustering/CMakeLists.txt +++ b/src/Learning/MODL_Coclustering/CMakeLists.txt @@ -1,7 +1,8 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +generate_gui_add_view_get_log_list(ddlogfiles) # on fedora, binaries built with mpi must ended by _mpich suffix -add_executable(MODL_Coclustering${MPI_SUFFIX} ${cppfiles} MODL_Coclustering.rc) +add_executable(MODL_Coclustering${MPI_SUFFIX} ${cppfiles} ${ddlogfiles}) set_khiops_options(MODL_Coclustering${MPI_SUFFIX}) target_link_libraries(MODL_Coclustering${MPI_SUFFIX} PUBLIC KWLearningProblem DTForest KMDRRuleLibrary) @@ -10,11 +11,25 @@ if(MSVC) target_link_options(MODL_Coclustering${MPI_SUFFIX} PUBLIC "/INCREMENTAL") endif() -add_library(MODL_Coclustering_SO SHARED ${cppfiles}) -target_link_libraries(MODL_Coclustering_SO PUBLIC KMDRRuleLibrary DTForest KWLearningProblem) +add_library(MODL_Coclustering_SO SHARED ${cppfiles} ${ddlogfiles}) + +target_link_libraries(MODL_Coclustering_SO PUBLIC KWLearningProblem DTForest KMDRRuleLibrary PLParallelTask) set_target_properties( MODL_Coclustering_SO PROPERTIES PUBLIC_HEADER MODL_Coclustering_dll.h SOVERSION ${PROJECT_VERSION_MAJOR} VERSION ${PROJECT_VERSION}) set_khiops_options(MODL_Coclustering_SO) + +# Generate cpp files from dd file +# cmake-format: off + generate_gui_add_view(CCVarPartCoclusteringSpec "Instances Variables coclustering parameters" CCVarPartCoclusteringSpec.dd CCVarPartCoclusteringSpec.dd.log -noarrayview) + generate_gui_add_view(CCCoclusteringSpec "Coclustering parameters" CCCoclusteringSpec.dd CCCoclusteringSpec.dd.log -noarrayview) + generate_gui_add_view(CCPostProcessingSpec "Simplification parameters" CCPostProcessingSpec.dd CCPostProcessingSpec.dd.log -noarrayview) + generate_gui_add_view(CCPostProcessedAttribute "Coclustering variable" CCPostProcessedAttribute.dd CCPostProcessedAttribute.dd.log) + generate_gui_add_view(CCDeploymentSpec "Deployment parameters" CCDeploymentSpec.dd CCDeploymentSpec.dd.log -noarrayview) + generate_gui_add_view(CCAnalysisResults "Results" CCAnalysisResults.dd CCAnalysisResults.dd.log -noarrayview) +# cmake-format: on + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(MODL_Coclustering${MPI_SUFFIX}) diff --git a/src/Learning/MODL_Coclustering/genereall.cmd b/src/Learning/MODL_Coclustering/genereall.cmd deleted file mode 100644 index d94809d08..000000000 --- a/src/Learning/MODL_Coclustering/genereall.cmd +++ /dev/null @@ -1,15 +0,0 @@ -@echo off - -echo. > genere.log - -call ..\..\genere -noarrayview CCVarPartCoclusteringSpec "Instances Variables coclustering parameters" CCVarPartCoclusteringSpec.dd >> genere.log - -call ..\..\genere -noarrayview CCCoclusteringSpec "Coclustering parameters" CCCoclusteringSpec.dd >> genere.log - -call ..\..\genere -noarrayview CCPostProcessingSpec "Simplification parameters" CCPostProcessingSpec.dd >> genere.log - -call ..\..\genere CCPostProcessedAttribute "Coclustering variable" CCPostProcessedAttribute.dd >> genere.log - -call ..\..\genere -noarrayview CCDeploymentSpec "Deployment parameters" CCDeploymentSpec.dd >> genere.log - -call ..\..\genere -noarrayview CCAnalysisResults "Results" CCAnalysisResults.dd >> genere.log diff --git a/src/Learning/genum/CMakeLists.txt b/src/Learning/genum/CMakeLists.txt index 177128abc..3fb3e4a9c 100644 --- a/src/Learning/genum/CMakeLists.txt +++ b/src/Learning/genum/CMakeLists.txt @@ -1,4 +1,14 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -add_executable(genum ${cppfiles} genum.rc) + +generate_gui_add_view_get_log_list(ddlogfiles) +add_executable(genum ${cppfiles} ${ddlogfiles} genum.rc) set_khiops_options(genum) target_link_libraries(genum PUBLIC MHHistograms) + +# Generate cpp files from dd file +# cmake-format: off + generate_gui_add_view(MHGenumHistogramSpec "Histogram parameters" MHGenumHistogramSpec.dd MHGenumHistogramSpec.dd.log -noview -noarrayview -super MHHistogramSpec) +# cmake-format: on + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(genum) diff --git a/src/Learning/genum/genereall.cmd b/src/Learning/genum/genereall.cmd deleted file mode 100644 index ea2d5b58d..000000000 --- a/src/Learning/genum/genereall.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off - -echo. > genere.log - -call ..\..\genere -noview -noarrayview -super MHHistogramSpec MHGenumHistogramSpec "Histogram parameters" MHGenumHistogramSpec.dd >> genere.log diff --git a/src/Learning/samples/sample1/CMakeLists.txt b/src/Learning/samples/sample1/CMakeLists.txt new file mode 100644 index 000000000..88e233ede --- /dev/null +++ b/src/Learning/samples/sample1/CMakeLists.txt @@ -0,0 +1,4 @@ +file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_executable(learning_sample1 ${cppfiles}) +set_khiops_options(learning_sample1) +target_link_libraries(learning_sample1 PUBLIC KWLearningProblem) diff --git a/src/Learning/samples/sample2/CMakeLists.txt b/src/Learning/samples/sample2/CMakeLists.txt new file mode 100644 index 000000000..8050e151f --- /dev/null +++ b/src/Learning/samples/sample2/CMakeLists.txt @@ -0,0 +1,4 @@ +file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_executable(learning_sample2 ${cppfiles}) +set_khiops_options(learning_sample2) +target_link_libraries(learning_sample2 PUBLIC KWLearningProblem) diff --git a/src/Learning/samples/sample3/CMakeLists.txt b/src/Learning/samples/sample3/CMakeLists.txt new file mode 100644 index 000000000..816fe7a7d --- /dev/null +++ b/src/Learning/samples/sample3/CMakeLists.txt @@ -0,0 +1,15 @@ +file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +generate_gui_add_view_get_log_list(ddlogfiles) + +add_executable(learning_sample3 ${cppfiles} ${ddlogfiles}) +set_khiops_options(learning_sample3) +target_link_libraries(learning_sample3 PUBLIC KWLearningProblem) + +# Generate cpp files from dd file +# cmake-format: off + generate_gui_add_view(MYModelingSpec "Modeling parameters" MYModelingSpec.dd MYModelingSpec.dd.log -super KWModelingSpec -noarrayview) + generate_gui_add_view(MYAnalysisResults "Analysis results" MYAnalysisResults.dd MYAnalysisResults.dd.log -super KWAnalysisResults -noarrayview) +# cmake-format: on + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(learning_sample3) diff --git a/src/Learning/samples/sample3/genereall.cmd b/src/Learning/samples/sample3/genereall.cmd deleted file mode 100644 index a39878610..000000000 --- a/src/Learning/samples/sample3/genereall.cmd +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -echo. > genere.log - -call ..\..\..\genere -super KWModelingSpec -noarrayview MYModelingSpec "Modeling parameters" MYModelingSpec.dd >> genere.log - -call ..\..\..\genere -super KWAnalysisResults -noarrayview MYAnalysisResults "Analysis results" MYAnalysisResults.dd >> genere.log diff --git a/src/Norm/CMakeLists.txt b/src/Norm/CMakeLists.txt index 7b29fc5d6..ee8e2ad0a 100644 --- a/src/Norm/CMakeLists.txt +++ b/src/Norm/CMakeLists.txt @@ -6,6 +6,9 @@ add_subdirectory(genere) add_subdirectory(basetest) add_subdirectory(generetest) +add_subdirectory(samples/sample1) +add_subdirectory(samples/sample2) +add_subdirectory(samples/sample3) # build norm.jar if(BUILD_JARS) diff --git a/src/Norm/basetest/CMakeLists.txt b/src/Norm/basetest/CMakeLists.txt index d50b807ca..6c3c876e5 100644 --- a/src/Norm/basetest/CMakeLists.txt +++ b/src/Norm/basetest/CMakeLists.txt @@ -3,7 +3,18 @@ if(NOT MSVC) set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS -fexceptions) endif(NOT MSVC) file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +generate_gui_add_view_get_log_list(ddlogfiles) -add_executable(basetest ${cppfiles}) +add_executable(basetest ${cppfiles} ${ddlogfiles}) set_khiops_options(basetest) target_link_libraries(basetest PUBLIC base) + +# Generate cpp files from dd file +# cmake-format: off + generate_gui_add_view(UITestObject "Test object" UITestObject.dd UITestObject.dd.log -noarrayview) + generate_gui_add_view(UITestSubObject "Test sub-object" UITestSubObject.dd UITestSubObject.dd.log -noarrayview) + generate_gui_add_view(UITestActionSubObject "Test sub-object with action" UITestActionSubObject.dd UITestActionSubObject.dd.log -noarrayview) +# cmake-format: on + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(basetest) diff --git a/src/Norm/basetest/genereall.cmd b/src/Norm/basetest/genereall.cmd deleted file mode 100644 index 509012fc0..000000000 --- a/src/Norm/basetest/genereall.cmd +++ /dev/null @@ -1,3 +0,0 @@ -call ..\..\genere -noarrayview UITestObject "Test object" UITestObject.dd > genere.log -call ..\..\genere -noarrayview UITestSubObject "Test sub-object" UITestSubObject.dd >> genere.log -call ..\..\genere -noarrayview UITestActionSubObject "Test sub-object with action" UITestActionSubObject.dd >> genere.log diff --git a/src/Norm/genere/genere.cpp b/src/Norm/genere/genere.cpp index 764401281..52879d71d 100644 --- a/src/Norm/genere/genere.cpp +++ b/src/Norm/genere/genere.cpp @@ -100,7 +100,8 @@ int Genere(int argc, char** argv) sClassName = argv[argc - 3]; sClassUserLabel = argv[argc - 2]; sAttributeFileName = argv[argc - 1]; - cout << "Genere " << sClassName << " " << sClassUserLabel << " " << sAttributeFileName << endl; + cout << "Genere " << sClassName << " \"" << sClassUserLabel << "\" " << sAttributeFileName + << endl; tgTest.GenereWith(sClassName, sSpecificModelClassName, sSuperClassName, sClassUserLabel, sAttributeFileName); cout << endl; diff --git a/src/Norm/generetest/CMakeLists.txt b/src/Norm/generetest/CMakeLists.txt index d889d00d9..4ef691ca8 100644 --- a/src/Norm/generetest/CMakeLists.txt +++ b/src/Norm/generetest/CMakeLists.txt @@ -1,5 +1,16 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +generate_gui_add_view_get_log_list(ddlogfiles) add_executable(generetest ${cppfiles}) +if(GENERATE_VIEWS) + target_sources(generetest PRIVATE ${ddlogfiles}) +endif() + set_khiops_options(generetest) target_link_libraries(generetest PUBLIC base) + +# Generate cpp files from dd file +generate_gui_add_view(Sample "Sample" sample.dd sample.dd.log) + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(generetest) diff --git a/src/Norm/generetest/genereall.cmd b/src/Norm/generetest/genereall.cmd deleted file mode 100644 index 32e86bf9c..000000000 --- a/src/Norm/generetest/genereall.cmd +++ /dev/null @@ -1 +0,0 @@ -call ..\..\genere Sample Sample Sample.dd > genere.log diff --git a/src/Norm/samples/sample1/CMakeLists.txt b/src/Norm/samples/sample1/CMakeLists.txt new file mode 100644 index 000000000..a221a5a5b --- /dev/null +++ b/src/Norm/samples/sample1/CMakeLists.txt @@ -0,0 +1,4 @@ +file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_executable(norm_sample1 ${cppfiles}) +set_khiops_options(norm_sample1) +target_link_libraries(norm_sample1 PUBLIC base) diff --git a/src/Norm/samples/sample1/main.cpp b/src/Norm/samples/sample1/main.cpp index 2210d4660..5687634bd 100644 --- a/src/Norm/samples/sample1/main.cpp +++ b/src/Norm/samples/sample1/main.cpp @@ -4,7 +4,8 @@ #include "main.h" -void main() +int main() { cout << "Hello" << endl; + return 0; } diff --git a/src/Norm/samples/sample2/CMakeLists.txt b/src/Norm/samples/sample2/CMakeLists.txt new file mode 100644 index 000000000..67a18d1cd --- /dev/null +++ b/src/Norm/samples/sample2/CMakeLists.txt @@ -0,0 +1,12 @@ +file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + +generate_gui_add_view_get_log_list(ddlogfiles) +add_executable(norm_sample2 ${cppfiles} ${ddlogfiles}) +set_khiops_options(norm_sample2) +target_link_libraries(norm_sample2 PUBLIC base) + +# Generate cpp files from dd file +generate_gui_add_view(PRWorker "Employe" PRWorker.dd PRWorker.dd.log -noarrayview) + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(norm_sample2) diff --git a/src/Norm/samples/sample2/genereall.cmd b/src/Norm/samples/sample2/genereall.cmd deleted file mode 100644 index 1d673cc85..000000000 --- a/src/Norm/samples/sample2/genereall.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -call ..\..\..\genere -noarrayview PRWorker "Employe" PRWorker.dd > genere.log diff --git a/src/Norm/samples/sample3/CMakeLists.txt b/src/Norm/samples/sample3/CMakeLists.txt new file mode 100644 index 000000000..02cca98ab --- /dev/null +++ b/src/Norm/samples/sample3/CMakeLists.txt @@ -0,0 +1,4 @@ +file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_executable(norm_sample3 ${cppfiles}) +set_khiops_options(norm_sample3) +target_link_libraries(norm_sample3 PUBLIC base) diff --git a/src/Norm/samples/sample3/genereall.cmd b/src/Norm/samples/sample3/genereall.cmd deleted file mode 100644 index b5bae5a56..000000000 --- a/src/Norm/samples/sample3/genereall.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off - -call ..\..\..\genere -noarrayview PRWorker "Employe" PRWorker.dd > genere.log -call ..\..\..\genere PRChild "Enfant" PRChild.dd >> genere.log -call ..\..\..\genere -noarrayview PRAddress "Adresse" PRAddress.dd >> genere.log diff --git a/src/Parallel/PLSamples/CMakeLists.txt b/src/Parallel/PLSamples/CMakeLists.txt index 7f870a584..e205bddd0 100644 --- a/src/Parallel/PLSamples/CMakeLists.txt +++ b/src/Parallel/PLSamples/CMakeLists.txt @@ -1,8 +1,15 @@ file(GLOB cppfiles ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -add_library(PLSamples STATIC ${cppfiles}) +generate_gui_add_view_get_log_list(ddlogfiles) +add_library(PLSamples STATIC ${cppfiles} ${ddlogfiles}) # Set common build options set_khiops_options(PLSamples) target_include_directories(PLSamples PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(PLSamples PUBLIC PLParallelTask) + +# Generate cpp files from dd file +generate_gui_add_view(PEPi "Pi parallel computation" PEPi.dd PEPi.dd.log -noarrayview) + +# Add dependency to ensure that genere will be built before the gui generation +generate_gui_add_view_add_dependency(PLSamples) diff --git a/src/Parallel/PLSamples/genereall.cmd b/src/Parallel/PLSamples/genereall.cmd deleted file mode 100644 index ff551d25f..000000000 --- a/src/Parallel/PLSamples/genereall.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -call ..\..\genere -noarrayview PEPi "Pi parallel computation" PEPi.dd > genere.log diff --git a/src/genere.cmd b/src/genere.cmd deleted file mode 100644 index 7f0b1e6d4..000000000 --- a/src/genere.cmd +++ /dev/null @@ -1,20 +0,0 @@ -@echo off -setlocal -REM Access to genere tool from all genereall.cmd files in the src tree -REM Allow to get to the last available compiled version of genere - -REM This solution is temporary, waiting for a more professional solution using makefiles to genere source code from .dd files. - -REM Search genere tool in release binaries -if exist %~dp0..\build\windows-msvc-release\bin\genere.exe goto GENERE -goto ERROR - -:GENERE -%~dp0..\build\windows-msvc-release\bin\genere %* -goto END - -:ERROR -echo Error : genere tool not found among binaries in build directory - -:END -endlocal \ No newline at end of file