build: Add --enable-mtp option

This commit is contained in:
F5
2022-10-25 17:11:00 +08:00
parent af331aed29
commit cce2a28a0a
4 changed files with 16 additions and 0 deletions

View File

@@ -75,6 +75,7 @@ option(NS3_MONOLIB
"Build a single shared ns-3 library and link it against executables" OFF
)
option(NS3_MPI "Build with MPI support" OFF)
option(NS3_MTP "Build with Multithreaded simulation support" OFF)
option(NS3_NATIVE_OPTIMIZATIONS "Build with -march=native -mtune=native" OFF)
set(NS3_OUTPUT_DIRECTORY "" CACHE STRING "Directory to store built artifacts")
option(NS3_PRECOMPILE_HEADERS

View File

@@ -148,6 +148,9 @@ macro(write_configtable)
string(APPEND out "MPI Support : ")
check_on_or_off("${NS3_MPI}" "${MPI_FOUND}")
string(APPEND out "Multithreaded Simulation : ")
check_on_or_off("${NS3_MTP}" "ON")
string(APPEND out "ns-3 Click Integration : ")
check_on_or_off("ON" "${NS3_CLICK}")

View File

@@ -873,6 +873,12 @@ macro(process_options)
endif()
endif()
set(ENABLE_MTP FALSE)
if(${NS3_MTP})
add_definitions(-DNS3_MTP)
set(ENABLE_MTP TRUE)
endif()
if(${NS3_VERBOSE})
set_property(GLOBAL PROPERTY TARGET_MESSAGES TRUE)
set(CMAKE_FIND_DEBUG_MODE TRUE)
@@ -1189,6 +1195,10 @@ macro(process_options)
list(REMOVE_ITEM libs_to_build mpi)
endif()
if(NOT ${ENABLE_MTP})
list(REMOVE_ITEM libs_to_build mtp)
endif()
if(NOT ${ENABLE_VISUALIZER})
list(REMOVE_ITEM libs_to_build visualizer)
endif()

2
ns3
View File

@@ -133,6 +133,7 @@ def parse_args(argv):
("logs", "the logs regardless of the compile mode"),
("monolib", "a single shared library with all ns-3 modules"),
("mpi", "the MPI support for distributed simulation"),
("mtp", "Multithreading support for high speed parallel simulation"),
("python-bindings", "python bindings"),
("tests", "the ns-3 tests"),
("sanitizers", "address, memory leaks and undefined behavior sanitizers"),
@@ -536,6 +537,7 @@ def configure_cmake(cmake, args, current_cmake_cache_folder, current_cmake_gener
("LOG", "logs"),
("MONOLIB", "monolib"),
("MPI", "mpi"),
("MTP", "mtp"),
("PYTHON_BINDINGS", "python_bindings"),
("SANITIZE", "sanitizers"),
("STATIC", "static"),