1 cmake_minimum_required(VERSION 2.8.8)
2 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
3 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules)
7 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
8 # Check for the compiler #
9 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
11 ### Need to set rc ccompiler before enable language
13 SET(CMAKE_RC_COMPILER "windres")
17 ## Check the C/C++ standard that we need
18 ## See also tools/cmake/GCCFlags.cmake that sets our paranoid warning flags
19 INCLUDE(CheckCCompilerFlag)
20 CHECK_C_COMPILER_FLAG(-fstack-cleaner HAVE_C_STACK_CLEANER)
22 ## Request full debugging flags
23 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
24 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
25 set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
27 if (CMAKE_COMPILER_IS_GNUCC)
28 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
30 "SimGrid needs at least g++ version 4.7 to compile but you have ${CMAKE_CXX_COMPILER_VERSION}."
31 "You need a sufficient support of c++11 to compile SimGrid.")
35 ## We need a decent support of the C++11 and C11 standards
36 set(CMAKE_CXX_STANDARD 11)
37 set(CMAKE_CXX_STANDARD_REQUIRED ON)
39 set(CMAKE_C_STANDARD 11)
40 set(CMAKE_C_STANDARD_REQUIRED ON)
42 ### Check threading support
43 set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
47 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Option.cmake)
50 if ((NOT DEFINED enable_smpi) OR enable_smpi)
51 # First unset the compiler in case we're re-running cmake over a previous
52 # configuration where it was saved as smpiff
53 unset(CMAKE_Fortran_COMPILER)
57 enable_language(Fortran OPTIONAL)
60 if(CMAKE_Fortran_COMPILER)
62 # Fortran compiler detected: save it, then replace by smpiff
63 set(SMPI_Fortran_COMPILER "${CMAKE_Fortran_COMPILER}" CACHE FILEPATH "The real Fortran compiler")
65 # Set flags/libs to be used in smpiff
66 if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
67 set(SMPI_Fortran_FLAGS "\"-fpic\" \"-ff2c\" \"-fno-second-underscore\"")
68 set(SMPI_Fortran_LIBS "\"-lgfortran\"")
70 elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
71 set(SMPI_Fortran_FLAGS "\"-fPIC\" \"-nofor-main\"")
72 set(SMPI_Fortran_LIBS "\"-lifcore\"")
74 elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI|Flang") # flang
75 set(SMPI_Fortran_FLAGS "\"-fPIC\"")
76 set(SMPI_Fortran_LIBS "")
81 endif(CMAKE_Fortran_COMPILER)
85 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
86 # Build the version number #
87 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
89 set(SIMGRID_VERSION_MAJOR "3")
90 set(SIMGRID_VERSION_MINOR "21")
91 set(SIMGRID_VERSION_PATCH "90")
92 set(SIMGRID_VERSION_EXTRA "-DEVEL") # Extra words to add to version string (e.g. -rc1)
94 set(SIMGRID_VERSION_DATE "2018") # Year for copyright information
96 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
97 set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
99 set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}")
102 set(SIMGRID_VERSION_STRING "SimGrid version ${release_version}${SIMGRID_VERSION_EXTRA}")
104 set(libsimgrid_version "${release_version}")
105 set(libsimgrid-java_version "${release_version}")
107 ### SET THE LIBRARY EXTENSION
117 execute_process(COMMAND ${CMAKE_LINKER} -version OUTPUT_VARIABLE LINKER_VERSION ERROR_VARIABLE LINKER_VERSION)
118 string(REGEX MATCH "[0-9].[0-9]*" LINKER_VERSION "${LINKER_VERSION}")
120 ### Set the library providing dlopen
121 if("${CMAKE_SYSTEM_NAME}" MATCHES "kFreeBSD|Linux")
122 find_library(DL_LIBRARY dl)
125 ### Find programs and paths
126 FIND_PROGRAM(GCOV_PATH gcov)
129 message(FATAL_ERROR "Please install Perl to compile SimGrid.")
132 # tesh.py needs python 3 (or the module python-subprocess32 on python2.8+)
133 set(PythonInterp_FIND_VERSION 3)
134 set(PythonInterp_FIND_VERSION_COUNT 1)
135 set(PythonInterp_FIND_VERSION_MAJOR 3)
136 include(FindPythonInterp)
137 if(NOT PYTHONINTERP_FOUND)
138 message(FATAL_ERROR "Please install Python (version 3 or higher).")
141 SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
143 ### Compute the include paths
145 # Only include public headers by default
147 ${CMAKE_BINARY_DIR}/include
148 ${CMAKE_HOME_DIRECTORY}/include
151 # Compute the ones that should be added when compiling the library
152 set(INTERNAL_INCLUDES
154 ${CMAKE_HOME_DIRECTORY}
155 ${CMAKE_HOME_DIRECTORY}/src/include
159 set (INTERNAL_INCLUDES ${INTERNAL_INCLUDES} ${CMAKE_HOME_DIRECTORY}/src/smpi/include)
162 if(NOT CMAKE_CROSSCOMPILING AND EXISTS /usr/include/)
163 set(INTERNAL_INCLUDES ${INTERNAL_INCLUDES} /usr/include/)
167 set(CMAKE_INCLUDE_WIN "${CMAKE_C_COMPILER}")
168 set(CMAKE_LIB_WIN "${CMAKE_C_COMPILER}")
169 string(REGEX REPLACE "/bin/gcc.*" "/include" CMAKE_INCLUDE_WIN "${CMAKE_INCLUDE_WIN}")
170 string(REGEX REPLACE "/bin/gcc.*" "/lib" CMAKE_LIB_WIN "${CMAKE_LIB_WIN}")
171 set(INTERNAL_INCLUDES ${INTERNAL_INCLUDES} ${CMAKE_INCLUDE_WIN})
172 unset(CMAKE_INCLUDE_WIN)
175 # library dependency cannot start with a space (CMP0004), so initialize it with something that is never desactivated.
176 set(SIMGRID_DEP "-lm")
178 ### Determine the assembly flavor that we need today
179 set(HAVE_RAW_CONTEXTS 0)
180 include(CMakeDetermineSystem)
181 IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
182 IF(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
183 message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
184 set(SIMGRID_PROCESSOR_i686 1)
185 set(SIMGRID_PROCESSOR_x86_64 0)
187 message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
188 set(SIMGRID_PROCESSOR_i686 0)
189 set(SIMGRID_PROCESSOR_x86_64 1)
192 message(STATUS "Disable fast raw contexts on Windows.")
194 set(HAVE_RAW_CONTEXTS 1)
197 set(SIMGRID_PROCESSOR_i686 0)
198 set(SIMGRID_PROCESSOR_x86_64 0)
201 include(CheckFunctionExists)
202 include(CheckTypeSize)
203 include(CheckIncludeFile)
204 include(CheckIncludeFiles)
205 include(CheckLibraryExists)
206 include(CheckSymbolExists)
209 include(FindGraphviz)
211 set(SIMGRID_HAVE_LUA 0)
213 include(FindLuaSimgrid)
216 set(SIMGRID_HAVE_NS3 0)
219 if (SIMGRID_HAVE_NS3)
220 set(SIMGRID_HAVE_NS3 1)
221 foreach(lib core csma point-to-point internet network applications)
222 set(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
225 message(FATAL_ERROR "Cannot find NS3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
230 set(Boost_USE_STATIC_LIBS 1)
237 message(FATAL_ERROR "Cannot find PAPI. Please install it (apt-get install papi-tools libpapi-dev) or disable PAPI bindings.")
241 # Not finding this is perfectly OK
242 find_package(Boost 1.59 COMPONENTS unit_test_framework)
243 if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
244 message(STATUS "Enabling the Boost-based unit tests.")
246 message(STATUS "Disabling the Boost-based unit tests -- please install libboost-test-dev (>= v1.59).")
250 find_package(Boost 1.48)
252 include_directories(${Boost_INCLUDE_DIRS})
255 message(FATAL_ERROR "Boost libraries not found. Try to install them with 'sudo fink install boost1.53.nopython' (check the exact name with 'fink list boost') or 'sudo brew install boost'")
257 message(FATAL_ERROR "Boost libraries not found. Install libboost-dev (>= 1.48.0).")
261 find_package(Boost COMPONENTS context)
262 set(Boost_FOUND 1) # This component is optional
263 if(Boost_CONTEXT_FOUND)
264 message(STATUS "Found Boost.Context")
265 set(HAVE_BOOST_CONTEXTS 1)
267 message (" boost : found.")
268 message (" boost-context: missing. Install libboost-context-dev for this optional feature.")
269 set(HAVE_BOOST_CONTEXTS 0)
272 # Checks for header libraries functions.
273 CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME)
275 set(HAVE_PTHREAD_SETAFFINITY 0)
276 CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "" HAVE_PTHREAD_SETAFFINITY)
278 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
279 set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
281 # Use the GNU version of unusual modifiers like PRIx64
282 add_definitions(-D__USE_MINGW_ANSI_STDIO=1)
283 set(CMAKE_REQUIRED_DEFINITIONS "-D__USE_MINGW_ANSI_STDIO=1")
285 set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
288 CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_H)
289 CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
290 CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
291 CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
292 CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
293 CHECK_INCLUDE_FILE("sys/sysctl.h" HAVE_SYS_SYSCTL_H)
294 CHECK_INCLUDE_FILE("ucontext.h" HAVE_UCONTEXT_H)
295 CHECK_INCLUDE_FILE("linux/futex.h" HAVE_FUTEX_H)
297 CHECK_FUNCTION_EXISTS(backtrace HAVE_BACKTRACE)
298 CHECK_FUNCTION_EXISTS(dlfunc HAVE_DLFUNC)
299 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
300 CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
301 CHECK_FUNCTION_EXISTS(getdtablesize HAVE_GETDTABLESIZE)
302 CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
303 CHECK_FUNCTION_EXISTS(popen HAVE_POPEN)
304 CHECK_FUNCTION_EXISTS(process_vm_readv HAVE_PROCESS_VM_READV)
305 CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
306 CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
308 CHECK_SYMBOL_EXISTS(vasprintf stdio.h HAVE_VASPRINTF)
310 # The detection of vasprintf fails on MinGW, assumingly because it's
311 # defined as an inline function in stdio.h instead of a regular
312 # function. So force the result to be 1 despite of the test.
313 set(HAVE_VASPRINTF 1)
316 CHECK_INCLUDE_FILE("sys/sendfile.h" HAVE_SENDFILE_H)
317 CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
318 if(HAVE_SENDFILE_H AND HAVE_SENDFILE)
324 if(enable_model-checking AND NOT "${CMAKE_SYSTEM}" MATCHES "Linux|FreeBSD")
325 message(WARNING "Support for model-checking has not been enabled on ${CMAKE_SYSTEM}: disabling it")
326 set(enable_model-checking FALSE)
333 if(enable_model-checking)
334 message(STATUS "Warning: support for model-checking has been disabled because you are missing either mmap or __thread.")
336 SET(enable_model-checking 0)
340 set(SIMGRID_HAVE_JEDULE 1)
342 set(SIMGRID_HAVE_JEDULE 0)
345 if(enable_mallocators)
346 SET(SIMGRID_HAVE_MALLOCATOR 1)
348 SET(SIMGRID_HAVE_MALLOCATOR 0)
351 include(FindLibunwind)
353 SET(SIMGRID_DEP "${SIMGRID_DEP} ${LIBUNWIND_LIBRARIES}")
355 if(enable_model-checking)
356 message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.")
360 if(enable_model-checking)
361 find_package(Libdw REQUIRED)
362 find_package(Libelf REQUIRED)
363 find_package(Libevent REQUIRED)
364 include_directories(${LIBDW_INCLUDE_DIR} ${LIBELF_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
365 set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBDW_LIBRARIES}")
366 set(SIMGRID_HAVE_MC 1)
367 if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java)
368 message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling java")
369 set(enable_java FALSE)
372 SET(SIMGRID_HAVE_MC 0)
375 mark_as_advanced(PATH_LIBDW_H)
376 mark_as_advanced(PATH_LIBDW_LIB)
378 if (enable_model-checking AND enable_ns3)
379 message(FATAL_ERROR "Cannot activate both model-checking and NS3 bindings: NS3 pull too much dependencies for the MC to work")
384 if("${CMAKE_SYSTEM}" MATCHES "Darwin|FreeBSD|Linux")
386 SET(HAVE_PRIVATIZATION 1)
388 message (STATUS "Warning: no support for SMPI automatic privatization on this platform")
389 SET(HAVE_PRIVATIZATION 0)
395 #--------------------------------------------------------------------------------------------------
396 ### Initialize of CONTEXT THREADS
398 set(HAVE_THREAD_CONTEXTS 0)
399 if(CMAKE_USE_PTHREADS_INIT)
400 ### Test that we have a way to create semaphores
403 CHECK_LIBRARY_EXISTS(pthread sem_open "" HAVE_SEM_OPEN_LIB)
404 if(HAVE_SEM_OPEN_LIB)
405 try_run(semopen_retval semopen_compilable
407 ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_sem_open.c
408 LINK_LIBRARIES pthread
409 COMPILE_OUTPUT_VARIABLE semopen_compilmsg
410 RUN_OUTPUT_VARIABLE semopen_runmsg)
412 if(semopen_compilable)
413 if(NOT semopen_retval) #Â error if not 0
414 message(STATUS "sem_open is compilable and executable")
417 message(STATUS "Warning: sem_open seems compilable but not executable")
418 message(STATUS "Compilation output: ${semopen_compilmsg}")
419 message(STATUS "Execution output: ${semopen_runmsg}")
420 message(STATUS "Exit value: ${semopen_retval}")
423 message(STATUS "Warning: sem_open not compilable")
424 message(STATUS "Compilation output: ${semopen_compilmsg}")
426 unset(semopen_compilable)
427 unset(semopen_retval)
428 unset(semopen_runmsg)
429 unset(semopen_compilmsg)
433 if(NOT APPLE) # OS X El Capitan deprecates this function
434 CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB)
436 if(HAVE_SEM_INIT_LIB)
437 try_run(seminit_retval seminit_compilable
439 ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_sem_init.c
440 LINK_LIBRARIES pthread
441 COMPILE_OUTPUT_VARIABLE seminit_compilmsg
442 RUN_OUTPUT_VARIABLE seminit_runmsg)
444 if(seminit_compilable)
445 if(NOT seminit_retval) #Â error if not 0
446 message(STATUS "sem_init is compilable and executable")
449 message(STATUS "Warning: sem_init seems compilable but not executable")
450 message(STATUS "Compilation output: ${seminit_compilmsg}")
451 message(STATUS "Execution output: ${seminit_runmsg}")
452 message(STATUS "Exit value: ${seminit_retval}")
455 message(STATUS "Warning: sem_init not compilable")
456 message(STATUS "Compilation output: ${seminit_compilmsg}")
458 unset(seminit_compilable)
459 unset(seminit_retval)
460 unset(seminit_runmsg)
461 unset(seminit_compilmsg)
464 if(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT)
465 message(FATAL_ERROR "Semaphores are not usable (failed to use both sem_open and sem_init), but they are mandatory to threads (you may need to mount /dev).")
468 set(HAVE_THREAD_CONTEXTS 1)
469 message(STATUS "Support for thread context factory ok.")
472 set(HAVE_UCONTEXT_CONTEXTS 0)
473 if(NOT HAVE_UCONTEXT_H)
474 message(STATUS "No ucontext factory: <ucontext.h> not found.")
476 message(STATUS "No ucontext factory: Apple don't want us to use them.")
477 set(HAVE_UCONTEXT_H 0)
479 try_compile(compile_makecontext ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_makecontext.c
480 OUTPUT_VARIABLE compile_makecontext_output)
482 #If can have both context
483 if(compile_makecontext)
484 set(HAVE_UCONTEXT_CONTEXTS 1)
485 message(STATUS "Support for ucontext factory ok.")
487 message(STATUS "Error: <ucontext.h> exists, but makecontext is not compilable. Compilation output:\n ${compile_makecontext_output}")
488 message(STATUS "No ucontext factory: makecontext() is not compilable.")
491 # Stack setup (size and address)
492 try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
493 ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
494 RUN_OUTPUT_VARIABLE stack_setup)
496 LIST(LENGTH stack_setup stack_setup_len)
497 if("${stack_setup_len}" STREQUAL "2")
498 LIST(GET stack_setup 0 makecontext_addr)
499 LIST(GET stack_setup 1 makecontext_size)
500 set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
501 set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
503 message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
507 # Stack growth direction (upward or downward). Used for the following contexts: SysV, raw, Boost
508 try_run(RUN_stackgrowth_VAR COMPILE_stackgrowth_VAR
510 ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stackgrowth.c
511 RUN_OUTPUT_VARIABLE stack
512 COPY_FILE test_stackgrowth)
514 if("${stack}" STREQUAL "down")
515 set(PTH_STACKGROWTH "-1")
516 elseif("${stack}" STREQUAL "up")
517 set(PTH_STACKGROWTH "1")
519 if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
520 set(PTH_STACKGROWTH "-1")
521 elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
522 set(PTH_STACKGROWTH "-1")
524 message(FATAL_ERROR "Could not figure out the stack direction. Test prog returned: ${stack}; CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}.")
527 # If the test ran well, remove the test binary
528 file(REMOVE test_stackgrowth)
529 #--------------------------------------------------------------------------------------------------
531 ### check for addr2line
532 find_path(ADDR2LINE NAMES addr2line PATHS NO_DEFAULT_PATHS)
534 set(ADDR2LINE "${ADDR2LINE}/addr2line")
540 if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/)
544 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
545 OUTPUT_VARIABLE remote
546 OUTPUT_STRIP_TRAILING_WHITESPACE)
547 #message(STATUS "Git remote: ${remote}")
548 execute_process(COMMAND git config --get remote.${remote}.url
549 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
551 OUTPUT_STRIP_TRAILING_WHITESPACE)
552 #message(STATUS "Git url: ${url}")
554 execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=oneline --abbrev-commit -1
555 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
556 OUTPUT_VARIABLE GIT_VERSION
557 OUTPUT_STRIP_TRAILING_WHITESPACE)
558 message(STATUS "Git version: ${GIT_VERSION}")
560 execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log -n 1 --pretty=format:%ai .
561 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
562 OUTPUT_VARIABLE GIT_DATE
563 OUTPUT_STRIP_TRAILING_WHITESPACE)
564 message(STATUS "Git date: ${GIT_DATE}")
565 string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
567 execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=format:%H -1
568 WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
569 OUTPUT_VARIABLE SIMGRID_GITHASH
570 OUTPUT_STRIP_TRAILING_WHITESPACE)
572 elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion)
573 FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION)
575 set(GIT_VERSION "none, release version")
578 ### Setup gcc & clang flags
580 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/GCCFlags.cmake)
583 ### Generate the required headers and scripts
584 #############################################
586 # Avoid triggering a (full) rebuild by touching the files if they did not really change
587 configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE)
588 configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated" @ONLY IMMEDIATE)
589 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h)
590 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/config.h)
591 file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated)
592 file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated)
594 # We need two versions of the SMPI scripts because they contain the path to the library
595 # so, it depends of whether SimGrid is installed, or run from the sources (during the build)
597 file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definitions shared amongst all SMPI scripts, inlined in each of them
599 ### SMPI script used when simgrid is installed
600 set(exec_prefix ${CMAKE_INSTALL_PREFIX})
601 set(includeflag "-I${CMAKE_INSTALL_PREFIX}/include -I${CMAKE_INSTALL_PREFIX}/include/smpi")
602 set(includedir "${CMAKE_INSTALL_PREFIX}/include")
603 set(libdir ${exec_prefix}/lib)
604 set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib")
606 set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
608 set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
609 set(SMPIMAIN ${libdir}/simgrid/smpimain)
611 configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/mpif.h @ONLY)
612 #configure mpif.f90 to build mpi.mod
614 set(MODULE_MPIF_IN "module mpi")
615 set(MODULE_MPIF_OUT "end module mpi")
616 configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90.generated @ONLY)
617 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90.generated ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90)
618 set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include/smpi)
619 add_library(mpi SHARED ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90)
622 foreach(script cc cxx ff f90 run)
623 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/bin/smpi${script} @ONLY)
626 ### SMPI scripts used when compiling simgrid
627 set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/")
628 set(includeflag "-I${CMAKE_HOME_DIRECTORY}/include -I${CMAKE_HOME_DIRECTORY}/include/smpi")
629 set(includeflag "${includeflag} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/smpi")
630 set(includedir "${CMAKE_HOME_DIRECTORY}/include")
631 set(libdir "${CMAKE_BINARY_DIR}/lib")
632 set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_BINARY_DIR}/lib")
634 set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
636 set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
637 set(SMPIMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpimain)
639 foreach(script cc cxx ff f90 run)
640 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script} @ONLY)
644 foreach(script cc cxx ff f90 run)
645 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpi${script})
646 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script})
650 set(generated_headers_to_install
651 ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
652 ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid/config.h
655 set(generated_headers ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h )
657 set(generated_files_to_clean
659 ${generated_headers_to_install}
660 ${CMAKE_BINARY_DIR}/bin/smpicc
661 ${CMAKE_BINARY_DIR}/bin/smpicxx
662 ${CMAKE_BINARY_DIR}/bin/smpiff
663 ${CMAKE_BINARY_DIR}/bin/smpif90
664 ${CMAKE_BINARY_DIR}/bin/smpirun
665 ${CMAKE_BINARY_DIR}/bin/colorize
666 ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
667 ${CMAKE_BINARY_DIR}/examples/smpi/tracing/smpi_traced.trace
670 if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
671 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt COPYONLY)
672 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt COPYONLY)
673 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allreduce.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allreduce.txt COPYONLY)
674 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_barrier.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_barrier.txt COPYONLY)
675 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_bcast.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_bcast.txt COPYONLY)
676 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_with_isend.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_with_isend.txt COPYONLY)
677 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_alltoall.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoall.txt COPYONLY)
678 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_alltoallv.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoallv.txt COPYONLY)
679 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_waitall.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_waitall.txt COPYONLY)
680 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_reducescatter.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_reducescatter.txt COPYONLY)
681 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_gather.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_gather.txt COPYONLY)
682 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allgatherv.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allgatherv.txt COPYONLY)
683 configure_file(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hostfile ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile COPYONLY)
684 configure_file(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hostfile_cluster ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile_cluster COPYONLY)
685 configure_file(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hostfile_coll ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile_coll COPYONLY)
687 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/description_file ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/description_file COPYONLY)
688 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/README ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/README COPYONLY)
689 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple/smpi_replay.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/smpi_replay.txt COPYONLY)
690 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)
691 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)
692 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)
693 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)
694 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)
695 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)
696 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)
697 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)
698 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)
699 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)
700 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)
701 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)
702 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)
703 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)
704 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)
705 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)
706 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)
707 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)
708 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)
709 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)
710 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)
711 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)
712 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)
713 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)
714 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)
715 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)
716 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)
717 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)
718 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)
719 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)
720 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)
721 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)
723 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/compute_only.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/compute_only.txt COPYONLY)
724 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/compute_only/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/compute_only/actions0.txt COPYONLY)
725 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/compute_only/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/compute_only/actions1.txt COPYONLY)
726 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/empty.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/empty.txt COPYONLY)
727 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/empty/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/empty/actions0.txt COPYONLY)
728 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/empty/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/empty/actions1.txt COPYONLY)
729 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/mixed.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/mixed.txt COPYONLY)
730 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/mixed/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/mixed/actions0.txt COPYONLY)
731 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/mixed/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/mixed/actions1.txt COPYONLY)
732 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/workload_compute ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute COPYONLY)
733 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive COPYONLY)
734 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive2 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive2 COPYONLY)
735 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/workload_compute_simple ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute_simple COPYONLY)
736 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time COPYONLY)
737 configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time_and_resources ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time_and_resources COPYONLY)
739 set(generated_files_to_clean
740 ${generated_files_to_clean}
741 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt
742 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt
743 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allreduce.txt
744 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_barrier.txt
745 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_bcast.txt
746 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_with_isend.txt
747 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoall.txt
748 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoallv.txt
749 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_waitall.txt
750 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_gather.txt
751 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allgatherv.txt
752 ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_reducescatter.txt
753 ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile
754 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/description_file
755 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/README
756 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/smpi_replay.txt
757 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace0.txt
758 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace1.txt
759 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace2.txt
760 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace3.txt
761 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace4.txt
762 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace5.txt
763 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace6.txt
764 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace7.txt
765 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace8.txt
766 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace9.txt
767 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace10.txt
768 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace11.txt
769 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace12.txt
770 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace13.txt
771 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace14.txt
772 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace15.txt
773 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace16.txt
774 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace17.txt
775 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace18.txt
776 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace19.txt
777 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace20.txt
778 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace21.txt
779 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace22.txt
780 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace23.txt
781 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace24.txt
782 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace25.txt
783 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace26.txt
784 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace27.txt
785 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace28.txt
786 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace29.txt
787 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace30.txt
788 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple/ti_traces_32_1/ti_trace31.txt
789 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/compute_only.txt
790 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/compute_only/actions0.txt
791 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/compute_only/actions1.txt
792 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/empty.txt
793 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/empty/actions0.txt
794 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/empty/actions1.txt
795 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/mixed.txt
796 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/mixed/actions0.txt
797 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/mixed/actions1.txt
798 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.tesh
799 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute
800 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive
801 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive2
802 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_compute_simple
803 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_empty1
804 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_empty2
805 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_empty2_same_resources
806 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_empty2_same_time
807 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_empty2_same_time_and_resources
808 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed1
809 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2
810 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_resources
811 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time
812 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time_and_resources
813 ${CMAKE_BINARY_DIR}/examples/smpi/replay_multiple_manual_deploy/workload_nojob
817 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
818 "${generated_files_to_clean}")
820 ### Define source packages for Libs
821 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/DefinePackages.cmake)
823 ### Build some Maintainer files
824 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
825 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/UnitTesting.cmake)
829 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
831 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLibWin.cmake)
835 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Java.cmake)
839 if(enable_memcheck_xml)
840 set(enable_memcheck true)
845 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Tests.cmake)
846 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/CTestConfig.cmake)
848 ### Define subdirectories
849 foreach(cmakefile ${CMAKEFILES_TXT})
850 string(REPLACE "/CMakeLists.txt" "" repository ${cmakefile})
851 add_subdirectory("${CMAKE_HOME_DIRECTORY}/${repository}")
854 ### Setup the distrib
855 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Distrib.cmake)
857 ### Build the docs if asked to
858 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Documentation.cmake)
860 ### Print the result of configuration
862 message("##########################################")
863 message("#### Content of src/internal_config.h ####")
864 message("##########################################")
865 file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h config_output)
866 LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 10) # Pass the file header
867 foreach(line ${config_output})
870 message("##########################################")
871 message("#### Content of simgrid/config.h ####")
872 message("##########################################")
873 file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid/config.h config_output)
874 LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 -1) # Pass the file header
875 foreach(line ${config_output})
878 message("##########################################")
879 message("#### End of configuration headers ####")
880 message("##########################################")
882 message("\nConfiguration of package `simgrid':")
883 message(" Home directory ..............: ${CMAKE_HOME_DIRECTORY}")
884 message(" Build Name ..................: ${BUILDNAME}")
885 message(" Cmake Generator .............: ${CMAKE_GENERATOR}")
886 message(" Site ........................: ${SITE}")
887 message(" Install prefix ..............: ${CMAKE_INSTALL_PREFIX}")
889 message(" Release .....................: simgrid-${release_version}${SIMGRID_VERSION_EXTRA} (release build)")
891 message(" Release .....................: simgrid-${release_version}${SIMGRID_VERSION_EXTRA} (development build)")
894 message(" Compiler: C .................: ${CMAKE_C_COMPILER} (id: ${CMAKE_C_COMPILER_ID})")
895 message(" version .............: ${CMAKE_C_COMPILER_VERSION}")
896 message(" is gnu ..............: ${CMAKE_COMPILER_IS_GNUCC}")
897 message(" Compiler: C++ ...............: ${CMAKE_CXX_COMPILER} (id: ${CMAKE_CXX_COMPILER_ID})")
898 message(" version .............: ${CMAKE_CXX_COMPILER_VERSION}")
900 message(" Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}")
901 message(" version .............: ${Java_VERSION_STRING}")
903 if(CMAKE_Fortran_COMPILER)
904 message(" Compiler: Fortran ...........: ${SMPI_Fortran_COMPILER} (id: ${CMAKE_Fortran_COMPILER_ID})")
905 message(" version .............: ${CMAKE_Fortran_COMPILER_VERSION}")
907 message(" Linker: .....................: ${CMAKE_LINKER}")
908 message(" version .............: ${LINKER_VERSION}")
909 message(" Make program: ...............: ${CMAKE_MAKE_PROGRAM}")
911 message(" CFlags ......................: ${CMAKE_C_FLAGS}")
912 message(" CXXFlags ....................: ${CMAKE_CXX_FLAGS}")
913 message(" LDFlags .....................: ${CMAKE_C_LINK_FLAGS}")
914 message(" with LTO ....................: ${enable_lto}")
917 if (SIMGRID_HAVE_NS3)
918 message(" Compile NS-3 ................: yes (path: ${NS3_PATH})")
920 message(" Compile NS-3 ................: NO (hint: ${NS3_HINT})")
924 message(" Compile Java ................: yes")
925 message(" Native lib in jar .........: ${enable_lib_in_jar}")
927 message(" Compile Java ................: NO")
929 message(" Compile Lua .................: ${SIMGRID_HAVE_LUA}")
930 message(" Compile Smpi ................: ${HAVE_SMPI}")
931 message(" Smpi fortran ..............: ${SMPI_FORTRAN}")
932 message(" MPICH3 testsuite ..........: ${enable_smpi_MPICH3_testsuite}")
933 message(" Privatization .............: ${HAVE_PRIVATIZATION}")
934 message(" PAPI support...............: ${HAVE_PAPI}")
935 message(" Compile Boost.Context support: ${HAVE_BOOST_CONTEXTS}")
937 message(" Maintainer mode .............: ${enable_maintainer_mode}")
938 message(" Documentation................: ${enable_documentation}")
939 message(" Model checking ..............: ${SIMGRID_HAVE_MC}")
940 message(" Jedule mode ................: ${SIMGRID_HAVE_JEDULE}")
941 message(" Graphviz mode ...............: ${HAVE_GRAPHVIZ}")
942 message(" Mallocators .................: ${enable_mallocators}")
944 message(" Simgrid dependencies ........: ${SIMGRID_DEP}")
947 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/Testing/Notes/)
948 file(WRITE ${PROJECT_BINARY_DIR}/Testing/Notes/Build "GIT version : ${GIT_VERSION}\n")
949 file(APPEND ${PROJECT_BINARY_DIR}/Testing/Notes/Build "Release : simgrid-${release_version}\n")