Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix copyright headers
[simgrid.git] / src / Makefile.am
index 3e7d886..120033f 100644 (file)
@@ -22,7 +22,6 @@ EXTRA_DIST= \
        portable.h \
        \
         xbt/mallocator_private.h \
-       xbt/dynar_private.h \
         xbt/dict_private.h \
         xbt/heap_private.h \
         xbt/fifo_private.h \
@@ -47,6 +46,7 @@ EXTRA_DIST= \
        surf/gtnets/gtnets_interface.h \
        surf/gtnets/gtnets_simulator.h \
        surf/gtnets/gtnets_topology.h  \
+       surf/cpu_ti_private.h \
        \
         include/surf/surf_resource.h  \
        include/surf/datatypes.h \
@@ -55,6 +55,7 @@ EXTRA_DIST= \
        include/surf/surf.h \
        include/surf/surfxml_parse_private.h \
        include/surf/random_mgr.h \
+       include/surf/surf_resource_lmm.h \
        \
        include/xbt/wine_dbghelp.h \
        include/xbt/xbt_os_time.h \
@@ -64,8 +65,13 @@ EXTRA_DIST= \
        msg/mailbox.h \
        \
        simdag/private.h \
+       simdag/dax.dtd \
+       simdag/dax_dtd.l \
+       simdag/dax_dtd.h \
+       simdag/dax_dtd.c \
        \
        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 \
@@ -83,7 +89,11 @@ EXTRA_DIST= \
        smpi/private.h \
        smpi/smpi_coll_private.h \
       smpi/smpi_mpi_dt_private.h \
-       smpi/README
+       smpi/README \
+       \
+       mk_supernovae.sh \
+       \
+       bindings/ruby_bindings.h 
 
 #LIBRARY_VERSION= 0:0:0
 #                 | | |
@@ -151,7 +161,7 @@ XBT_SRC=\
   xbt/set.c                                                                  \
   xbt/xbt_matrix.c                                                           \
   \
-  xbt/xbt_queue.c                                                            \
+  xbt/xbt_queue.c  xbt/xbt_synchro.c                                         \
   \
   xbt/xbt_peer.c                                                             \
   \
@@ -183,44 +193,53 @@ SURF_SRC= \
   surf/cpu.c   surf/network.c surf/network_constant.c surf/workstation.c     \
   surf/surf_model_timer.c                                                    \
   surf/workstation_ptask_L07.c                                               \
+  surf/cpu_ti.c                                               \
+  surf/cpu_im.c                                               \
   xbt/xbt_sg_stubs.c
 
-if CONTEXT_THREADS
-  SURF_SRC +=  xbt/xbt_os_thread.c
-endif
-
 GTNETS_SRC= \
   surf/gtnets/gtnets_simulator.cc \
   surf/gtnets/gtnets_topology.cc  \
   surf/gtnets/gtnets_interface.cc \
   surf/network_gtnets.c
 
-# Separated because src/gras/rl_stubs also define the function xbt_context_mod_init() and xbt_context_mod_exit()
-# so there is an implementation of these functions in the simgrid library and an implementatin in the gras library 
-CTX_SRC= simix/smx_context.c
-
 SIMIX_SRC= \
   simix/smx_global.c \
   simix/smx_deployment.c \
   simix/smx_environment.c \
   simix/smx_host.c \
   simix/smx_process.c \
+  simix/smx_context.c \
   simix/smx_action.c \
-  simix/smx_synchro.c
-  
+  simix/smx_synchro.c \
+  simix/smx_network.c \
+  simix/smx_context_base.c
+
+TRACING_SRC=\
+  instr/interface.c \
+  instr/general.c \
+  instr/paje.c \
+  instr/msg_task_instr.c \
+  instr/msg_process_instr.c \
+  instr/smx_instr.c \
+  instr/surf_instr.c \
+  instr/variables_instr.c
+
 if CONTEXT_THREADS
-  SURF_SRC += simix/smx_context_thread.c  
+  SURF_SRC += xbt/xbt_os_thread.c simix/smx_context_thread.c
+  EXTRA_DIST += simix/smx_context_sysv.c
 else  
   SURF_SRC += simix/smx_context_sysv.c
+  EXTRA_DIST += xbt/xbt_os_thread.c simix/smx_context_thread.c
 endif  
 
 SMPI_SRC= \
   smpi/smpi_base.c \
+  smpi/smpi_comm.c \
+  smpi/smpi_group.c \
   smpi/smpi_bench.c \
   smpi/smpi_global.c \
   smpi/smpi_mpi.c \
-  smpi/smpi_sender.c \
-  smpi/smpi_receiver.c \
   smpi/smpi_util.c \
   smpi/smpi_coll.c \
   smpi/smpi_mpi_dt.c
@@ -234,7 +253,6 @@ JMSG_C_SRC = \
   simix/smx_context_java.c \
   java/jxbt_utilities.c     java/jxbt_utilities.h      \
   java/jmsg.c               java/jmsg.h                \
-  java/jmsg_channel.c       java/jmsg_channel.h        \
   java/jmsg_host.c          java/jmsg_host.h           \
   java/jmsg_process.c       java/jmsg_process.h        \
   java/jmsg_task.c          java/jmsg_task.h           \
@@ -243,9 +261,13 @@ JMSG_C_SRC = \
 JMSG_JAVA_SRC = \
   java/simgrid/msg/MsgException.java                 \
   java/simgrid/msg/JniException.java                 \
+  java/simgrid/msg/TransferFailureException.java     \
+  java/simgrid/msg/HostFailureException.java         \
+  java/simgrid/msg/TimeoutException.java             \
   java/simgrid/msg/NativeException.java              \
   java/simgrid/msg/HostNotFoundException.java        \
   java/simgrid/msg/ProcessNotFoundException.java     \
+  java/simgrid/msg/TaskCancelledException.java       \
   \
   java/simgrid/msg/Msg.java                          \
   java/simgrid/msg/Process.java                      \
@@ -253,13 +275,14 @@ JMSG_JAVA_SRC = \
   java/simgrid/msg/Task.java                         \
   \
   java/simgrid/msg/MsgNative.java                    \
-  java/simgrid/msg/DTDResolver.java                  \
   java/simgrid/msg/ApplicationHandler.java           \
   \
   java/simgrid/msg/Sem.java
 
 
-SIMDAG_SRC= simdag/sd_global.c simdag/sd_link.c simdag/sd_task.c simdag/sd_workstation.c
+SIMDAG_SRC= simdag/sd_global.c simdag/sd_link.c \
+  simdag/sd_task.c simdag/sd_workstation.c \
+  simdag/sd_daxloader.c
 
 GRAS_COMMON_SRC= \
   gras/gras.c  \
@@ -275,7 +298,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_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                    \
@@ -321,15 +344,17 @@ endif
 ### Declare the library content
 ###
 
-lib_LTLIBRARIES= libsimgrid.la libgras.la libsmpi.la
+lib_LTLIBRARIES= libsimgrid.la libgras.la libsmpi.la 
+
+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) \
+               $(TRACING_SRC)
+
 
-libgras_la_SOURCES=  $(XBT_SRC) $(GRAS_COMMON_SRC) $(GRAS_RL_SRC) $(AMOK_SRC)
 libgras_la_LDFLAGS = -no-undefined $(VERSION_INFO) @GRAS_DEP@ @LD_DYNAMIC_FLAGS@ -lm 
 
-libsimgrid_la_SOURCES = $(XBT_SRC) $(SURF_SRC) $(GTNETS_USED) \
-                        $(SIMIX_SRC) $(CTX_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
 
@@ -340,6 +365,13 @@ libsmpi_la_LIBADD = libsimgrid.la
 libsmpi_la_SOURCES = $(SMPI_SRC)
 libsmpi_la_LDFLAGS = $(VERSION_INFO) @SMPI_DEP@ @LD_DYNAMIC_FLAGS@ -lm
 
+if HAVE_RUBY
+lib_LTLIBRARIES += simgrid_ruby.la
+simgrid_ruby_la_LIBADD = libsimgrid.la
+simgrid_ruby_la_SOURCES = bindings/ruby/simgrid_ruby.c
+simgrid_ruby_la_LDFLAGS = $(VERSION_INFO) @LD_DYNAMIC_FLAGS@ -lm -module
+endif
+
 # Windows users (at least, MSVC ones) need a def file.
 if IS_WINDOWS
 libgras_la_LDFLAGS    += -Wl,--output-def,libgras.def
@@ -353,24 +385,72 @@ endif
 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
+       -rm -rf .classes simgrid.jar
 
 jardir = $(prefix)/jar
 jar_DATA =  simgrid.jar
 
-simgrid.jar: $(JMSG_JAVA_SRC) $(srcdir)/surf/simgrid.dtd
+simgrid.jar: $(JMSG_JAVA_SRC)
        [ -e .classes ] || mkdir .classes
-       $(JAVAC) -d .classes $(foreach file,$(JMSG_JAVA_SRC),$(srcdir)/$(file))
+       $(JAVAC) -d .classes -source 6 $(foreach file,$(JMSG_JAVA_SRC),$(srcdir)/$(file))
        [ -e .classes/surf ] || mkdir .classes/surf
-       cp $(srcdir)/surf/simgrid.dtd .classes/surf
        $(JAR) cvf simgrid.jar -C .classes .
 else
-EXTRA_DIST+=$(JMSG_C_SRC) $(MSG_SRC)
+EXTRA_DIST+=$(JMSG_C_SRC) $(JMSG_JAVA_SRC) $(MSG_SRC) $(TRACING_SRC)
+endif
+
+LUA_SRC= simix/smx_context_lua.c bindings/lua/simgrid_lua.c #bindings/lua/Msglua.c 
+if HAVE_LUA
+  simgrid_sources += $(LUA_SRC)
+else
+  EXTRA_DIST += $(LUA_SRC)
 endif
 
+RUBY_SRC= simix/smx_context_ruby.c \
+   bindings/ruby/rb_msg_process.c  \
+   bindings/ruby/rb_msg_host.c     \
+   bindings/ruby/rb_msg_task.c     \
+   bindings/ruby/rb_application_handler.c
+if HAVE_RUBY
+  simgrid_sources += $(RUBY_SRC)
+else
+  EXTRA_DIST += $(RUBY_SRC)
+endif
+##
+## Compile the libs
+CLEANFILES=supernovae_sg.c supernovae_gras.c supernovae_smpi.c
+BUILT_SOURCES=
+
+# Cannot let automake autocompute the content of dist from
+#  lib*_la_SOURCES variables since it would include supernovae files,
+#  which are only generated sometimes, not always.
+# So, use nodist_lib*_la_SOURCES variables and add stuff to EXTRA_DIST manually
+
+EXTRA_DIST+=$(simgrid_sources) $(gras_sources)
+
+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
+BUILT_SOURCES+=supernovae_sg.c supernovae_gras.c supernovae_smpi.c
+
+supernovae_sg.c: Makefile.am
+       @top_srcdir@/src/mk_supernovae.sh supernovae_sg.c $(filter-out $(simgrid_fragile_sources),$(simgrid_sources))
+supernovae_gras.c: Makefile.am
+       @top_srcdir@/src/mk_supernovae.sh supernovae_gras.c $(filter-out $(gras_fragile_sources),$(gras_sources))
+supernovae_smpi.c: Makefile.am
+       @top_srcdir@/src/mk_supernovae.sh supernovae_smpi.c $(filter-out $(smpi_fragile_sources),$(smpi_sources))
+
+nodist_libsimgrid_la_SOURCES =  supernovae_sg.c $(simgrid_fragile_sources)
+nodist_libgras_la_SOURCES = supernovae_gras.c $(gras_fragile_sources)
+else
+nodist_libsimgrid_la_SOURCES = $(simgrid_sources)
+nodist_libgras_la_SOURCES = $(gras_sources)
+endif
+
+
 if GRAMINE_MODE
 else 
 ###
@@ -389,15 +469,16 @@ else
 noinst_PROGRAMS=testall
 TEST_CFILES=xbt/cunit.c  xbt/ex.c          \
             xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
-           xbt/xbt_str.c  xbt/xbt_sha.c                \
-            xbt/config.c 
+           xbt/xbt_str.c  xbt/xbt_strbuff.c xbt/xbt_sha.c                \
+            xbt/config.c xbt/xbt_synchro.c
 TEST_UNITS= @builddir@/cunit_unit.c   @builddir@/ex_unit.c         \
             @builddir@/dynar_unit.c   @builddir@/dict_unit.c @builddir@/set_unit.c @builddir@/swag_unit.c \
            @builddir@/xbt_str_unit.c @builddir@/xbt_strbuff_unit.c @builddir@/xbt_sha_unit.c\
-            @builddir@/config_unit.c 
+            @builddir@/config_unit.c  @builddir@/xbt_synchro_unit.c
 
-BUILT_SOURCES=../include/surf/simgrid_dtd.h surf/simgrid_dtd.c \
+BUILT_SOURCES+=../include/surf/simgrid_dtd.h surf/simgrid_dtd.c \
               ../include/xbt/graphxml.h xbt/graphxml.c \
+              simdag/dax_dtd.h simdag/dax_dtd.c \
               gras/DataDesc/ddt_parse.yy.c \
              $(TEST_UNITS) @builddir@/simgrid_units_main.c
 
@@ -409,10 +490,9 @@ TESTS_ENVIRONMENT=$(SG_TEST_EXENV)
 EXTRA_DIST+=$(testall_SOURCES)
 
 if MAINTAINER_MODE
-CLEANFILES=$(TEST_UNITS)
+CLEANFILES+=$(TEST_UNITS)
 
-$(TEST_UNITS): xbt/cunit.c xbt/ex.c xbt/xbt_str.c xbt/xbt_strbuff.c xbt/xbt_sha.c\
-               xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c xbt/config.c
+$(TEST_UNITS): $(TEST_CFILES)
        @top_srcdir@/tools/sg_unit_extractor.pl $^
 
 @builddir@/simgrid_units_main.c: $(TEST_UNITS)
@@ -455,6 +535,9 @@ surf/simgrid_dtd.c: surf/simgrid_dtd.l
 xbt/graphxml.c: xbt/graphxml.l
        set -e;mkdir -p `dirname $@`; @LEX@ -o$@ -Pxbt_graph_parse_ --noline $^
        sed 's/#include <unistd.h>/#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\n#  ifndef __STRICT_ANSI__\n#    include <io.h>\n#    include <process.h>\n#  endif\n#else\n#  include <unistd.h>\n#endif/g' -i $@
+simdag/dax_dtd.c: simdag/dax_dtd.l
+       set -e;mkdir -p `dirname $@`; @LEX@ -o$@ -Pdax_ --noline $^
+       sed 's/#include <unistd.h>/#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)\n#  ifndef __STRICT_ANSI__\n#    include <io.h>\n#    include <process.h>\n#  endif\n#else\n#  include <unistd.h>\n#endif/g' -i $@
 
 if HAVE_FLEXML
 surf/simgrid_dtd.l: $(srcdir)/surf/simgrid.dtd
@@ -472,18 +555,31 @@ $(top_srcdir)/include/xbt/graphxml.h: $(srcdir)/xbt/graphxml.dtd
        set -e; flexml            -P graphxml --sysid=graphxml.dtd -H $@ -L $^
        sed 's/extern  *\([^ ]*[ \*]*\)/XBT_PUBLIC_DATA(\1) /' -i $@
        sed 's/XBT_PUBLIC_DATA(\([^)]*\)) *\([^(]*\)(/XBT_PUBLIC(\1) \2(/' -i $@
+
+simdag/dax_dtd.l: simdag/dax.dtd
+       set -e; flexml -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S $@ -L $^
+       sed -i 's/SET(DOCTYPE)/SET(ROOT_dax__adag)/' simdag/dax_dtd.l # DOCTYPE not mandatory
+simdag/dax_dtd.h: simdag/dax.dtd
+       set -e; flexml            --root-tags adag -P dax_ --sysid=dax.dtd -H $@ -L $^
+       sed 's/extern  *\([^ ]*[ \*]*\)/XBT_PUBLIC_DATA(\1) /' -i $@
+       sed 's/XBT_PUBLIC_DATA(\([^)]*\)) *\([^(]*\)(/XBT_PUBLIC(\1) \2(/' -i $@
 else
 
 $(top_srcdir)/include/surf/simgrid_dtd.h surf/simgrid_dtd.l: $(top_srcdir)/src/surf/simgrid.dtd
-       @echo "ERROR: src/surf/simgrid.dtd was modified, but the flexml program was not detected"
-       @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
-       @echo "ERROR:   touch include/surf/simgrid_dtd.h src/surf/simgrid_dtd.l"
-       @exit 1
+       @echo "WARNING: src/surf/simgrid.dtd seem to be modified, but the flexml program was not detected"
+       @echo "WARNING: Please install it if you did modify this file."
+       @echo "WARNING: For now, I'll ignore the change"
+       touch $(top_srcdir)/include/surf/simgrid_dtd.h $(top_srcdir)/src/surf/simgrid_dtd.l
 $(top_srcdir)/include/xbt/graphxml.h xbt/graphxml.l: $(top_srcdir)/src/xbt/graphxml.dtd
-       @echo "ERROR: src/xbt/graphxml.dtd was modified, but the flexml program was not detected"
-       @echo "ERROR: Please install it, or if you didn't modify this file, try this:"
-       @echo "ERROR:   touch include/xbt/graphxml.h src/xbt/graphxml.l"
-       @exit 1
+       @echo "WARNING: src/xbt/graphxml.dtd seem to be modified, but the flexml program was not detected"
+       @echo "WARNING: Please install it if you did modify this file."
+       @echo "WARNING: For now, I'll ignore the change"
+       touch $(top_srcdir)/include/xbt/graphxml.h $(top_srcdir)/src/xbt/graphxml.l"
+simdag/dax_dtd.h simdag/dax_dtd.l: simdag/dax.dtd
+       @echo "WARNING: src/simdag/dax.dtd seem to be modified, but the flexml program was not detected"
+       @echo "WARNING: Please install it if you did modify this file."
+       @echo "WARNING: For now, I'll ignore the change"
+       touch $(top_srcdir)/src/simdag/dax_dtd.h $(top_srcdir)/src/simdag/dax_dtd.l
 endif
 endif
 endif