Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This test really look wrong. Fix it.
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index eaf6c29..6f12e9b 100644 (file)
@@ -9,7 +9,7 @@ set(CMAKE_MODULE_PATH
 
 ### Determine the assembly flavor that we need today
 include(CMakeDetermineSystem)
-IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64")
+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)
@@ -73,15 +73,12 @@ include(TestBigEndian)
 TEST_BIG_ENDIAN(BIGENDIAN)
 
 include(FindGraphviz)
+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)
@@ -102,6 +99,13 @@ if(enable_ns3)
   include(FindNS3)
 endif()
 
+find_package(Boost REQUIRED)
+if(Boost_FOUND)
+  include_directories(${Boost_INCLUDE_DIRS})
+else()
+  message(FATAL_ERROR, "Failed to find Boost libraries")
+endif()
+
 # Checks for header libraries functions.
 CHECK_LIBRARY_EXISTS(pthread pthread_create          "" pthread)
 CHECK_LIBRARY_EXISTS(pthread sem_init                "" HAVE_SEM_INIT_LIB)
@@ -152,7 +156,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(
@@ -162,16 +165,16 @@ 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(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD...
   set(HAVE_UCONTEXT_H 1)
@@ -221,6 +224,13 @@ else()
   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()
+
 #--------------------------------------------------------------------------------------------------
 ### Check for some architecture dependent values
 CHECK_TYPE_SIZE(int SIZEOF_INT)
@@ -806,6 +816,7 @@ if(HAVE_NS3_LIB)
 endif()
 set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
 
+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)