diff --git a/CMakeLists.txt b/CMakeLists.txt index d89a2cabb..ed35aac93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,8 +79,7 @@ set(NS3_OUTPUT_DIRECTORY "" CACHE STRING "Directory to store built artifacts") option(NS3_PRECOMPILE_HEADERS "Precompile module headers to speed up compilation" ON ) -option(NS3_PYTHON_BINDINGS "Build ns-3 python bindings" ON) -option(NS3_REALTIME "Build with realtime support" ON) +option(NS3_PYTHON_BINDINGS "Build ns-3 python bindings" OFF) option(NS3_SQLITE "Build with SQLite support" ON) option(NS3_STATIC "Build a static ns-3 library and link it against executables" OFF diff --git a/build-support/core-config-template.h b/build-support/core-config-template.h index 221486095..8a766c1ea 100644 --- a/build-support/core-config-template.h +++ b/build-support/core-config-template.h @@ -15,6 +15,5 @@ #cmakedefine01 HAVE_STDLIB_H #cmakedefine01 HAVE_GETENV #cmakedefine01 HAVE_SIGNAL_H -#cmakedefine HAVE_RT #endif //NS3_CORE_CONFIG_H diff --git a/build-support/custom-modules/ns3-configtable.cmake b/build-support/custom-modules/ns3-configtable.cmake index 2b754ec2a..61b6da290 100644 --- a/build-support/custom-modules/ns3-configtable.cmake +++ b/build-support/custom-modules/ns3-configtable.cmake @@ -163,9 +163,6 @@ macro(write_configtable) string(APPEND out "Python Bindings : ") check_on_or_off("${NS3_PYTHON_BINDINGS}" "${ENABLE_PYTHON_BINDINGS}") - string(APPEND out "Real Time Simulator : ") - check_on_or_off("${NS3_REALTIME}" "${ENABLE_REALTIME}") - string(APPEND out "SQLite support : ") check_on_or_off("${NS3_SQLITE}" "${ENABLE_SQLITE}") diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index aaff4c81e..509d8f018 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -657,8 +657,6 @@ macro(process_options) if(${NS3_STATIC}) # Warn users that they may be using shared libraries, which won't produce a # standalone static library - set(ENABLE_REALTIME FALSE) - set(HAVE_RT FALSE) message( WARNING "Statically linking 3rd party libraries have not been tested.\n" "Disable Brite, Click, Gtk, GSL, Mpi, Openflow and SQLite" @@ -675,26 +673,6 @@ macro(process_options) add_definitions(-DHAVE_LIBXML2) include_directories(${LIBXML2_INCLUDE_DIR}) endif() - - # LibRT - mark_as_advanced(LIBRT) - set(ENABLE_REALTIME FALSE) - if(${NS3_REALTIME}) - if(APPLE) - message( - STATUS "Lib RT is not supported on Mac OS X. Continuing without it." - ) - else() - find_library(LIBRT rt QUIET) - if(NOT ${LIBRT_FOUND}) - message(FATAL_ERROR "LibRT was not found.") - else() - message(STATUS "LibRT was found.") - set(ENABLE_REALTIME TRUE) - set(HAVE_RT TRUE) # for core-config.h - endif() - endif() - endif() endif() set(THREADS_PREFER_PTHREAD_FLAG) diff --git a/examples/realtime/CMakeLists.txt b/examples/realtime/CMakeLists.txt index c1ced707d..8124d5209 100644 --- a/examples/realtime/CMakeLists.txt +++ b/examples/realtime/CMakeLists.txt @@ -1,10 +1,8 @@ -if(${ENABLE_REALTIME}) - build_example( - NAME realtime-udp-echo - SOURCE_FILES realtime-udp-echo.cc - LIBRARIES_TO_LINK - ${libcsma} - ${libinternet} - ${libapplications} - ) -endif() +build_example( +NAME realtime-udp-echo +SOURCE_FILES realtime-udp-echo.cc +LIBRARIES_TO_LINK + ${libcsma} + ${libinternet} + ${libapplications} +) diff --git a/examples/realtime/examples-to-run.py b/examples/realtime/examples-to-run.py index 6d94ea760..2e58a0789 100644 --- a/examples/realtime/examples-to-run.py +++ b/examples/realtime/examples-to-run.py @@ -8,7 +8,7 @@ # # See test.py for more information. cpp_examples = [ - ("realtime-udp-echo", "ENABLE_REAL_TIME == True", "True"), + ("realtime-udp-echo", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f48886de8..5a8954ca7 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -64,27 +64,6 @@ else() ) endif() -set(rt_sources) -set(rt_headers) -if(${ENABLE_REALTIME}) - set(rt_sources - model/realtime-simulator-impl.cc - model/wall-clock-synchronizer.cc - ) - set(rt_headers - model/realtime-simulator-impl.h - model/wall-clock-synchronizer.h - ) - set(libraries_to_link - ${libraries_to_link} - ${LIBRT} - ) -endif() - -set(osclock_sources - model/unix-system-wall-clock-ms.cc -) - set(int64x64_sources) set(int64x64_headers) @@ -146,8 +125,6 @@ endif() # Define core lib sources set(source_files - ${rt_sources} - ${osclock_sources} ${int64x64_sources} ${example_as_test_sources} ${embedded_version_sources} @@ -210,15 +187,17 @@ set(source_files model/node-printer.cc model/show-progress.cc model/time-printer.cc + model/system-wall-clock-ms.cc model/system-wall-clock-timestamp.cc model/length.cc model/trickle-timer.cc model/unix-fd-reader.cc + model/realtime-simulator-impl.cc + model/wall-clock-synchronizer.cc ) # Define core lib headers set(header_files - ${rt_headers} ${int64x64_headers} ${example_as_test_headers} ${embedded_version_headers} @@ -317,6 +296,8 @@ set(header_files model/valgrind.h model/vector.h model/watchdog.h + model/realtime-simulator-impl.h + model/wall-clock-synchronizer.h ) set(test_sources diff --git a/src/core/examples/CMakeLists.txt b/src/core/examples/CMakeLists.txt index 986927680..12a346cfb 100644 --- a/src/core/examples/CMakeLists.txt +++ b/src/core/examples/CMakeLists.txt @@ -42,14 +42,12 @@ if(${ENABLE_BUILD_VERSION}) ) endif() -if(${ENABLE_REALTIME}) - build_lib_example( - NAME main-test-sync - SOURCE_FILES main-test-sync.cc - LIBRARIES_TO_LINK ${libnetwork} - ${CMAKE_THREAD_LIBS_INIT} - ) -endif() +build_lib_example( + NAME main-test-sync + SOURCE_FILES main-test-sync.cc + LIBRARIES_TO_LINK ${libnetwork} + ${CMAKE_THREAD_LIBS_INIT} +) build_lib_example( NAME empirical-random-variable-example diff --git a/src/core/model/wall-clock-synchronizer.cc b/src/core/model/wall-clock-synchronizer.cc index ed17afe7b..39e5935c8 100644 --- a/src/core/model/wall-clock-synchronizer.cc +++ b/src/core/model/wall-clock-synchronizer.cc @@ -18,7 +18,6 @@ #include // clock_t #include // gettimeofday - // clock_getres: glibc < 2.17, link with librt #include "log.h" #include "wall-clock-synchronizer.h" diff --git a/src/core/test/threaded-test-suite.cc b/src/core/test/threaded-test-suite.cc index ba512f194..5dfa74234 100644 --- a/src/core/test/threaded-test-suite.cc +++ b/src/core/test/threaded-test-suite.cc @@ -283,9 +283,7 @@ public: : TestSuite ("threaded-simulator") { std::string simulatorTypes[] = { -#ifdef HAVE_RT "ns3::RealtimeSimulatorImpl", -#endif "ns3::DefaultSimulatorImpl" }; std::string schedulerTypes[] = { @@ -294,7 +292,7 @@ public: "ns3::MapScheduler", "ns3::CalendarScheduler" }; - unsigned int threadcounts[] = { + unsigned int threadCounts[] = { 0, 2, 10, @@ -302,14 +300,16 @@ public: }; ObjectFactory factory; - for (unsigned int i = 0; i < (sizeof(simulatorTypes) / sizeof(simulatorTypes[0])); ++i) + for (auto &simulatorType : simulatorTypes) { - for (unsigned int j = 0; j < (sizeof(threadcounts) / sizeof(threadcounts[0])); ++j) + for (auto &schedulerType : schedulerTypes) { - for (unsigned int k = 0; k < (sizeof(schedulerTypes) / sizeof(schedulerTypes[0])); ++k) + for (auto &threadCount : threadCounts) { - factory.SetTypeId (schedulerTypes[k]); - AddTestCase (new ThreadedSimulatorEventsTestCase (factory, simulatorTypes[i], threadcounts[j]), TestCase::QUICK); + factory.SetTypeId (schedulerType); + AddTestCase ( + new ThreadedSimulatorEventsTestCase (factory, simulatorType, threadCount), + TestCase::QUICK); } } } diff --git a/src/fd-net-device/CMakeLists.txt b/src/fd-net-device/CMakeLists.txt index dd9fa9d63..2d96aaee8 100644 --- a/src/fd-net-device/CMakeLists.txt +++ b/src/fd-net-device/CMakeLists.txt @@ -100,7 +100,6 @@ if(HAVE_NET_ETHERNET_H) AND HAVE_IF_TUN_H AND HAVE_SYS_IOCTL_H AND ${ENABLE_TAP} - AND ${ENABLE_REALTIME} AND ${ENABLE_EMU} ) set(ENABLE_TAPNETDEV diff --git a/src/fd-net-device/examples/CMakeLists.txt b/src/fd-net-device/examples/CMakeLists.txt index 3d8265487..b314e8897 100644 --- a/src/fd-net-device/examples/CMakeLists.txt +++ b/src/fd-net-device/examples/CMakeLists.txt @@ -18,26 +18,24 @@ build_lib_example( ${libapplications} ) -if(${ENABLE_REALTIME}) - build_lib_example( - NAME realtime-dummy-network - SOURCE_FILES realtime-dummy-network.cc - LIBRARIES_TO_LINK - ${libfd-net-device} - ${libinternet} - ${libapplications} - ${libinternet-apps} - ) +build_lib_example( + NAME realtime-dummy-network + SOURCE_FILES realtime-dummy-network.cc + LIBRARIES_TO_LINK + ${libfd-net-device} + ${libinternet} + ${libapplications} + ${libinternet-apps} +) - build_lib_example( - NAME realtime-fd2fd-onoff - SOURCE_FILES realtime-fd2fd-onoff.cc - LIBRARIES_TO_LINK - ${libfd-net-device} - ${libinternet} - ${libapplications} - ) -endif() +build_lib_example( + NAME realtime-fd2fd-onoff + SOURCE_FILES realtime-fd2fd-onoff.cc + LIBRARIES_TO_LINK + ${libfd-net-device} + ${libinternet} + ${libapplications} +) if(${ENABLE_EMU}) build_lib_example( diff --git a/src/tap-bridge/CMakeLists.txt b/src/tap-bridge/CMakeLists.txt index f7e1f9ce7..a0aa5588c 100644 --- a/src/tap-bridge/CMakeLists.txt +++ b/src/tap-bridge/CMakeLists.txt @@ -1,11 +1,7 @@ -if((NOT - ${ENABLE_REALTIME}) - OR (NOT - ${ENABLE_EMU}) -) +if(NOT ${ENABLE_EMU}) message( ${HIGHLIGHTED_STATUS} - "tap-bridge requires emulation and realtime features" + "tap-bridge requires emulation feature" ) message( ${HIGHLIGHTED_STATUS}