Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define a version for _XOPEN_SOURCE
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index f1ff59f..3802ed9 100644 (file)
@@ -84,6 +84,11 @@ if(enable_java)
   find_package(JNI REQUIRED)
   message("-- [Java] JNI found: ${JNI_FOUND}")
   message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}")
+  if(enable_maintainer_mode)
+    find_package(SWIG REQUIRED)
+    include(UseSWIG)
+    message("-- [Java] Swig found: ${SWIG_FOUND} (version ${SWIG_VERSION})")
+  endif()
   set(HAVE_Java 1)
 endif()
 if(enable_scala)
@@ -99,14 +104,25 @@ if(enable_ns3)
   include(FindNS3)
 endif()
 
-find_package(Boost REQUIRED)
+# algorithm 1.50.0
+# function 1.23.0
+# intrusive 1.35.0
+# lambda 1.28.0
+# signals2 1.39.0
+find_package(Boost 1.42 REQUIRED)
 if(Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
 else()
-  message(FATAL_ERROR, "Failed to find Boost libraries")
+  if(APPLE) #MAC
+    message(FATAL_ERROR, "Failed to find Boost libraries (Try to install them with 'sudo fink install boost1.53.nopython')")
+  else()
+    message(FATAL_ERROR, "Failed to find Boost libraries")
+  endif()
 endif()
 
 # Checks for header libraries functions.
+CHECK_LIBRARY_EXISTS(dl      dlopen                  "" HAVE_DLOPEN_IN_LIBDL)
+CHECK_LIBRARY_EXISTS(execinfo backtrace              "" HAVE_BACKTRACE_IN_LIBEXECINFO)
 CHECK_LIBRARY_EXISTS(pthread pthread_create          "" pthread)
 CHECK_LIBRARY_EXISTS(pthread sem_init                "" HAVE_SEM_INIT_LIB)
 CHECK_LIBRARY_EXISTS(pthread sem_open                "" HAVE_SEM_OPEN_LIB)
@@ -114,6 +130,10 @@ CHECK_LIBRARY_EXISTS(pthread sem_timedwait           "" HAVE_SEM_TIMEDWAIT_LIB)
 CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
 CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
 
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700")
+endif()
+
 CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
 CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
 CHECK_INCLUDE_FILE("pthread.h" HAVE_PTHREAD_H)
@@ -125,7 +145,7 @@ CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
 CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
 CHECK_INCLUDE_FILE("winsock.h" HAVE_WINSOCK_H)
 CHECK_INCLUDE_FILE("winsock2.h" HAVE_WINSOCK2_H)
-CHECK_INCLUDE_FILE("WinDef.h" HAVE_WINDEF_H)
+CHECK_INCLUDE_FILE("windef.h" HAVE_WINDEF_H)
 CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
 CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
 CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
@@ -156,6 +176,9 @@ CHECK_FUNCTION_EXISTS(asprintf HAVE_ASPRINTF)
 CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
 CHECK_FUNCTION_EXISTS(makecontext HAVE_MAKECONTEXT)
 CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
+CHECK_FUNCTION_EXISTS(process_vm_readv HAVE_PROCESS_VM_READV)
+CHECK_FUNCTION_EXISTS(strdup SIMGRID_HAVE_STRDUP)
+CHECK_FUNCTION_EXISTS(_strdup SIMGRID_HAVE__STRDUP)
 
 #Check if __thread is defined
 execute_process(
@@ -191,13 +214,6 @@ endif()
 
 set(CONTEXT_UCONTEXT 0)
 SET(CONTEXT_THREADS 0)
-SET(HAVE_TRACING 1)
-
-if(enable_tracing)
-  SET(HAVE_TRACING 1)
-else()
-  SET(HAVE_TRACING 0)
-endif()
 
 if(enable_jedule)
   SET(HAVE_JEDULE 1)
@@ -225,14 +241,17 @@ if(enable_model-checking AND HAVE_MMALLOC)
   SET(HAVE_MC 1)
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 1)
   include(FindLibunwind)
+  include(FindLibdw)
 else()
+  if(enable_model-checking)
+    message(STATUS "Warning: support for model-checking has been disabled because HAVE_MMALLOC is false")
+  endif()
   SET(HAVE_MC 0)
+  SET(HAVE_MMALLOC 0)
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 0)
 endif()
 
 if(enable_smpi)
-  include(FindF2c)
-  # FindGFortran must come after FindF2C, and after having set HAVE_MC
   include(FindGFortran)
   SET(HAVE_SMPI 1)
 endif()
@@ -246,7 +265,10 @@ CHECK_TYPE_SIZE(void* SIZEOF_VOIDP)
 ### Check for GNU dynamic linker
 CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
 if (HAVE_DLFCN_H)
-    execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_gnu_dynlinker.c -ldl -o test_gnu_ld
+    if(HAVE_DLOPEN_IN_LIBDL)
+      set(DL_LIBRARY "-ldl")
+    endif(HAVE_DLOPEN_IN_LIBDL)
+    execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_gnu_dynlinker.c ${DL_LIBRARY} -o test_gnu_ld
       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
       OUTPUT_VARIABLE HAVE_GNU_LD_compil
     )
@@ -294,6 +316,7 @@ if(pthread)
     OUTPUT_VARIABLE HAVE_SEM_OPEN_compil
     )
 
+    # Test sem_open by compiling:
     if(HAVE_SEM_OPEN_compil)
       set(HAVE_SEM_OPEN 0)
       message(STATUS "Warning: sem_open not compilable")
@@ -303,27 +326,29 @@ if(pthread)
       message(STATUS "sem_open is compilable")
     endif()
 
-    execute_process(COMMAND ./sem_open
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-    RESULT_VARIABLE HAVE_SEM_OPEN_run
-    OUTPUT_VARIABLE var_compil
-    )
-    file(REMOVE sem_open)
-
-    if(NOT HAVE_SEM_OPEN_run)
-      set(HAVE_SEM_OPEN 1)
-      message(STATUS "sem_open is executable")
-    else()
-      set(HAVE_SEM_OPEN 0)
-      if(EXISTS "${CMAKE_BINARY_DIR}/sem_open")
-        message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_open exists!")
+    # If we're not crosscompiling, we check by executing the program:
+    if (HAVE_SEM_OPEN AND NOT CMAKE_CROSSCOMPILING)
+      execute_process(COMMAND ./sem_open
+      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+      RESULT_VARIABLE HAVE_SEM_OPEN_run
+      OUTPUT_VARIABLE var_compil
+      )
+      if (NOT HAVE_SEM_OPEN_run)
+        set(HAVE_SEM_OPEN 1)
+        message(STATUS "sem_open is executable")
       else()
-        message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_open not exists!")
+        set(HAVE_SEM_OPEN 0)
+        if(EXISTS "${CMAKE_BINARY_DIR}/sem_open")
+          message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_open exists!")
+        else()
+          message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_open not exists!")
+        endif()
+        message(STATUS "Warning: sem_open not executable")
+        message(STATUS "Compilation output: '${var_compil}'")
+        message(STATUS "Exit result of sem_open: ${HAVE_SEM_OPEN_run}")
       endif()
-      message(STATUS "Warning: sem_open not executable")
-      message(STATUS "Compilation output: '${var_compil}'")
-      message(STATUS "Exit result of sem_open: ${HAVE_SEM_OPEN_run}")
     endif()
+    file(REMOVE sem_open)
 
   else()
     set(HAVE_SEM_OPEN 0)
@@ -334,6 +359,7 @@ if(pthread)
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     RESULT_VARIABLE HAVE_SEM_INIT_run OUTPUT_VARIABLE HAVE_SEM_INIT_compil)
 
+    # Test sem_init by compiling:
     if(HAVE_SEM_INIT_compil)
       set(HAVE_SEM_INIT 0)
       message(STATUS "Warning: sem_init not compilable")
@@ -342,28 +368,30 @@ if(pthread)
       set(HAVE_SEM_INIT 1)
       message(STATUS "sem_init is compilable")
     endif()
-    execute_process(COMMAND ./sem_init
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-    RESULT_VARIABLE HAVE_SEM_INIT_run
-    OUTPUT_VARIABLE var_compil
-    )
-    file(REMOVE sem_init)
-
 
-    if(NOT HAVE_SEM_INIT_run)
-      set(HAVE_SEM_INIT 1)
-      message(STATUS "sem_init is executable")
-    else()
-      set(HAVE_SEM_INIT 0)
-      if(EXISTS "${CMAKE_BINARY_DIR}/sem_init")
-        message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_init exists!")
+    # If we're not crosscompiling, we check by executing the program:
+    if (HAVE_SEM_INIT AND NOT CMAKE_CROSSCOMPILING)
+      execute_process(COMMAND ./sem_init
+      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+      RESULT_VARIABLE HAVE_SEM_INIT_run
+      OUTPUT_VARIABLE var_compil
+      )
+      if (NOT HAVE_SEM_INIT_run)
+        set(HAVE_SEM_INIT 1)
+        message(STATUS "sem_init is executable")
       else()
-        message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_init not exists!")
+        set(HAVE_SEM_INIT 0)
+        if(EXISTS "${CMAKE_BINARY_DIR}/sem_init")
+          message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_init exists!")
+        else()
+          message(STATUS "Bin ${CMAKE_BINARY_DIR}/sem_init not exists!")
+        endif()
+        message(STATUS "Warning: sem_init not executable")
+        message(STATUS "Compilation output: '${var_compil}'")
+        message(STATUS "Exit result of sem_init: ${HAVE_SEM_INIT_run}")
       endif()
-      message(STATUS "Warning: sem_init not executable")
-      message(STATUS "Compilation output: '${var_compil}'")
-      message(STATUS "Exit result of sem_init: ${HAVE_SEM_INIT_run}")
     endif()
+    file(REMOVE sem_init)
   endif()
 
   if(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT)
@@ -409,93 +437,44 @@ if(pthread)
   endif()
 endif()
 
-# AC_CHECK_MCSC(mcsc=yes, mcsc=no)
-set(mcsc_flags "")
+# This is needed for ucontext on MacOS X:
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  set(mcsc_flags "-D_XOPEN_SOURCE")
-endif()
-
-if(WIN32)
-  if(ARCH_32_BITS)
-    set(mcsc_flags "-D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
-  else()
-    set(mcsc_flags "-D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
-  endif()
-endif()
-
-IF(CMAKE_CROSSCOMPILING)
-  IF(WIN32)
-    set(windows_context "yes")
-    set(IS_WINDOWS 1)
-  ENDIF()
-ELSE()
-  file(REMOVE "${CMAKE_BINARY_DIR}/testprog*")
-  file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
-  execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c ${mcsc_flags} -o testprog
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/
-  OUTPUT_VARIABLE COMPILE_mcsc_VAR)
-
-  if(NOT COMPILE_mcsc_VAR)
-    message(STATUS "prog_AC_CHECK_MCSC.c is compilable")
-    execute_process(COMMAND ./testprog
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/
-    OUTPUT_VARIABLE var_compil)
-  else()
-    message(STATUS "prog_AC_CHECK_MCSC.c is not compilable")
-  endif()
-  file(REMOVE "${CMAKE_BINARY_DIR}/testprog*")
-
-  if(EXISTS "${CMAKE_BINARY_DIR}/conftestval")
-    file(READ "${CMAKE_BINARY_DIR}/conftestval" mcsc)
-    STRING(REPLACE "\n" "" mcsc "${mcsc}")
-    if(mcsc)
-      set(mcsc "yes")
-      set(HAVE_UCONTEXT_H 1)
-    else()
-      set(mcsc "no")
-    endif()
-  else()
-    set(mcsc "no")
-  endif()
-
-  message(STATUS "mcsc: ${mcsc}")
-ENDIF()
-
-if(mcsc MATCHES "no" AND pthread)
-  if(HAVE_WINDOWS_H)
-    set(windows_context "yes")
-    set(IS_WINDOWS 1)
-  elseif(HAVE_WINDOWS_H)
-    message(FATAL_ERROR "no appropriate backend found")
-  endif()
+  add_definitions(-D_XOPEN_SOURCE=700)
 endif()
 
-#Only windows
-
 if(WIN32)
-  if(NOT HAVE_WINDOWS_H)
-    message(FATAL_ERROR "no appropriate backend found windows")
-  endif()
-endif()
-
-if(windows_context MATCHES "yes")
-  message(STATUS "Context change to windows")
+  # We always provide our own implementation of ucontext on Windows.
+  try_compile(HAVE_UCONTEXT
+    ${CMAKE_BINARY_DIR}
+    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
+    COMPILE_DEFINITIONS _XBT_WIN32
+    INCLUDE_DIRECTORIES
+      ${CMAKE_HOME_DIRECTORY}/src/include
+      ${CMAKE_HOME_DIRECTORY}/src/xbt
+  )
+else()
+  # We always provide our own implementation of ucontext on Windows.
+  try_compile(HAVE_UCONTEXT
+    ${CMAKE_BINARY_DIR}
+    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c)
 endif()
 
 #If can have both context
 
-if(mcsc)
+if(HAVE_UCONTEXT)
   set(CONTEXT_UCONTEXT 1)
+  message("-- Support for ucontext factory")
 endif()
 
 if(pthread)
   set(CONTEXT_THREADS 1)
+  message("-- Support for thread context factory")
 endif()
 
 ###############
 ## GIT version check
 ##
-if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/ AND NOT WIN32)
+if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/)
   execute_process(COMMAND git remote
   COMMAND head -n 1
   WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
@@ -527,7 +506,17 @@ if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/ AND NOT WIN32)
     string(REPLACE "\n" "" GIT_DATE "${GIT_DATE}")
     message(STATUS "Git date: ${GIT_DATE}")
     string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
+    
+    execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=format:%H -1
+                    WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
+                   OUTPUT_VARIABLE SIMGRID_GITHASH
+                   RESULT_VARIABLE ret
+                   )
+    string(REPLACE "\n" "" SIMGRID_GITHASH "${SIMGRID_GITHASH}")
+                   
   endif()
+elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion)
+  FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION)
 endif()
 
 if(release)
@@ -547,7 +536,7 @@ set(makecontext_CPPFLAGS_2 "")
 if(HAVE_MAKECONTEXT OR WIN32)
   set(makecontext_CPPFLAGS "-DTEST_makecontext")
   if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-    set(makecontext_CPPFLAGS_2 "-D_XOPEN_SOURCE")
+    set(makecontext_CPPFLAGS_2 "-D_XOPEN_SOURCE=700")
   endif()
 
   if(WIN32)
@@ -556,16 +545,21 @@ if(HAVE_MAKECONTEXT OR WIN32)
     else()
       set(makecontext_CPPFLAGS "-DTEST_makecontext -D_AMD64_")
     endif()
-    set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt")
   endif()
 
   file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
 
-  try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_stacksetup.c
-    COMPILE_DEFINITIONS "${makecontext_CPPFLAGS} ${makecontext_CPPFLAGS_2}"
-    )
+  if(CMAKE_CROSSCOMPILING)
+    set(RUN_makecontext_VAR "cross")
+    set(COMPILE_makecontext_VAR "cross")
+  else()
+    try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
+      ${CMAKE_BINARY_DIR}
+      ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_stacksetup.c
+      COMPILE_DEFINITIONS "${makecontext_CPPFLAGS} ${makecontext_CPPFLAGS_2}"
+      )
+  endif()
 
   if(EXISTS ${CMAKE_BINARY_DIR}/conftestval)
     file(READ ${CMAKE_BINARY_DIR}/conftestval MAKECONTEXT_ADDR_SIZE)
@@ -590,16 +584,23 @@ if (NOT CMAKE_CROSSCOMPILING)
   try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
     ${CMAKE_BINARY_DIR}
     ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_stackgrowth.c
+    RUN_OUTPUT_VARIABLE stack
     )
-  file(READ "${CMAKE_BINARY_DIR}/conftestval" stack)
-  if(stack MATCHES "down")
+endif()
+if("${stack}" STREQUAL "down")
+  set(PTH_STACKGROWTH "-1")
+elseif("${stack}" STREQUAL "up")
+  set(PTH_STACKGROWTH "1")
+else()
+  if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
     set(PTH_STACKGROWTH "-1")
+  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+    set(PTH_STACKGROWTH "-1")
+  else()
+    message(ERROR "Could not figure the stack direction.")
   endif()
-  if(stack MATCHES "up")
-    set(PTH_STACKGROWTH "1")
-  endif()
-
 endif()
+
 ###############
 ## System checks
 ##
@@ -610,18 +611,6 @@ endif()
 
 #AC_PROG_MAKE_SET
 
-#AC_PRINTF_NULL FIXME: this is too ancient to survive!
-try_run(RUN_PRINTF_NULL_VAR COMPILE_PRINTF_NULL_VAR
-  ${CMAKE_BINARY_DIR}
-  ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_printf_null.c
-  )
-
-if(RUN_PRINTF_NULL_VAR MATCHES "FAILED_TO_RUN")
-  SET(PRINTF_NULL_WORKING "0")
-else()
-  SET(PRINTF_NULL_WORKING "1")
-endif()
-
 #AC_CHECK_VA_COPY
 
 set(diff_va "va_copy((d),(s))"
@@ -666,7 +655,7 @@ int main(void)
     )
 
   execute_process(
-  COMMAND ${CMAKE_C_COMPILER} "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" 
+  COMMAND ${CMAKE_C_COMPILER} "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c"
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
   RESULT_VARIABLE COMPILE_VA_NULL_VAR
   OUTPUT_QUIET
@@ -824,9 +813,8 @@ set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_P
 
 file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH)
 configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/mpif.h @ONLY)
-configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/smpif.h @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/bin/smpicc @ONLY)
-configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/bin/smpif2c @ONLY)
+configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicxx.in ${CMAKE_BINARY_DIR}/bin/smpicxx @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/bin/smpiff @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif90.in ${CMAKE_BINARY_DIR}/bin/smpif90 @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_BINARY_DIR}/bin/smpirun @ONLY)
@@ -847,7 +835,7 @@ set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_P
 set(libdir "${CMAKE_BINARY_DIR}/lib")
 
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc @ONLY)
-configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif2c @ONLY)
+configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicxx.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicxx @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif90.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90 @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun @ONLY)
@@ -856,12 +844,12 @@ set(top_builddir ${CMAKE_HOME_DIRECTORY})
 
 if(NOT WIN32)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc)
-  execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c)
+  execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicxx)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif90)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc)
-  execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif2c)
+  execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicxx)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90)
   execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun)
@@ -869,7 +857,6 @@ endif()
 
 set(generated_headers_to_install
   ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
-  ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
   ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
   )
 
@@ -882,23 +869,16 @@ set(generated_files_to_clean
   ${generated_headers}
   ${generated_headers_to_install}
   ${CMAKE_BINARY_DIR}/bin/smpicc
-  ${CMAKE_BINARY_DIR}/bin/smpif2c
+  ${CMAKE_BINARY_DIR}/bin/smpicxx
   ${CMAKE_BINARY_DIR}/bin/smpiff
   ${CMAKE_BINARY_DIR}/bin/smpif90
   ${CMAKE_BINARY_DIR}/bin/smpirun
   ${CMAKE_BINARY_DIR}/bin/colorize
   ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
   ${CMAKE_BINARY_DIR}/examples/smpi/tracing/smpi_traced.trace
-  ${CMAKE_BINARY_DIR}/src/supernovae_sg.c
-  ${CMAKE_BINARY_DIR}/src/supernovae_smpi.c
   )
 
-if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
-else()
-  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/hostfile ${CMAKE_BINARY_DIR}/examples/smpi/hostfile COPYONLY)
-  configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
-  configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml COPYONLY)
-  configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml COPYONLY)
+if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
   configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt COPYONLY)
   configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt COPYONLY)
   configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allReduce.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allReduce.txt COPYONLY)
@@ -912,13 +892,45 @@ else()
   configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_gather.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_gather.txt COPYONLY)
   configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allgatherv.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allgatherv.txt COPYONLY)
   configure_file(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hostfile ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile COPYONLY)
+  
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/description_file ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/description_file COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/README ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/README COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/smpi_replay.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/smpi_replay.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace0.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace1.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace2.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace2.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace3.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace3.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace4.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace4.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace5.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace5.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace6.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace6.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace7.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace7.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace8.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace8.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace9.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace9.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace10.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace10.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace11.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace11.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace12.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace12.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace13.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace13.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace14.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace14.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace15.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace15.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace16.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace16.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace17.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace17.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace18.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace18.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace19.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace19.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace20.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace20.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace21.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace21.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace22.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace22.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace23.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace23.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace24.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace24.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace25.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace25.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace26.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace26.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace27.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace27.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace28.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace28.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace29.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace29.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace30.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace30.txt COPYONLY)
+  configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace31.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace31.txt COPYONLY)
 
   set(generated_files_to_clean
     ${generated_files_to_clean}
-    ${CMAKE_BINARY_DIR}/examples/smpi/hostfile
-    ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml
-    ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml
-    ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml
     ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt
     ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt
     ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allReduce.txt
@@ -928,7 +940,45 @@ else()
     ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoall.txt
     ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoallv.txt
     ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_waitall.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_gather.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allgatherv.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_reducescatter.txt
     ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/description_file
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/README
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/smpi_replay.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace0.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace1.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace2.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace3.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace4.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace5.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace6.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace7.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace8.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace9.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace10.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace11.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace12.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace13.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace14.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace15.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace16.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace17.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace18.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace19.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace20.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace21.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace22.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace23.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace24.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace25.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace26.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace27.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace28.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace29.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace30.txt
+    ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace31.txt
     )
 endif()