X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f632a205b7929ecfd367fcd2d787c65ab676da90..4b4a8875cab9ecabc77e4be4c4f34dfcb54ea7f8:/buildtools/Cmake/CompleteInFiles.cmake diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index a5bec10a88..9600214c05 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -7,16 +7,15 @@ set(CMAKE_MODULE_PATH # x86 # i.86 -IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86") +### Determine the assembly flavor that we need today +include(CMakeDetermineSystem) +IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64") IF(${ARCH_32_BITS}) + message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)") set(PROCESSOR_i686 1) - set(SIMGRID_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}") - message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}") ELSE() - message(STATUS "System processor: amd64") - set(SIMGRID_SYSTEM_PROCESSOR "amd64") + message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)") set(PROCESSOR_x86_64 1) - set(PROCESSOR_i686 0) ENDIF() set(HAVE_RAWCTX 1) @@ -57,6 +56,12 @@ ELSE() #PROCESSOR NOT FOUND ENDIF() +if(ARCH_32_BITS) + set(MPI_ADDRESS_SIZE 4) +else() + set(MPI_ADDRESS_SIZE 8) +endif() + message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}") include(CheckFunctionExists) @@ -68,27 +73,29 @@ include(TestBigEndian) TEST_BIG_ENDIAN(BIGENDIAN) include(FindGraphviz) -if(WIN32) - include(FindPcreWin) -else() - include(FindPCRE) -endif() +include(FindLibSigc++) set(HAVE_GTNETS 0) if(enable_gtnets) include(FindGTnets) endif() -if(enable_smpi) - include(FindF2c) - SET(HAVE_SMPI 1) -endif() if(enable_java) find_package(Java REQUIRED COMPONENTS Runtime Development) 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) + find_package(Scala REQUIRED) + message("-- [Scala] scalac found: ${SCALA_COMPILE}") + set(HAVE_Scala 1) +endif() if(enable_lua) include(FindLua51Simgrid) endif() @@ -97,13 +104,31 @@ if(enable_ns3) include(FindNS3) endif() +# 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() + 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(pthread pthread_create "" pthread) -CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB) -CHECK_LIBRARY_EXISTS(pthread sem_open "" HAVE_SEM_OPEN_LIB) -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) +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) +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) 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) @@ -147,7 +172,6 @@ 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(mergesort HAVE_MERGESORT) #Check if __thread is defined execute_process( @@ -157,16 +181,22 @@ execute_process( ) if(HAVE_thread_storage_run) - set(HAVE_THREAD_LOCAL_STORAGE 0) -else() set(HAVE_THREAD_LOCAL_STORAGE 1) +else() + set(HAVE_THREAD_LOCAL_STORAGE 0) endif() # Our usage of mmap is Linux-specific (flag MAP_ANONYMOUS), but kFreeBSD uses a GNU libc IF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU" AND NOT "${CMAKE_SYSTEM}" MATCHES "Darwin") SET(HAVE_MMAP 0) message(STATUS "Warning: MMAP is thought as non functional on this architecture (${CMAKE_SYSTEM})") -ENDIF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU" AND NOT "${CMAKE_SYSTEM}" MATCHES "Darwin") +ENDIF() + +if(HAVE_MMAP AND HAVE_THREAD_LOCAL_STORAGE) + SET(HAVE_MMALLOC 1) +else() + SET(HAVE_MMALLOC 0) +endif() if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD... set(HAVE_UCONTEXT_H 1) @@ -207,15 +237,25 @@ else() SET(MALLOCATOR_IS_WANTED 0) endif() -if(enable_model-checking AND HAVE_MMAP) +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(FindGFortran) + SET(HAVE_SMPI 1) +endif() + #-------------------------------------------------------------------------------------------------- ### Check for some architecture dependent values CHECK_TYPE_SIZE(int SIZEOF_INT) @@ -225,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 ) @@ -236,8 +279,8 @@ if (HAVE_DLFCN_H) else() execute_process(COMMAND ./test_gnu_ld - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - RESULT_VARIABLE HAVE_GNU_LD_run + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE HAVE_GNU_LD_run OUTPUT_VARIABLE var_exec ) @@ -248,7 +291,7 @@ if (HAVE_DLFCN_H) set(HAVE_GNU_LD 0) message(STATUS "Warning: error while checking for GNU ld:") message(STATUS "Test output: '${var_exec}'") - message(STATUS "Exit status: ${HAVE_GNU_LD_run}") + message(STATUS "Exit status: ${HAVE_GNU_LD_run}") endif() file(REMOVE test_gnu_ld) endif() @@ -283,8 +326,8 @@ if(pthread) endif() execute_process(COMMAND ./sem_open - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - RESULT_VARIABLE HAVE_SEM_OPEN_run + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE HAVE_SEM_OPEN_run OUTPUT_VARIABLE var_compil ) file(REMOVE sem_open) @@ -310,9 +353,9 @@ if(pthread) if(HAVE_SEM_INIT_LIB) execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c -lpthread -o sem_init - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} RESULT_VARIABLE HAVE_SEM_INIT_run OUTPUT_VARIABLE HAVE_SEM_INIT_compil) - + if(HAVE_SEM_INIT_compil) set(HAVE_SEM_INIT 0) message(STATUS "Warning: sem_init not compilable") @@ -321,9 +364,9 @@ 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 + execute_process(COMMAND ./sem_init + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + RESULT_VARIABLE HAVE_SEM_INIT_run OUTPUT_VARIABLE var_compil ) file(REMOVE sem_init) @@ -391,14 +434,14 @@ endif() # AC_CHECK_MCSC(mcsc=yes, mcsc=no) set(mcsc_flags "") if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - set(mcsc_flags "-D_XOPEN_SOURCE") + 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") + set(mcsc_flags -D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/src/include -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") + set(mcsc_flags -D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/src/include -I${CMAKE_HOME_DIRECTORY}/src/xbt) endif() endif() @@ -412,7 +455,7 @@ ELSE() 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) + OUTPUT_VARIABLE COMPILE_mcsc_VAR ERROR_VARIABLE COMPILE_mcsc_VAR) if(NOT COMPILE_mcsc_VAR) message(STATUS "prog_AC_CHECK_MCSC.c is compilable") @@ -420,7 +463,7 @@ ELSE() WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/ OUTPUT_VARIABLE var_compil) else() - message(STATUS "prog_AC_CHECK_MCSC.c is not compilable") + message(STATUS "prog_AC_CHECK_MCSC.c is not compilable:\n${COMPILE_mcsc_VAR}") endif() file(REMOVE "${CMAKE_BINARY_DIR}/testprog*") @@ -474,7 +517,7 @@ 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/ @@ -506,12 +549,22 @@ 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}") - STRING(REPLACE " +0000" "" GIT_DATE "${GIT_DATE}") - STRING(REPLACE " " "~" GIT_DATE "${GIT_DATE}") - STRING(REPLACE ":" "-" GIT_DATE "${GIT_DATE}") endif() +elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion) + FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION) endif() +if(release) + set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING}\\nRelease build") +else() + set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING}\\nDevelopment build") +endif() +if(GIT_VERSION) + set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING} at commit ${GIT_VERSION}") +endif() +if(GIT_DATE) + set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING} (${GIT_DATE})") +endif() #-------------------------------------------------------------------------------------------------- set(makecontext_CPPFLAGS_2 "") @@ -527,7 +580,7 @@ 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) @@ -550,7 +603,7 @@ if(HAVE_MAKECONTEXT OR WIN32) message(STATUS "${pth_skaddr_makecontext}") message(STATUS "${pth_sksize_makecontext}") else() - # message(FATAL_ERROR "makecontext is not compilable") + # message(FATAL_ERROR "makecontext is not compilable") endif() endif() @@ -607,39 +660,44 @@ set(diff_va "va_copy((d),(s))" foreach(fct ${diff_va}) write_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" "#include - #include - #include - #define DO_VA_COPY(d,s) ${fct} - void test(char *str, ...) - { - va_list ap, ap2; - int i; - va_start(ap, str); - DO_VA_COPY(ap2, ap); - for (i = 1; i <= 9; i++) { - int k = (int)va_arg(ap, int); - if (k != i) - abort(); - } - DO_VA_COPY(ap, ap2); - for (i = 1; i <= 9; i++) { - int k = (int)va_arg(ap, int); - if (k != i) - abort(); - } - va_end(ap); - } - int main(void) - { - test(\"test\", 1, 2, 3, 4, 5, 6, 7, 8, 9); - exit(0); - }" - ) - try_compile(COMPILE_VA_NULL_VAR - ${CMAKE_BINARY_DIR} - ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c +#include +#include +#define DO_VA_COPY(d,s) ${fct} +void test(char *str, ...) +{ + va_list ap, ap2; + int i; + va_start(ap, str); + DO_VA_COPY(ap2, ap); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + DO_VA_COPY(ap, ap2); + for (i = 1; i <= 9; i++) { + int k = (int)va_arg(ap, int); + if (k != i) + abort(); + } + va_end(ap); +} +int main(void) +{ + test(\"test\", 1, 2, 3, 4, 5, 6, 7, 8, 9); + exit(0); +}" ) - if(COMPILE_VA_NULL_VAR) + + execute_process( + 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 + ERROR_QUIET + ) + + if(NOT COMPILE_VA_NULL_VAR) string(REGEX REPLACE "\;" "" fctbis ${fct}) if(${fctbis} STREQUAL "va_copy((d),(s))") set(HAVE_VA_COPY 1) @@ -762,26 +820,36 @@ endif() ### File to create -configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in" "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in" + "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE) SET( CMAKEDEFINE "#cmakedefine" ) -configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE) -configure_file("${CMAKE_BINARY_DIR}/src/internal_config.h" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE) -configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE) +configure_file("${CMAKE_BINARY_DIR}/src/internal_config.h" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE) set(top_srcdir "${CMAKE_HOME_DIRECTORY}") set(srcdir "${CMAKE_HOME_DIRECTORY}/src") +set(bindir "${CMAKE_BINARY_DIR}") ### Script used when simgrid is installed set(exec_prefix ${CMAKE_INSTALL_PREFIX}) set(includeflag "-I${CMAKE_INSTALL_PREFIX}/include -I${CMAKE_INSTALL_PREFIX}/include/smpi") set(includedir "${CMAKE_INSTALL_PREFIX}/include") set(libdir ${exec_prefix}/lib) -set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH") +set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib") +if(GTNETS_LIB_PATH) + set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${GTNETS_LIB_PATH}") +endif() +if(HAVE_NS3_LIB) + set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${HAVE_NS3_LIB}") +endif() +set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"") -configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/smpif.h @ONLY) +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}/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) @@ -791,11 +859,18 @@ set(includeflag "-I${CMAKE_HOME_DIRECTORY}/include -I${CMAKE_HOME_DIRECTORY}/inc set(includeflag "${includeflag} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/smpi") set(includedir "${CMAKE_HOME_DIRECTORY}/include") set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/") -set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH") +set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_BINARY_DIR}/lib") +if(GTNETS_LIB_PATH) + set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${GTNETS_LIB_PATH}") +endif() +if(HAVE_NS3_LIB) + set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${HAVE_NS3_LIB}") +endif() +set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"") 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) @@ -804,19 +879,19 @@ 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) endif() set(generated_headers_to_install - ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h + ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h ) @@ -829,23 +904,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) @@ -855,14 +923,49 @@ else() configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_alltoall.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoall.txt COPYONLY) configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_alltoallv.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoallv.txt COPYONLY) configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_waitall.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_waitall.txt COPYONLY) + configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_reducescatter.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_reducescatter.txt COPYONLY) + 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 @@ -872,7 +975,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() @@ -884,4 +1025,4 @@ IF(${ARCH_32_BITS}) ELSE() set(WIN_ARCH "64") ENDIF() -configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/simgrid.nsi.in" "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/simgrid.nsi.in" "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)