Sorry for being a bummer...
set(HAVE_GRAPHVIZ 0)
include(FindGraphviz)
-set(HAVE_LUA 0)
+set(SIMGRID_HAVE_LUA 0)
if(enable_lua)
include(FindLuaSimgrid)
endif()
-set(HAVE_NS3 0)
+set(SIMGRID_SIMGRID_HAVE_NS3 0)
if(enable_ns3)
include(FindNS3)
- if (NOT HAVE_NS3)
+ if (SIMGRID_HAVE_NS3)
+ set(SIMGRID_SIMGRID_HAVE_NS3 1)
+ else()
message(FATAL_ERROR "Cannot find NS3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
endif()
endif()
endif()
if(enable_jedule)
- set(HAVE_JEDULE 1)
+ set(SIMGRID_HAVE_JEDULE 1)
else()
- set(HAVE_JEDULE 0)
+ set(SIMGRID_HAVE_JEDULE 0)
endif()
if(enable_mallocators)
- SET(HAVE_MALLOCATOR 1)
+ SET(SIMGRID_HAVE_MALLOCATOR 1)
else()
- SET(HAVE_MALLOCATOR 0)
+ SET(SIMGRID_HAVE_MALLOCATOR 0)
endif()
include(FindLibunwind)
find_package(Libevent REQUIRED)
include_directories(${LIBDW_INCLUDE_DIR} ${LIBEVENT_INCLUDE_DIR})
set(SIMGRID_DEP "${SIMGRID_DEP} ${LIBEVENT_LIBRARIES} ${LIBDW_LIBRARIES}")
- set(HAVE_MC 1)
+ set(SIMGRID_HAVE_MC 1)
if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_java)
message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling java")
set(enable_java FALSE)
endif()
else()
- SET(HAVE_MC 0)
+ SET(SIMGRID_HAVE_MC 0)
set(HAVE_MMALLOC 0)
endif()
message(" with LTO ....................: ${enable_lto}")
message("")
-if (HAVE_NS3)
+if (SIMGRID_SIMGRID_HAVE_NS3)
message(" Compile NS-3 ................: yes (path: ${NS3_PATH})")
else()
message(" Compile NS-3 ................: NO (hint: ${NS3_HINT})")
else()
message(" Compile Java ................: NO")
endif()
-message(" Compile Lua .................: ${HAVE_LUA}")
+message(" Compile Lua .................: ${SIMGRID_HAVE_LUA}")
message(" Compile Smpi ................: ${HAVE_SMPI}")
message(" Smpi fortran ..............: ${SMPI_FORTRAN}")
message(" MPICH3 testsuite ..........: ${enable_smpi_MPICH3_testsuite}")
message("")
message(" Maintainer mode .............: ${enable_maintainer_mode}")
message(" Documentation................: ${enable_documentation}")
-message(" Model checking ..............: ${HAVE_MC}")
-message(" Jedule mode ................: ${HAVE_JEDULE}")
+message(" Model checking ..............: ${SIMGRID_HAVE_MC}")
+message(" Jedule mode ................: ${SIMGRID_HAVE_JEDULE}")
message(" Graphviz mode ...............: ${HAVE_GRAPHVIZ}")
message(" Mallocators .................: ${enable_mallocators}")
message("")
+ src/xbt/plouf.c
)
- if(HAVE_MC)
+ if(SIMGRID_HAVE_MC)
\endverbatim
Then, you want to actually add your tests in the source file. All the
By the end of the configuration, cmake reports whether ns-3 was found,
and this information is also available in <tt>include/simgrid_config.h</tt>
-If your local copy defines the variable \c HAVE_NS3 to 1, then NS3
+If your local copy defines the variable \c SIMGRID_HAVE_NS3 to 1, then NS3
was correctly detected. If it's defined to 0, then something went
wrong. Explore <tt>CMakeFiles/CMakeOutput.log</tt> and
<tt>CMakeFiles/CMakeError.log</tt> to diagnose the problem.
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
endforeach()
-if(HAVE_NS3)
+if(SIMGRID_HAVE_NS3)
add_executable (network-ns3 network-ns3/network-ns3.c)
target_link_libraries(network-ns3 simgrid)
set_target_properties(network-ns3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
ADD_TESH(msg-app-pmm --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/app-pmm/app-pmm.tesh)
-if(HAVE_NS3)
+if(SIMGRID_HAVE_NS3)
ADD_TESH_FACTORIES(msg-network-ns3 "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/network-ns3/network-ns3.tesh)
endif()
foreach (x bugged1 bugged2 bugged3 centralized_mutex electric_fence bugged1_liveness bugged2_liveness)
- if(HAVE_MC)
+ if(SIMGRID_HAVE_MC)
add_executable (${x} ${x}.c)
target_link_libraries(${x} simgrid)
endif()
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deploy_${x}.xml)
endforeach()
-if(HAVE_MC)
+if(SIMGRID_HAVE_MC)
if(HAVE_C_STACK_CLEANER)
add_executable (bugged1_liveness_cleaner_on bugged1_liveness.c)
target_link_libraries(bugged1_liveness_cleaner_on simgrid)
foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1
non_termination2 non_termination3 non_termination4)
- if(HAVE_MC)
+ if(SIMGRID_HAVE_MC)
add_executable (smpi_${x} ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c)
target_link_libraries(smpi_${x} simgrid)
set_target_properties(smpi_${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mc)
${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces PARENT_SCOPE)
if(enable_smpi)
- if(HAVE_MC)
+ if(SIMGRID_HAVE_MC)
ADD_TESH(smpi-mc-only-send-determinism --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/only_send_deterministic.tesh)
endif()
#define SIMGRID_MODELCHECKER_H
#include <stdbool.h>
+#include <stddef.h> /* size_t */
#include <simgrid_config.h> /* SIMGRID_HAVE_MC ? */
#define SIMGRID_VERSION_STRING "@SIMGRID_VERSION_STRING@"
/* Was Jedule compiled in? */
-#cmakedefine01 HAVE_JEDULE
+#cmakedefine01 SIMGRID_HAVE_JEDULE
/* Was the Lua support compiled in? */
-#cmakedefine01 HAVE_LUA
+#cmakedefine01 SIMGRID_HAVE_LUA
/* Were mallocators (object pools) compiled in? */
-#cmakedefine01 HAVE_MALLOCATOR
+#cmakedefine01 SIMGRID_HAVE_MALLOCATOR
/* Was the model-checking compiled in? */
-#cmakedefine01 HAVE_MC
+#cmakedefine01 SIMGRID_HAVE_MC
/* Was the NS3 support compiled in? */
-#cmakedefine01 HAVE_NS3
+#cmakedefine01 SIMGRID_HAVE_NS3
#endif /* SIMGRID_PUBLIC_CONFIG_H */
fd.write('#include <xbt/base.h>\n')
fd.write('#include "smx_private.h"\n')
- fd.write('#if HAVE_MC\n')
+ fd.write('#if SIMGRID_HAVE_MC\n')
fd.write('#include "src/mc/mc_forward.hpp"\n')
fd.write('#endif\n')
fd.write('\n')
foreach(x dwarf dwarf-expression)
- if (HAVE_MC)
+ if (SIMGRID_HAVE_MC)
add_executable (${x} ${x}/${x}.cpp)
target_link_libraries(${x} simgrid)
set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/without-mutex-handling.tesh PARENT_SCOPE)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/mutex-handling_d.xml PARENT_SCOPE)
-IF(HAVE_MC)
+IF(SIMGRID_HAVE_MC)
ADD_TESH(tesh-mc-dwarf --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf dwarf.tesh)
ADD_TESH(tesh-mc-dwarf-expression --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf-expression --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf-expression dwarf-expression.tesh)
ADD_TESH(tesh-mc-mutex-handling --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling mutex-handling.tesh --cfg=model-check/reduction:none)
SET(BUILDNAME "FULL_FLAGS" CACHE INTERNAL "Buildname" FORCE)
endif()
-if(HAVE_MC)
+if(SIMGRID_HAVE_MC)
SET(BUILDNAME "MODEL-CHECKING" CACHE INTERNAL "Buildname" FORCE)
endif()
${XBT_SRC}
)
-if(${HAVE_JEDULE})
+if(${SIMGRID_HAVE_JEDULE})
set(simgrid_sources ${simgrid_sources} ${JEDULE_SRC})
else()
set(EXTRA_DIST ${EXTRA_DIST} ${JEDULE_SRC})
set(simgrid_sources ${simgrid_sources} ${SMPI_SRC})
endif()
-if(HAVE_MC)
+if(SIMGRID_HAVE_MC)
set(simgrid_sources ${simgrid_sources} ${MC_SRC})
endif()
-if(HAVE_NS3)
+if(SIMGRID_HAVE_NS3)
set(simgrid_sources ${simgrid_sources} ${NS3_SRC})
endif()
)
endif()
-if(HAVE_LUA)
+if(SIMGRID_HAVE_LUA)
set(simgrid_sources ${simgrid_sources} ${LUA_SRC})
else()
set(EXTRA_DIST ${EXTRA_DIST} ${LUA_SRC})
COMMAND ${CMAKE_COMMAND} -E echo "uninstall man ok"
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
-if(HAVE_LUA)
+if(SIMGRID_HAVE_LUA)
add_custom_command(TARGET uninstall
COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding lua ok"
COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid.${LIB_EXE}
SET(SIMGRID_DEP "${SIMGRID_DEP} -pthread")
endif()
-if(HAVE_LUA)
+if(SIMGRID_HAVE_LUA)
ADD_CUSTOM_TARGET(link_simgrid_lua ALL
DEPENDS simgrid
${CMAKE_BINARY_DIR}/examples/lua/simgrid.${LIB_EXE}
endif()
endif()
-if(HAVE_MC AND HAVE_GNU_LD AND NOT ${DL_LIBRARY} STREQUAL "")
+if(SIMGRID_HAVE_MC AND HAVE_GNU_LD AND NOT ${DL_LIBRARY} STREQUAL "")
SET(SIMGRID_DEP "${SIMGRID_DEP} ${DL_LIBRARY}")
endif()
-if(HAVE_NS3)
+if(SIMGRID_HAVE_NS3)
SET(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-core${NS3_SUFFIX} -lns${NS3_VERSION}-csma${NS3_SUFFIX} -lns${NS3_VERSION}-point-to-point${NS3_SUFFIX} -lns${NS3_VERSION}-internet${NS3_SUFFIX} -lns${NS3_VERSION}-applications${NS3_SUFFIX}")
endif()
# Input variable:
# LUA_HINT: path to Lua installation -- only needed for non-standard installs
# Output variable:
-# HAVE_LUA : if Lua was found
+# SIMGRID_HAVE_LUA : if Lua was found
# LUA_LIBRARY : the path to the dynamic library
# LUA_INCLUDE_DIR : where to find lua.h
# LUA_VERSION_MAJOR: First part of the version (often, 5)
# Check that we have a sufficient version of Lua
if(LUA_VERSION_MAJOR EQUAL 5 AND LUA_VERSION_MINOR EQUAL 3)
- set(HAVE_LUA 1)
+ set(SIMGRID_HAVE_LUA 1)
include_directories(${LUA_INCLUDE_DIR})
else()
message(FATAL_ERROR "Error: Lua version 5.3 is required, but version ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} found instead.")
# - Add "ns3.${version}-core ns3.${version}-core-debug ns3.${version}-core-optimized" to the NAME line of the find_library below
# - Add "include/ns3{version}" to the PATH_SUFFIXES line of the find_path below
-set(HAVE_NS3 0)
+set(SIMGRID_HAVE_NS3 0)
set(NS3_HINT ${ns3_path} CACHE PATH "Path to search for NS3 lib and include")
find_library(NS3_LIBRARIES
if(NS3_INCLUDE_DIR)
if(NS3_LIBRARIES)
- set(HAVE_NS3 1)
+ set(SIMGRID_HAVE_NS3 1)
if(NS3_LIBRARIES MATCHES "-optimized")
set (NS3_SUFFIX "-optimized")
elseif(NS3_LIBRARIES MATCHES "-debug")
endif()
mark_as_advanced(NS3_LIBRARY_PATH)
-if(HAVE_NS3)
+if(SIMGRID_HAVE_NS3)
link_directories(${NS3_LIBRARY_PATH})
include_directories(${NS3_INCLUDE_DIR})
else()
ENDIF()
ENDIF()
-IF(HAVE_MC)
+IF(SIMGRID_HAVE_MC)
ADD_TESH_FACTORIES(mc-bugged1 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
ADD_TESH_FACTORIES(mc-bugged2 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
IF(HAVE_UCONTEXT_CONTEXTS AND SIMGRID_PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
ENDIF()
-IF(HAVE_LUA)
+IF(SIMGRID_HAVE_LUA)
# Tests testing simulation from C but using lua for platform files. Executed like this
# ~$ ./masterslave platform.lua deploy.lua
ADD_TESH(lua-platform-masterslave --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/lua --cd ${CMAKE_BINARY_DIR}/examples/lua ${CMAKE_HOME_DIRECTORY}/teshsuite/lua/lua_platforms.tesh)
src/xbt/config.cpp
)
-if(HAVE_MC)
+if(SIMGRID_HAVE_MC)
set(FILES_CONTAINING_UNITTESTS ${FILES_CONTAINING_UNITTESTS}
src/mc/PageStore.cpp
src/mc/mc_snapshot.cpp
/* process_vm_readv: transfer data between process address spaces */
#cmakedefine01 HAVE_PROCESS_VM_READV
/* Set to true if enable_model-checking is true and the dependencies available */
-#cmakedefine01 HAVE_MC
+#cmakedefine01 SIMGRID_HAVE_MC
/* SMPI variables */
/* SMPI enabled */