# Build the version number
set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "29")
+set(SIMGRID_VERSION_MINOR "32")
set(SIMGRID_VERSION_PATCH "1") # odd => git branch; even => stable release or released snapshot
if(${SIMGRID_VERSION_PATCH} EQUAL "0")
set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}")
endif()
+if(WIN32 OR MINGW)
+ message(FATAL_ERROR "SimGrid does not build on native windows, nor with MinGW. Please use WSL2 instead.")
+endif()
+
message(STATUS "Configuring SimGrid v${release_version}")
set(SIMGRID_VERSION_STRING "SimGrid version ${release_version}")
set(libsimgrid_version "${release_version}")
-set(libsimgrid-java_version "${release_version}")
# Basic checks on cmake
-cmake_minimum_required(VERSION 3.5)
-#for lto, to avoid warning (should be removed when switching to requiring cmake >= 3.9)
-if(NOT CMAKE_VERSION VERSION_LESS "3.9")
- cmake_policy(SET CMP0069 NEW)
-endif()
+cmake_minimum_required(VERSION 3.12)
+# once we move CMake to >= 3.13, we should use target_link_option in examples/sthread
+# once we move CMake to >= 3.13.1, we could get rid of _Boost_STACKTRACE_BACKTRACE_HEADERS
message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules)
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Check for the compiler #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
-##
+##
## Check the C/C++ standard that we need
## See also tools/cmake/Flags.cmake that sets our paranoid warning flags
INCLUDE(CheckCCompilerFlag)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
-if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
+if (CMAKE_COMPILER_IS_GNUCC)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0")
message(FATAL_ERROR
- "SimGrid needs at least g++ version 5.0 to compile but you have ${CMAKE_CXX_COMPILER_VERSION}."
- "You need a sufficient support of c++14 to compile SimGrid.")
+ "SimGrid needs at least g++ version 7.0 to compile but you have ${CMAKE_CXX_COMPILER_VERSION}."
+ "You need a sufficient support of c++17 to compile SimGrid.")
endif()
endif()
-## We need a decent support of the C++14 and C11 standards
-set(CMAKE_CXX_STANDARD 14)
+## We need a decent support of the C++17 and C11 standards
+set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Option.cmake)
### SMPI vs. Fortran
-if ((NOT DEFINED enable_smpi) OR enable_smpi)
+if ((NOT DEFINED enable_smpi) OR enable_smpi)
# First unset the compiler in case we're re-running cmake over a previous
# configuration where it was saved as smpiff
unset(CMAKE_Fortran_COMPILER)
-
+
SET(SMPI_FORTRAN 0)
if(enable_fortran)
enable_language(Fortran OPTIONAL)
endif()
-
+
if(CMAKE_Fortran_COMPILER)
# Fortran compiler detected: save it, then replace by smpiff
endif()
-### SET THE LIBRARY EXTENSION
+### SET THE LIBRARY EXTENSION
if(APPLE)
set(LIB_EXE "dylib")
-elseif(WIN32)
- set(LIB_EXE "a")
- set(BIN_EXE ".exe")
else()
set(LIB_EXE "so")
endif()
endif()
# tesh.py needs python 3 (or the module python-subprocess32 on python2.8+)
-if(CMAKE_VERSION VERSION_LESS "3.12")
- set(PythonInterp_FIND_VERSION 3)
- set(PythonInterp_FIND_VERSION_COUNT 1)
- set(PythonInterp_FIND_VERSION_MAJOR 3)
- include(FindPythonInterp)
- if(NOT PYTHONINTERP_FOUND)
- message(FATAL_ERROR "Please install Python (version 3 or higher) to compile SimGrid.")
- endif()
-else()
- find_package(Python3 COMPONENTS Interpreter Development)
- if(NOT Python3_Interpreter_FOUND)
- message(FATAL_ERROR "Please install Python (version 3 or higher) to compile SimGrid.")
- endif()
- set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+find_package(Python3 COMPONENTS Interpreter)
+if(NOT Python3_Interpreter_FOUND)
+ message(FATAL_ERROR "Please install Python (version 3 or higher) to compile SimGrid.")
endif()
+set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
set(INTERNAL_INCLUDES
${CMAKE_BINARY_DIR}
${CMAKE_HOME_DIRECTORY}
- ${CMAKE_HOME_DIRECTORY}/src/include
)
if(enable_smpi)
set(INTERNAL_INCLUDES ${INTERNAL_INCLUDES} /usr/include/)
endif()
-if(WIN32)
- set(CMAKE_INCLUDE_WIN "${CMAKE_C_COMPILER}")
- set(CMAKE_LIB_WIN "${CMAKE_C_COMPILER}")
- string(REGEX REPLACE "/bin/gcc.*" "/include" CMAKE_INCLUDE_WIN "${CMAKE_INCLUDE_WIN}")
- string(REGEX REPLACE "/bin/gcc.*" "/lib" CMAKE_LIB_WIN "${CMAKE_LIB_WIN}")
- set(INTERNAL_INCLUDES ${INTERNAL_INCLUDES} ${CMAKE_INCLUDE_WIN})
- unset(CMAKE_INCLUDE_WIN)
-endif()
-
# library dependency cannot start with a space (CMP0004), so initialize it with something that is never deactivated.
-set(SIMGRID_DEP "-lm")
+set(SIMGRID_DEP "-lm")
### Determine the assembly flavor that we need today
set(HAVE_RAW_CONTEXTS 0)
include(CMakeDetermineSystem)
+foreach(arch i686 x86_64 arm64)
+ set(SIMGRID_PROCESSOR_${arch} 0)
+endforeach()
IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
IF(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
set(SIMGRID_PROCESSOR_i686 1)
- set(SIMGRID_PROCESSOR_x86_64 0)
ELSE()
message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
- set(SIMGRID_PROCESSOR_i686 0)
set(SIMGRID_PROCESSOR_x86_64 1)
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")
+ if(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()
+ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+ message(STATUS "System processor: arm64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
+ set(SIMGRID_PROCESSOR_arm64 1)
ELSE()
- set(SIMGRID_PROCESSOR_i686 0)
- set(SIMGRID_PROCESSOR_x86_64 0)
+ message(STATUS "System processor (${CMAKE_SYSTEM_PROCESSOR}) not explicitly accounted for")
ENDIF()
include(CheckFunctionExists)
include(CheckSymbolExists)
set(HAVE_GRAPHVIZ 0)
-set(SIMGRID_HAVE_LUA 0)
if(minimal-bindings)
- message(STATUS "Don't even look for graphviz nor lua, as we build minimal binding libraries.")
+ message(STATUS "Don't even look for graphviz, as we build minimal binding libraries.")
else()
include(FindGraphviz)
- if(enable_lua)
- include(FindLuaSimgrid)
- endif()
endif()
set(SIMGRID_HAVE_NS3 0)
if(enable_ns3)
include(FindNS3)
if (SIMGRID_HAVE_NS3)
- if (NS3_VERSION VERSION_LESS "3.28")
- message(FATAL_ERROR "SimGrid needs at least ns-3.28. Please upgrade or disable that cmake option.")
+ if (NOT NS3_VERSION EQUAL "3-dev" AND NS3_VERSION VERSION_LESS "3.28")
+ message(FATAL_ERROR "SimGrid needs ns-3 in version 3.28 or higher. Please upgrade or disable that cmake option.")
endif()
set(SIMGRID_HAVE_NS3 1)
- foreach(lib core csma point-to-point internet network applications wifi)
- set(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
- endforeach()
+ set(SIMGRID_DEP "${SIMGRID_DEP} ${NS3_LIBRARIES}")
else()
message(FATAL_ERROR "Cannot find ns-3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
endif()
endif()
-set(SIMGRID_HAVE_MSG 0)
-if(enable_msg)
- set(SIMGRID_HAVE_MSG 1)
-endif()
-
-if(WIN32)
- set(Boost_USE_STATIC_LIBS 1)
+### Check for Eigen library
+set(SIMGRID_HAVE_EIGEN3 0)
+find_package (Eigen3 3.3 CONFIG
+ HINTS ${EIGEN3_HINT})
+if (Eigen3_FOUND)
+ set(SIMGRID_HAVE_EIGEN3 1)
+ message(STATUS "Found Eigen3: ${EIGEN3_INCLUDE_DIR}")
+ include_directories(${EIGEN3_INCLUDE_DIR})
+ if ("3.3.4" VERSION_EQUAL EIGEN3_VERSION_STRING AND CMAKE_COMPILER_IS_GNUCC)
+ message(STATUS "Avoid build error of Eigen3 v3.3.4 using -Wno-error=int-in-bool-context")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=int-in-bool-context")
+ endif()
+else()
+ message(STATUS "Disabling model BMF because Eigen3 was not found. If it's installed, use EIGEN3_HINT to hint cmake about the location of Eigen3Config.cmake")
+endif()
+
+# Check for our JSON dependency
+set(SIMGRID_HAVE_JSON 0)
+find_package(nlohmann_json 3.7
+ HINTS ${nlohmann_json_HINT})
+if (nlohmann_json_FOUND)
+ set(SIMGRID_HAVE_JSON 1)
+ if (NOT NLOHMANN_JSON_INCLUDE_DIR)
+ get_target_property(NLOHMANN_JSON_INCLUDE_DIR nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
+ list(REMOVE_DUPLICATES NLOHMANN_JSON_INCLUDE_DIR)
+ else()
+ include_directories(${NLOHMANN_JSON_INCLUDE_DIR})
+ endif()
+ message(STATUS "Found nlohmann_json: ${NLOHMANN_JSON_INCLUDE_DIR}")
endif()
set(HAVE_PAPI 0)
set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
- if(minimal-bindings) # When we want a minimal jarfile, don't even search for boost optional components
+ if(minimal-bindings) # When we want a minimal python library, don't even search for boost optional components
message(STATUS "Don't even look for boost optional components, as we build minimal binding libraries.")
find_package(Boost 1.48)
else()
message(STATUS "Mandatory components found. SimGrid is compilable.")
endif()
endif()
- endif()
+ endif()
# Checks for header libraries functions.
CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
-elseif(MINGW)
- # Use the GNU version of unusual modifiers like PRIx64
- add_definitions(-D__USE_MINGW_ANSI_STDIO=1)
- set(CMAKE_REQUIRED_DEFINITIONS "-D__USE_MINGW_ANSI_STDIO=1")
else()
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
endif()
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
+if(NOT HAVE_SYSCONF)
+ message(FATAL_ERROR "Cannot build without sysconf.")
+endif()
CHECK_FUNCTION_EXISTS(process_vm_readv HAVE_PROCESS_VM_READV)
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
CHECK_SYMBOL_EXISTS(vasprintf stdio.h HAVE_VASPRINTF)
-if(MINGW)
- # The detection of vasprintf fails on MinGW, assumingly because it's
- # defined as an inline function in stdio.h instead of a regular
- # function. So force the result to be 1 despite of the test.
- set(HAVE_VASPRINTF 1)
-endif()
CHECK_INCLUDE_FILE("sys/sendfile.h" HAVE_SENDFILE_H)
CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
endif()
if(enable_model-checking AND NOT "${CMAKE_SYSTEM}" MATCHES "Linux|FreeBSD")
- message(WARNING "Support for model-checking has not been enabled on ${CMAKE_SYSTEM}: disabling it")
- set(enable_model-checking FALSE)
+ message(FATAL_ERROR "Support for model-checking has not been enabled on ${CMAKE_SYSTEM}. Please use a Linux docker to use the model checker.")
endif()
if(enable_model-checking AND minimal-bindings)
SET(enable_model-checking 0)
endif()
-if(enable_jedule)
- set(SIMGRID_HAVE_JEDULE 1)
-else()
- set(SIMGRID_HAVE_JEDULE 0)
-endif()
-
if(enable_mallocators)
SET(SIMGRID_HAVE_MALLOCATOR 1)
else()
include_directories(${LIBDW_INCLUDE_DIR} ${LIBELF_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBDW_LIBRARIES}")
set(SIMGRID_HAVE_MC 1)
- if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java)
- message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling the Java bindings.")
- set(enable_java FALSE)
- endif()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-4")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-4")
else()
- SET(SIMGRID_HAVE_MC 0)
+ SET(SIMGRID_HAVE_MC 0)
set(HAVE_MMALLOC 0)
endif()
mark_as_advanced(PATH_LIBDW_H)
mark_as_advanced(PATH_LIBDW_LIB)
-if(enable_java AND NOT enable_msg)
- message(FATAL_ERROR "Cannot activate the Java bindings without the MSG module. Either add -Denable_msg=ON or -Denable_java=OFF")
-endif()
-
if (enable_model-checking AND enable_ns3)
- message(FATAL_ERROR "Cannot activate both model-checking and ns-3 bindings: ns-3 pulls too much dependencies for the MC to work")
+ message(WARNING "Activating both model-checking and ns-3 bindings is considered experimental.")
endif()
if(enable_smpi)
SET(HAVE_SMPI 1)
- if(WIN32)
- message (STATUS "Warning: no support for SMPI automatic privatization on Windows.")
- SET(HAVE_PRIVATIZATION 0)
- else()
- SET(HAVE_PRIVATIZATION 1)
- endif()
+ SET(HAVE_PRIVATIZATION 1)
else()
SET(HAVE_SMPI 0)
endif()
OUTPUT_VARIABLE compile_makecontext_output)
#If can have both context
- if(compile_makecontext)
- set(HAVE_UCONTEXT_CONTEXTS 1)
- message(STATUS "Support for ucontext factory ok.")
- else()
+ if(NOT compile_makecontext)
message(STATUS "Error: <ucontext.h> exists, but makecontext is not compilable. Compilation output:\n ${compile_makecontext_output}")
message(STATUS "No ucontext factory: makecontext() is not compilable.")
- endif()
-
- # Stack setup (size and address)
- try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
- ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
- RUN_OUTPUT_VARIABLE stack_setup)
-
- LIST(LENGTH stack_setup stack_setup_len)
- if("${stack_setup_len}" STREQUAL "2")
- LIST(GET stack_setup 0 makecontext_addr)
- LIST(GET stack_setup 1 makecontext_size)
- set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
- set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
else()
- message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
+ message(STATUS "Support for ucontext factory ok.")
+ set(HAVE_UCONTEXT_CONTEXTS 1)
+
+ # Stack setup (size and address)
+ try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
+ ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
+ RUN_OUTPUT_VARIABLE stack_setup)
+
+ LIST(LENGTH stack_setup stack_setup_len)
+ if("${stack_setup_len}" STREQUAL "2")
+ LIST(GET stack_setup 0 makecontext_addr)
+ LIST(GET stack_setup 1 makecontext_size)
+ set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
+ set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
+ else()
+ message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
+ endif()
endif()
endif()
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
-set(includeflag "-I${includedir} -I${includedir}/smpi")
+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}")
set(MODULE_MPIF_OUT "end module mpi")
configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90.generated @ONLY)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90.generated ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90)
+ file(REMOVE ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90.generated)
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include/smpi)
add_library(mpi SHARED ${CMAKE_BINARY_DIR}/src/smpi/mpif.f90)
endif()
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/bin/smpi${script} @ONLY)
endforeach()
-### SMPI scripts used when compiling simgrid
+### SMPI scripts used when compiling simgrid
set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/")
set(includedir "${CMAKE_HOME_DIRECTORY}/include")
set(libdir "${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(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}")
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpi${script}.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script} @ONLY)
endforeach()
-if(NOT WIN32)
- foreach(script cc cxx ff f90 run)
- execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpi${script})
- execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script})
- endforeach()
-endif()
+foreach(script cc cxx ff f90 run)
+ execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpi${script})
+ execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpi${script})
+endforeach()
set(generated_headers_to_install
${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
${CMAKE_BINARY_DIR}/bin/smpiff
${CMAKE_BINARY_DIR}/bin/smpif90
${CMAKE_BINARY_DIR}/bin/smpirun
- ${CMAKE_BINARY_DIR}/bin/colorize
${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
${CMAKE_BINARY_DIR}/examples/smpi/tracing/smpi_traced.trace
)
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
### Make Libs
-if(NOT WIN32)
- include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
-else()
- include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLibWin.cmake)
-endif()
-
-if(enable_java)
- include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Java.cmake)
-endif()
+include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
# Python binding (with pybind11)
################
set(pybind11_FOUND OFF)
endif()
endif()
+endif()
- if(NOT PYTHONLIBS_FOUND AND NOT Python3_Development_FOUND)
- message(STATUS "Python libs not found. Turn pybind11 off.")
-
- set(pybind11_FOUND OFF)
- endif()
+find_package(Python3 COMPONENTS Development)
+if(NOT Python3_Development_FOUND OR NOT pybind11_FOUND)
+ message(STATUS "SimGrid Python bindings cannot be built on this system.")
+ set(default_enable_python OFF)
+else()
+ set(default_enable_python ON)
endif()
-option(enable_python "Whether the Python bindings are activated." ${pybind11_FOUND}) # ON by default if dependencies are met
+option(enable_python "Whether the Python bindings are activated." ${default_enable_python}) # ON by default if dependencies are met
if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_model-checking AND enable_python)
message(WARNING "FreeBSD + Model-Checking + Python = too much for now. Disabling the Python bindings.")
endif()
if(enable_python)
+ if(NOT Python3_Development_FOUND)
+ message(FATAL_ERROR "Please install the development components of Python (python3-dev on Debian) to build the Python bindings (or disable that option).")
+ endif()
if(pybind11_FOUND)
message(STATUS "Found pybind11.")
if(NOT enable_lto)
add_dependencies(tests python-bindings)
set_property(TARGET python-bindings
APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+
+ if("${SIMGRID_PYTHON_LIBDIR}" STREQUAL "") # value not manually set
+ if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
+ set(SIMGRID_PYTHON_LIBDIR ${Python3_SITEARCH})
+ else("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
+ string(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" SIMGRID_PYTHON_LIBDIR ${Python3_SITEARCH})
+ endif("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
+ endif()
+ install(TARGETS python-bindings
+ LIBRARY DESTINATION "${SIMGRID_PYTHON_LIBDIR}")
else()
message(FATAL_ERROR "Please install pybind11-dev to build the Python bindings (or disable that option).")
endif()
message(" is gnu ..............: ${CMAKE_COMPILER_IS_GNUCC}")
message(" Compiler: C++ ...............: ${CMAKE_CXX_COMPILER} (id: ${CMAKE_CXX_COMPILER_ID})")
message(" version .............: ${CMAKE_CXX_COMPILER_VERSION}")
-if(${Java_FOUND})
- message(" Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}")
- message(" version .............: ${Java_VERSION_STRING}")
- message(" runtime .............: ${Java_JAVA_EXECUTABLE}")
-endif()
if(CMAKE_Fortran_COMPILER)
message(" Compiler: Fortran ...........: ${SMPI_Fortran_COMPILER} (id: ${CMAKE_Fortran_COMPILER_ID})")
message(" version .............: ${CMAKE_Fortran_COMPILER_VERSION}")
message(" with LTO ....................: ${enable_lto}")
message("")
-if (SIMGRID_HAVE_MSG)
- message(" Compile MSG .................: ON")
-else()
- message(" Compile MSG .................: OFF")
-endif()
-
if (SIMGRID_HAVE_NS3)
message(" Compile ns-3 ................: ON (path: ${NS3_PATH})")
else()
message(" Compile ns-3 ................: OFF (hint: ${NS3_HINT})")
endif()
-if (${Java_FOUND})
- message(" Compile Java ................: ON")
- message(" Native lib in jar .........: ${enable_lib_in_jar}")
-else()
- message(" Compile Java ................: OFF")
-endif()
if(pybind11_FOUND)
message(" Compile Python bindings .....: ${enable_python}")
message(" module ....................: ${PYTHON_MODULE_PREFIX}simgrid${PYTHON_MODULE_EXTENSION}")
+ message(" install path ..............: ${SIMGRID_PYTHON_LIBDIR} (force another value with -DSIMGRID_PYTHON_LIBDIR)")
else()
message(" Compile Python bindings .....: OFF (disabled, or pybind11 not found)")
endif()
-message(" Compile Lua .................: ${SIMGRID_HAVE_LUA}")
+if(SIMGRID_HAVE_EIGEN3)
+ message(" Eigen3 library ..............: ${EIGEN3_VERSION_STRING} in ${EIGEN3_INCLUDE_DIR}")
+else()
+ message(" Eigen3 library ..............: not found (EIGEN3_HINT='${EIGEN3_HINT}').")
+endif()
+if(SIMGRID_HAVE_JSON)
+ message(" JSON library.................: ${nlohmann_json_VERSION} in ${NLOHMANN_JSON_INCLUDE_DIR}")
+else()
+ message(" JSON library.................: not found (nlohmann_json_HINT='${nlohmann_json_HINT}')")
+endif()
message(" Compile Smpi ................: ${HAVE_SMPI}")
message(" Smpi fortran ..............: ${SMPI_FORTRAN}")
message(" MPICH3 testsuite ..........: ${enable_smpi_MPICH3_testsuite}")
+message(" MBI testsuite .............: ${enable_smpi_MBI_testsuite}")
message(" Privatization .............: ${HAVE_PRIVATIZATION}")
message(" PAPI support...............: ${HAVE_PAPI}")
message(" Compile Boost.Context support: ${HAVE_BOOST_CONTEXTS}")
message(" Maintainer mode .............: ${enable_maintainer_mode}")
message(" Documentation................: ${enable_documentation}")
message(" Model checking ..............: ${SIMGRID_HAVE_MC}")
-message(" Jedule mode ................: ${SIMGRID_HAVE_JEDULE}")
message(" Graphviz mode ...............: ${HAVE_GRAPHVIZ}")
message(" Mallocators .................: ${enable_mallocators}")
message("")