X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d509dd175e358ed71fd0ef4337539ac460f2d2aa..676dd48901ce7d305ce1275956aa19c640b27689:/buildtools/Cmake/CompleteInFiles.cmake diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 456f61097c..ec44421d5c 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -75,10 +75,6 @@ TEST_BIG_ENDIAN(BIGENDIAN) include(FindGraphviz) include(FindLibSigc++) -set(HAVE_GTNETS 0) -if(enable_gtnets) - include(FindGTnets) -endif() if(enable_java) find_package(Java REQUIRED COMPONENTS Runtime Development) find_package(JNI REQUIRED) @@ -99,27 +95,39 @@ endif() if(enable_lua) include(FindLua51Simgrid) endif() + +set(HAVE_GTNETS 0) +if(enable_gtnets) + include(FindGTnets) + if (NOT HAVE_GTNETS) + message(FATAL_ERROR "Cannot find GTNetS. Please install it, or disable that cmake option") + endif() +endif() set(HAVE_NS3 0) if(enable_ns3) include(FindNS3) + if (NOT HAVE_NS3) + message(FATAL_ERROR "Cannot find NS3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option") + endif() 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 COMPONENTS context) +find_package(Boost 1.48) 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')") + if(APPLE) + 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") + message(FATAL_ERROR "Failed to find Boost libraries." + "Did you install libboost-dev and libboost-context-dev?" + "(libboost-context-dev is optional)") endif() endif() +# Try again to see if we have libboost-context +find_package(Boost 1.42 COMPONENTS context) +set(Boost_FOUND 1) # We don't care of whether this component is missing + if(Boost_FOUND AND Boost_CONTEXT_FOUND) # We should use feature detection for this instead: if (Boost_VERSION LESS 105600) @@ -130,13 +138,15 @@ if(Boost_FOUND AND Boost_CONTEXT_FOUND) set(HAVE_BOOST_CONTEXT 2) endif() else() + message (" boost : found.") + message (" boost-context: missing. Install libboost-context-dev for this optional feature.") set(HAVE_BOOST_CONTEXT 0) 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 pthread_create "" HAVE_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) @@ -218,6 +228,7 @@ else() SET(HAVE_MMALLOC 0) endif() + if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD... set(HAVE_UCONTEXT_H 1) set(HAVE_MAKECONTEXT 1) @@ -266,7 +277,15 @@ endif() if(enable_smpi) include(FindGFortran) + #really checks for objdump for privatization + find_package(BinUtils QUIET) SET(HAVE_SMPI 1) + + if( NOT "${CMAKE_OBJDUMP}" MATCHES "CMAKE_OBJDUMP-NOTFOUND" AND HAVE_MMAP) + SET(HAVE_PRIVATIZATION 1) + else() + SET(HAVE_PRIVATIZATION 0) + endif() endif() #-------------------------------------------------------------------------------------------------- @@ -314,13 +333,13 @@ endif() #-------------------------------------------------------------------------------------------------- ### Initialize of CONTEXT THREADS -if(pthread) +if(HAVE_PTHREAD) set(pthread 1) elseif(pthread) set(pthread 0) endif() -if(pthread) +if(HAVE_PTHREAD) ### Test that we have a way to create semaphores if(HAVE_SEM_OPEN_LIB) @@ -479,7 +498,7 @@ if(HAVE_UCONTEXT) message("-- Support for ucontext factory") endif() -if(pthread) +if(HAVE_PTHREAD) set(CONTEXT_THREADS 1) message("-- Support for thread context factory") endif() @@ -533,15 +552,15 @@ elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion) endif() if(release) - set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING}\\nRelease build") + set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER}\\nRelease build") else() - set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING}\\nDevelopment build") + set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER}\\nDevelopment build") endif() if(GIT_VERSION) - set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING} at commit ${GIT_VERSION}") + set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER} at commit ${GIT_VERSION}") endif() if(GIT_DATE) - set(SIMGRID_VERSION_STRING "${SIMGRID_VERSION_STRING} (${GIT_DATE})") + set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER} (${GIT_DATE})") endif() #-------------------------------------------------------------------------------------------------- @@ -819,8 +838,8 @@ 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}") +if(NS3_LIBRARY_PATH) + set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}") endif() set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"") @@ -841,8 +860,8 @@ 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}") +if(NS3_LIBRARY_PATH) + set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}") endif() set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"") set(libdir "${CMAKE_BINARY_DIR}/lib")