Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to compile in supernovae mode when requested to
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 20 Nov 2009 09:47:29 +0000 (09:47 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 20 Nov 2009 09:47:29 +0000 (09:47 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6843 48e7efb5-ca39-0410-a469-dd3cf9ba447f

configure.ac
src/Makefile.am
src/mk_supernovae.sh [new file with mode: 0755]

index e843281..6b92886 100644 (file)
@@ -483,6 +483,7 @@ AC_CONFIG_FILES([
     for file in                                                 \
      tools/graspe-slave           tools/graspe-master           \
      checkall                     examples/java/runtest         \
     for file in                                                 \
      tools/graspe-slave           tools/graspe-master           \
      checkall                     examples/java/runtest         \
+     src/mk_supernovae.sh                                       \
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
     ; do                                                        \
       test -e $file && chmod +x $file;                          \
     done
index a1545d4..9f9b261 100644 (file)
@@ -68,6 +68,7 @@ EXTRA_DIST= \
        simdag/dax.dtd \
        \
        gras/DataDesc/ddt_parse.yy.l \
        simdag/dax.dtd \
        \
        gras/DataDesc/ddt_parse.yy.l \
+        gras/DataDesc/ddt_parse.yy.h \
        gras/Virtu/virtu_rl.h \
        gras/Virtu/virtu_sg.h \
        gras/Virtu/virtu_interface.h \
        gras/Virtu/virtu_rl.h \
        gras/Virtu/virtu_sg.h \
        gras/Virtu/virtu_interface.h \
@@ -278,7 +279,7 @@ GRAS_COMMON_SRC= \
   gras/DataDesc/ddt_convert.c         gras/DataDesc/ddt_exchange.c     \
   gras/DataDesc/cbps.c                gras/DataDesc/datadesc.c         \
   gras/DataDesc/datadesc_interface.h  gras/DataDesc/datadesc_private.h \
   gras/DataDesc/ddt_convert.c         gras/DataDesc/ddt_exchange.c     \
   gras/DataDesc/cbps.c                gras/DataDesc/datadesc.c         \
   gras/DataDesc/datadesc_interface.h  gras/DataDesc/datadesc_private.h \
-  gras/DataDesc/ddt_parse.c           gras/DataDesc/ddt_parse.yy.c         gras/DataDesc/ddt_parse.yy.h
+  gras/DataDesc/ddt_parse.c           gras/DataDesc/ddt_parse.yy.c
 
 GRAS_RL_SRC= \
   gras/rl_stubs.c                     xbt/xbt_os_thread.c                    \
 
 GRAS_RL_SRC= \
   gras/rl_stubs.c                     xbt/xbt_os_thread.c                    \
@@ -326,12 +327,14 @@ endif
 
 lib_LTLIBRARIES= libsimgrid.la libgras.la libsmpi.la
 
 
 lib_LTLIBRARIES= libsimgrid.la libgras.la libsmpi.la
 
-libgras_la_SOURCES=  $(XBT_SRC) $(GRAS_COMMON_SRC) $(GRAS_RL_SRC) $(AMOK_SRC)
+gras_sources=$(XBT_SRC) $(GRAS_COMMON_SRC) $(GRAS_RL_SRC) $(AMOK_SRC)
+simgrid_sources=$(XBT_SRC) $(SURF_SRC) $(GTNETS_USED) \
+                $(SIMIX_SRC) $(MSG_SRC) $(SIMDAG_SRC) \
+               $(GRAS_COMMON_SRC) $(GRAS_SG_SRC) $(AMOK_SRC)
+
+
 libgras_la_LDFLAGS = -no-undefined $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm 
 
 libgras_la_LDFLAGS = -no-undefined $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm 
 
-libsimgrid_la_SOURCES = $(XBT_SRC) $(SURF_SRC) $(GTNETS_USED) \
-                        $(SIMIX_SRC) $(MSG_SRC) $(SIMDAG_SRC) \
-                       $(GRAS_COMMON_SRC) $(GRAS_SG_SRC) $(AMOK_SRC)
 libsimgrid_la_LDFLAGS = -no-undefined $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_FLAGS@ -lm
 # -Wl,--entry -Wl,simgrid_version
 
 libsimgrid_la_LDFLAGS = -no-undefined $(VERSION_INFO) @SIMGRID_DEP@ @LD_DYNAMIC_FLAGS@ -lm
 # -Wl,--entry -Wl,simgrid_version
 
@@ -355,7 +358,7 @@ endif
 EXTRA_DIST+=$(JMSG_JAVA_SRC)
 
 if HAVE_JAVA
 EXTRA_DIST+=$(JMSG_JAVA_SRC)
 
 if HAVE_JAVA
-libsimgrid_la_SOURCES += $(JMSG_C_SRC) # add the binding support to the library
+simgrid_sources += $(JMSG_C_SRC) # add the binding support to the library
 
 clean-local:
        -rm -rf .classes simgrid.jar
 
 clean-local:
        -rm -rf .classes simgrid.jar
@@ -373,6 +376,29 @@ else
 EXTRA_DIST+=$(JMSG_C_SRC) $(JMSG_JAVA_SRC) $(MSG_SRC)
 endif
 
 EXTRA_DIST+=$(JMSG_C_SRC) $(JMSG_JAVA_SRC) $(MSG_SRC)
 endif
 
+##
+## Compile the libs
+CLEANFILES=
+if SUPERNOVAE_MODE
+  
+simgrid_fragile_sources=gras/DataDesc/ddt_parse.yy.c surf/surfxml_parse.c xbt/graphxml_parse.c simdag/sd_daxloader.c
+gras_fragile_sources=gras/DataDesc/ddt_parse.yy.c xbt/graphxml_parse.c
+
+supernovae_sg.c: Makefile.am
+       ./mk_supernovae.sh supernovae_sg.c $(filter-out $(simgrid_fragile_sources),$(simgrid_sources))
+supernovae_gras.c: Makefile.am
+       ./mk_supernovae.sh supernovae_gras.c $(filter-out $(gras_fragile_sources),$(gras_sources))
+supernovae_smpi.c: Makefile.am
+       ./mk_supernovae.sh supernovae_smpi.c $(filter-out $(smpi_fragile_sources),$(smpi_sources))
+CLEANFILES+=supernovae_sg.c supernovae_gras.c supernovae_smpi.c
+
+libsimgrid_la_SOURCES = supernovae_sg.c $(simgrid_fragile_sources)
+libgras_la_SOURCES = supernovae_gras.c $(gras_fragile_sources)
+else
+libsimgrid_la_SOURCES = $(simgrid_sources)
+libgras_la_SOURCES=$(gras_sources)
+endif
+
 if GRAMINE_MODE
 else 
 ###
 if GRAMINE_MODE
 else 
 ###
@@ -412,7 +438,7 @@ TESTS_ENVIRONMENT=$(SG_TEST_EXENV)
 EXTRA_DIST+=$(testall_SOURCES)
 
 if MAINTAINER_MODE
 EXTRA_DIST+=$(testall_SOURCES)
 
 if MAINTAINER_MODE
-CLEANFILES=$(TEST_UNITS)
+CLEANFILES+=$(TEST_UNITS)
 
 $(TEST_UNITS): $(TEST_CFILES)
        @top_srcdir@/tools/sg_unit_extractor.pl $^
 
 $(TEST_UNITS): $(TEST_CFILES)
        @top_srcdir@/tools/sg_unit_extractor.pl $^
diff --git a/src/mk_supernovae.sh b/src/mk_supernovae.sh
new file mode 100755 (executable)
index 0000000..e8c2fc5
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+file=$1
+shift
+
+echo "#define SUPERNOVAE_MODE 1" > $file
+echo '#include <ctype.h>' >> $file
+echo '#include "portable.h"' >> $file
+echo '#include "xbt.h"' >> $file
+for n in $@ ; do
+#    echo "File $n"
+    if [ "X$n" = 'Xxbt/log.c' ] ; then 
+      echo "#define _simgrid_log_category__default &_simgrid_log_category__log">> $file;
+    else 
+      if grep -q 'XBT_LOG_[^ ]*DEFAULT_[^ ]*CATEGORY' $n ; then 
+        default=`grep 'XBT_LOG_[^ ]*DEFAULT_[^ ]*CATEGORY' $n|
+                 sed 's/^[^(]*(\([^,)]*\).*$/\1/'|head -n1`; 
+        echo "#define _simgrid_log_category__default &_simgrid_log_category__$default">> $file;
+      else
+        echo "/* no default category in file $n */" >> $file; 
+      fi;
+    fi;
+    echo '  #include "'$n'"' >> $file ; 
+    echo "#undef _simgrid_log_category__default">> $file; 
+    echo >> $file; 
+done
+
+exit 0
\ No newline at end of file