# x86
# i.86
+### Determine the assembly flavor that we need today
+include(CMakeDetermineSystem)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
IF(${ARCH_32_BITS})
+ message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
set(PROCESSOR_i686 1)
- set(SIMGRID_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
- message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
ELSE()
- message(STATUS "System processor: amd64")
- set(SIMGRID_SYSTEM_PROCESSOR "amd64")
+ message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
set(PROCESSOR_x86_64 1)
- set(PROCESSOR_i686 0)
ENDIF()
set(HAVE_RAWCTX 1)
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
message(STATUS "System processor: sh")
-ELSE() #PROCESSOR NOT fIND
+ELSE() #PROCESSOR NOT FOUND
message(STATUS "PROCESSOR NOT FOUND: ${CMAKE_SYSTEM_PROCESSOR}")
ENDIF()
+if(ARCH_32_BITS)
+ set(MPI_ADDRESS_SIZE 4)
+else()
+ set(MPI_ADDRESS_SIZE 8)
+endif()
+
message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
include(CheckFunctionExists)
TEST_BIG_ENDIAN(BIGENDIAN)
include(FindGraphviz)
-if(WIN32)
- include(FindPcreWin)
-else()
- include(FindPCRE)
-endif()
set(HAVE_GTNETS 0)
if(enable_gtnets)
include(FindF2c)
SET(HAVE_SMPI 1)
endif()
+if(enable_java)
+ find_package(Java REQUIRED COMPONENTS Runtime Development)
+ find_package(JNI REQUIRED)
+ message("-- [Java] JNI found: ${JNI_FOUND}")
+ message("-- [Java] JNI include dirs: ${JNI_INCLUDE_DIRS}")
+ set(HAVE_Java 1)
+endif()
+if(enable_scala)
+ find_package(Scala REQUIRED)
+ message("-- [Scala] scalac found: ${SCALA_COMPILE}")
+ set(HAVE_Scala 1)
+endif()
if(enable_lua)
include(FindLua51Simgrid)
endif()
CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILE("sys/sysctl.h" HAVE_SYS_SYSCTL_H)
CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H)
-CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
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})")
-<<<<<<< HEAD
-ENDIF()
-=======
ENDIF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU" AND NOT "${CMAKE_SYSTEM}" MATCHES "Darwin")
->>>>>>> 52c07f4b6c9ba2b0af928b8e83c48f819e1c9fc0
if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD...
set(HAVE_UCONTEXT_H 1)
CHECK_TYPE_SIZE(int SIZEOF_INT)
CHECK_TYPE_SIZE(void* SIZEOF_VOIDP)
+#--------------------------------------------------------------------------------------------------
+### Check for GNU dynamic linker
+CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
+if (HAVE_DLFCN_H)
+ execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_gnu_dynlinker.c -ldl -o test_gnu_ld
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ OUTPUT_VARIABLE HAVE_GNU_LD_compil
+ )
+ if(HAVE_GNU_LD_compil)
+ set(HAVE_GNU_LD 0)
+ message(STATUS "Warning: test program toward GNU ld failed to compile:")
+ message(STATUS "${HAVE_GNU_LD_comp_output}")
+ else()
+
+ execute_process(COMMAND ./test_gnu_ld
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ RESULT_VARIABLE HAVE_GNU_LD_run
+ OUTPUT_VARIABLE var_exec
+ )
+
+ if(NOT HAVE_GNU_LD_run)
+ set(HAVE_GNU_LD 1)
+ message(STATUS "We are using GNU dynamic linker")
+ else()
+ set(HAVE_GNU_LD 0)
+ message(STATUS "Warning: error while checking for GNU ld:")
+ message(STATUS "Test output: '${var_exec}'")
+ message(STATUS "Exit status: ${HAVE_GNU_LD_run}")
+ endif()
+ file(REMOVE test_gnu_ld)
+ endif()
+endif()
+
+
#--------------------------------------------------------------------------------------------------
### Initialize of CONTEXT THREADS
#AC_PROG_MAKE_SET
-#AC_PRINTF_NULL
+#AC_PRINTF_NULL FIXME: this is too ancient to survive!
try_run(RUN_PRINTF_NULL_VAR COMPILE_PRINTF_NULL_VAR
${CMAKE_BINARY_DIR}
${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_printf_null.c
endforeach(fct ${diff_va})
#--------------------------------------------------------------------------------------------------
-### check for getline
-try_compile(COMPILE_RESULT_VAR
- ${CMAKE_BINARY_DIR}
- ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_getline.c
- )
-
-if(NOT COMPILE_RESULT_VAR)
- SET(need_getline "#define SIMGRID_NEED_GETLINE 1")
- SET(SIMGRID_NEED_GETLINE 1)
-else()
- SET(need_getline "")
- SET(SIMGRID_NEED_GETLINE 0)
-endif()
-
### check for a working snprintf
if(HAVE_SNPRINTF AND HAVE_VSNPRINTF OR WIN32)
if(WIN32)
set(top_srcdir "${CMAKE_HOME_DIRECTORY}")
set(srcdir "${CMAKE_HOME_DIRECTORY}/src")
+set(bindir "${CMAKE_BINARY_DIR}")
### Script used when simgrid is installed
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(includeflag "-I${CMAKE_INSTALL_PREFIX}/include -I${CMAKE_INSTALL_PREFIX}/include/smpi")
set(includedir "${CMAKE_INSTALL_PREFIX}/include")
set(libdir ${exec_prefix}/lib)
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH")
+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}")
+endif()
+set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
+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)
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/bin/smpif2c @ONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/bin/smpiff @ONLY)
+configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif90.in ${CMAKE_BINARY_DIR}/bin/smpif90 @ONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_BINARY_DIR}/bin/smpirun @ONLY)
### Script used when simgrid is compiling
set(includeflag "${includeflag} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/smpi")
set(includedir "${CMAKE_HOME_DIRECTORY}/include")
set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/")
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH")
+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}")
+endif()
+set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
set(libdir "${CMAKE_BINARY_DIR}/lib")
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc @ONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif2c @ONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff @ONLY)
+configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif90.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90 @ONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun @ONLY)
set(top_builddir ${CMAKE_HOME_DIRECTORY})
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff)
+ execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif90)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif2c)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff)
+ execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90)
execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun)
endif()
set(generated_headers_to_install
+ ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
)
${CMAKE_BINARY_DIR}/bin/smpicc
${CMAKE_BINARY_DIR}/bin/smpif2c
${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
configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml COPYONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions0.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt COPYONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions1.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allReduce.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allReduce.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_barrier.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_barrier.txt COPYONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_bcast.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_bcast.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_with_isend.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_with_isend.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_alltoall.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoall.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_alltoallv.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoallv.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_waitall.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_waitall.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_reducescatter.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_reducescatter.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_gather.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_gather.txt COPYONLY)
+ configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/actions_allgatherv.txt ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allgatherv.txt COPYONLY)
configure_file(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hostfile ${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile COPYONLY)
set(generated_files_to_clean
${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml
${CMAKE_BINARY_DIR}/examples/smpi/replay/actions0.txt
${CMAKE_BINARY_DIR}/examples/smpi/replay/actions1.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_allReduce.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_barrier.txt
${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_bcast.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_with_isend.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoall.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_alltoallv.txt
+ ${CMAKE_BINARY_DIR}/examples/smpi/replay/actions_waitall.txt
${CMAKE_BINARY_DIR}/teshsuite/smpi/hostfile
)
endif()