From 493a9e7c0386b3b3c37a1c0ead605bd5f835e853 Mon Sep 17 00:00:00 2001 From: navarrop Date: Wed, 10 Feb 2010 12:50:17 +0000 Subject: [PATCH] Supernovae mode with cmake. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7074 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- buildtools/CPACK/src/CMakeMakeExeLib.txt | 10 ++-- buildtools/CPACK/src/CMakeOption.txt | 1 + buildtools/CPACK/src/CMakePrintArgs.txt | 1 + buildtools/CPACK/src/CMakeSupernovae.txt | 65 ++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 buildtools/CPACK/src/CMakeSupernovae.txt diff --git a/buildtools/CPACK/src/CMakeMakeExeLib.txt b/buildtools/CPACK/src/CMakeMakeExeLib.txt index eac42f1098..6117a6e458 100644 --- a/buildtools/CPACK/src/CMakeMakeExeLib.txt +++ b/buildtools/CPACK/src/CMakeMakeExeLib.txt @@ -2,9 +2,13 @@ include(${PROJECT_DIRECTORY}/CPACK/src/CMakeFLEXml.txt) -add_library(simgrid SHARED ${simgrid_sources}) -add_library(gras SHARED ${gras_sources}) -add_library(smpi SHARED ${SMPI_SRC}) +if(supernovae) + include(${PROJECT_DIRECTORY}/CPACK/src/CMakeSupernovae.txt) +else(supernovae) + add_library(simgrid SHARED ${simgrid_sources}) + add_library(gras SHARED ${gras_sources}) + add_library(smpi SHARED ${SMPI_SRC}) +endif(supernovae) set(GRAS_DEP "pthread") set(SIMGRID_DEP "") diff --git a/buildtools/CPACK/src/CMakeOption.txt b/buildtools/CPACK/src/CMakeOption.txt index 87e415cbb8..32e970ac4f 100644 --- a/buildtools/CPACK/src/CMakeOption.txt +++ b/buildtools/CPACK/src/CMakeOption.txt @@ -10,6 +10,7 @@ option(init "Set ON for make _*.c with gras_stub_generator" OFF) option(MAINTAINER_MODE "Permit to make flex and flexml files." OFF) +option(supernovae "Supernovae mode." OFF) option(disable_java "This variable set the java context." ON) option(disable_gtnets "This variable set the gtnets context." ON) option(disable_context "This variable set the context." ON) diff --git a/buildtools/CPACK/src/CMakePrintArgs.txt b/buildtools/CPACK/src/CMakePrintArgs.txt index d34db93ff4..de14587ec1 100644 --- a/buildtools/CPACK/src/CMakePrintArgs.txt +++ b/buildtools/CPACK/src/CMakePrintArgs.txt @@ -1,5 +1,6 @@ message("\n________ARGS_________") message("init ${init}") +message("supernovae ${supernovae}") message("MAINTAINER_MODE ${MAINTAINER_MODE}") message("disable_java ${disable_java}") message("disable_lua ${disable_lua}") diff --git a/buildtools/CPACK/src/CMakeSupernovae.txt b/buildtools/CPACK/src/CMakeSupernovae.txt new file mode 100644 index 0000000000..b46187ce84 --- /dev/null +++ b/buildtools/CPACK/src/CMakeSupernovae.txt @@ -0,0 +1,65 @@ +### Make supernovae files and libs + +set(simgrid_fragile_sources +${PROJECT_DIRECTORY}/src/gras/DataDesc/ddt_parse.yy.c +${PROJECT_DIRECTORY}/src/surf/surfxml_parse.c +${PROJECT_DIRECTORY}/src/xbt/graphxml_parse.c +${PROJECT_DIRECTORY}/src/simdag/sd_daxloader.c +) +set(gras_fragile_sources +${PROJECT_DIRECTORY}/src/gras/DataDesc/ddt_parse.yy.c +${PROJECT_DIRECTORY}/src/xbt/graphxml_parse.c +) +set(temp_src_smpi "") +set(temp_src_simgrid "") +set(temp_src_gras "") + +foreach(file ${SMPI_SRC}) +set(temp_src_smpi "${temp_src_smpi} ${file}") +endforeach(file ${SMPI_SRC}) + +foreach(file ${simgrid_sources}) + set(en_plus yes) + foreach(file_delete ${simgrid_fragile_sources}) + if(file_delete MATCHES "${file}") + set(en_plus no) + #message("${file}") + endif(file_delete MATCHES "${file}") + endforeach (file_delete ${simgrid_fragile_sources}) + if(en_plus) + if(file MATCHES "/home/navarrop/Bureau/simgrid-trunk/src/xbt/log.c") + set(file "xbt/log.c") + endif(file MATCHES "/home/navarrop/Bureau/simgrid-trunk/src/xbt/log.c") + set(temp_src_simgrid "${temp_src_simgrid} ${file}") + endif(en_plus) +endforeach(file ${simgrid_sources}) + +foreach(file ${gras_sources}) + set(en_plus yes) + foreach(file_delete ${gras_fragile_sources}) + if(file_delete MATCHES "${file}") + set(en_plus no) + #message("${file}") + endif(file_delete MATCHES "${file}") + endforeach (file_delete ${gras_fragile_sources}) + if(en_plus) + if(file MATCHES "/home/navarrop/Bureau/simgrid-trunk/src/xbt/log.c") + set(file "xbt/log.c") + endif(file MATCHES "/home/navarrop/Bureau/simgrid-trunk/src/xbt/log.c") + set(temp_src_gras "${temp_src_gras} ${file}") + endif(en_plus) +endforeach(file ${gras_sources}) + +#message("simgrid : \n${temp_src_simgrid}") +#message("gras : \n${temp_src_gras}") +#message("smpi : \n${temp_src_smpi}") + +exec_program("rm ${PROJECT_DIRECTORY}/src/supernovae_sg.c ${PROJECT_DIRECTORY}/src/supernovae_gras.c ${PROJECT_DIRECTORY}/src/supernovae_smpi.c"OUTPUT_VARIABLE "SUPER_OK") + +exec_program("${PROJECT_DIRECTORY}/src/mk_supernovae.sh ${PROJECT_DIRECTORY}/src/supernovae_sg.c ${temp_src_simgrid}" OUTPUT_VARIABLE "SUPER_OK") +exec_program("${PROJECT_DIRECTORY}/src/mk_supernovae.sh ${PROJECT_DIRECTORY}/src/supernovae_gras.c ${temp_src_gras}" OUTPUT_VARIABLE "SUPER_OK") +exec_program("${PROJECT_DIRECTORY}/src/mk_supernovae.sh ${PROJECT_DIRECTORY}/src/supernovae_smpi.c ${temp_src_smpi}" OUTPUT_VARIABLE "SUPER_OK") + +add_library(simgrid SHARED ${PROJECT_DIRECTORY}/src/supernovae_sg.c ${simgrid_fragile_sources}) +add_library(gras SHARED ${PROJECT_DIRECTORY}/src/supernovae_gras.c ${gras_fragile_sources}) +add_library(smpi SHARED ${PROJECT_DIRECTORY}/src/supernovae_smpi.c) -- 2.20.1