Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'adrien' into 'master'
[simgrid.git] / CMakeLists.txt
index 8d45268..bae099b 100644 (file)
@@ -179,7 +179,7 @@ if(WIN32)
   unset(CMAKE_INCLUDE_WIN)
 endif()
 
-# library dependency cannot start with a space (CMP0004), so initialize it with something that is never desactivated.
+# library dependency cannot start with a space (CMP0004), so initialize it with something that is never deactivated.
 set(SIMGRID_DEP "-lm") 
 
 ### Determine the assembly flavor that we need today
@@ -197,6 +197,8 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   ENDIF()
   if (WIN32)
     message(STATUS "Disable fast raw contexts on Windows.")
+  elseif(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+    message(STATUS "Disable fast raw contexts on x32 ABI.")
   else()
     set(HAVE_RAW_CONTEXTS 1)
   endif()
@@ -228,7 +230,7 @@ if(enable_ns3)
   include(FindNS3)
   if (SIMGRID_HAVE_NS3)
     set(SIMGRID_HAVE_NS3 1)
-    foreach(lib core csma point-to-point internet network applications)
+    foreach(lib core csma point-to-point internet network applications wifi)
       set(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
     endforeach()
   else()
@@ -553,10 +555,10 @@ file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definiti
 
 ### SMPI script used when simgrid is installed
 set(exec_prefix ${CMAKE_INSTALL_PREFIX})
-set(includeflag "-I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR} -I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/smpi")
 set(includedir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
 set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_LIBDIR}")
+set(includeflag "-I${includedir} -I${includedir}/smpi")
+set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${libdir}")
 if(NS3_LIBRARY_PATH)
   set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
 endif()
@@ -581,17 +583,17 @@ endforeach()
 
 ### SMPI scripts used when compiling simgrid 
 set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/")
-set(includeflag "-I${CMAKE_HOME_DIRECTORY}/include -I${CMAKE_HOME_DIRECTORY}/include/smpi")
-set(includeflag "${includeflag} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/smpi")
 set(includedir "${CMAKE_HOME_DIRECTORY}/include")
 set(libdir "${CMAKE_BINARY_DIR}/lib")
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_BINARY_DIR}/lib")
+set(includeflag "-I${includedir} -I${includedir}/smpi")
+set(includeflag "${includeflag} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/smpi")
+set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${libdir}")
 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(SMPIMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpimain)
-set(SMPIREPLAYMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpireplaymain)
+set(SMPIMAIN ${libdir}/simgrid/smpimain)
+set(SMPIREPLAYMAIN ${libdir}/simgrid/smpireplaymain)
 
 foreach(script cc cxx ff f90 run)
   configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script} @ONLY)
@@ -854,7 +856,15 @@ if(enable_python)
     target_link_libraries(python-bindings PUBLIC simgrid)
     set_target_properties(python-bindings PROPERTIES
                           LIBRARY_OUTPUT_NAME simgrid
-                          CXX_VISIBILITY_PRESET "default")
+                          CXX_VISIBILITY_PRESET "default"
+                          INTERPROCEDURAL_OPTIMIZATION FALSE)
+    # LTO is disabled here from the python bindings because this makes a
+    # cmake warning about CMP0069 even when this policy is set. This
+    # problem may be in cmake, in pybind11 or even in our code, not sure.
+    # It may get eventually solved in cmake or pybind11. Or not.
+    # The sure thing is that our python bindings are in one file only,
+    # so there is no need for LTO here. Problem solved :)
+
     add_dependencies(tests python-bindings)
     set_property(TARGET python-bindings
                  APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")