X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7464efd30359d41efbe4d9ed402b7192183d1f4c..d1181eb8d2c8e9b1d3250fb78cba6b67769eecee:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0252eedf9f..1276c4d157 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,8 +194,8 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64") message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)") set(PROCESSOR_x86_64 1) ENDIF() - if (MSVC) - message(STATUS "Disable fast raw contextes on Microsoft Visual.") + if (WIN32) + message(STATUS "Disable fast raw contextes on Windows.") else() set(HAVE_RAW_CONTEXTS 1) endif() @@ -226,6 +226,10 @@ if(enable_ns3) endif() endif() +if(WIN32) + set(Boost_USE_STATIC_LIBS 1) +endif() + find_package(Boost 1.48) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) @@ -277,7 +281,7 @@ else() set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") endif() -CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_VALGRIND_H) +CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_H) CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H) CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H) @@ -307,8 +311,8 @@ endif() execute_process( COMMAND "${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_thread_storage.c" WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - RESULT_VARIABLE HAVE_thread_storage_run - ) + RESULT_VARIABLE HAVE_thread_storage_run) + if(HAVE_thread_storage_run) set(HAVE_THREAD_LOCAL_STORAGE 1) @@ -332,31 +336,26 @@ else() SET(HAVE_MMALLOC 0) endif() -set(HAVE_UCONTEXT_CONTEXTS 0) -set(HAVE_THREAD_CONTEXTS 0) - if(enable_jedule) set(HAVE_JEDULE 1) endif() if(enable_mallocators) - SET(MALLOCATOR_IS_WANTED 1) + SET(HAVE_MALLOCATOR 1) else() - SET(MALLOCATOR_IS_WANTED 0) + SET(HAVE_MALLOCATOR 0) endif() 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") + message(STATUS "Warning: support for model-checking has been disabled because you are missing either mmap or __thread.") endif() SET(HAVE_MC 0) SET(HAVE_MMALLOC 0) - SET(MMALLOC_WANT_OVERRIDE_LEGACY 0) endif() if(enable_smpi) @@ -411,6 +410,8 @@ endif() #-------------------------------------------------------------------------------------------------- ### Initialize of CONTEXT THREADS +set(HAVE_THREAD_CONTEXTS 0) + if(HAVE_PTHREAD) ### Test that we have a way to create semaphores @@ -502,14 +503,12 @@ if(HAVE_PTHREAD) message(FATAL_ERROR "Semaphores are not usable (neither sem_open nor sem_init is both compilable and executable), but they are mandatory to threads (you may need to mount /dev).") endif() -endif() - -if(HAVE_PTHREAD) set(HAVE_THREAD_CONTEXTS 1) message("-- Support for thread context factory ok.") endif() +set(HAVE_UCONTEXT_CONTEXTS 0) if(NOT HAVE_UCONTEXT_H) message("-- No ucontext factory: not found.") elseif(APPLE) @@ -542,30 +541,30 @@ else() else() message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}") endif() - - # Stack growth direction (upward or downward) - try_run(RUN_stackgrowth_VAR COMPILE_stackgrowth_VAR - ${CMAKE_BINARY_DIR} - ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stackgrowth.c - RUN_OUTPUT_VARIABLE stack - COPY_FILE test_stackgrowth) - - if("${stack}" STREQUAL "down") +endif() + +# Stack growth direction (upward or downward). Used for the following contexts: SysV, raw, Boost +try_run(RUN_stackgrowth_VAR COMPILE_stackgrowth_VAR + ${CMAKE_BINARY_DIR} + ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stackgrowth.c + RUN_OUTPUT_VARIABLE stack + COPY_FILE test_stackgrowth) + +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") - 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(FATAL_ERROR "Could not figure out the stack direction. Test prog returned: ${stack}; CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}.") - endif() + message(FATAL_ERROR "Could not figure out the stack direction. Test prog returned: ${stack}; CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}.") endif() - # If the test ran well, remove the test binary - execute_process(COMMAND ${CMAKE_COMMAND} -E remove test_stackgrowth) endif() +# If the test ran well, remove the test binary +execute_process(COMMAND ${CMAKE_COMMAND} -E remove test_stackgrowth) #-------------------------------------------------------------------------------------------------- ### check for addr2line @@ -868,12 +867,22 @@ endif() message("") message("##########################################") message("#### Content of src/internal_config.h ####") +message("##########################################") file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h config_output) LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8) # Pass the file header foreach(line ${config_output}) message(" ${line}") endforeach() -message("#### end of src/internal_config.h ####") +message("##########################################") +message("#### Content of simgrid_config.h ####") +message("##########################################") +file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h config_output) +LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 -1) # Pass the file header +foreach(line ${config_output}) + message(" ${line}") +endforeach() +message("##########################################") +message("#### End of configuration headers ####") message("##########################################") message("\nConfiguration of package `simgrid':")