-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 make woss ns3 compatible with cmake build system (#39)
* build: added updated CMake files * fixed example warning * fixed README instructions --------- Co-authored-by: Gabriel Ferreira <[email protected]>
- Loading branch information
1 parent
efe5428
commit cb36444
Showing
5 changed files
with
200 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
set(NS3_WITH_WOSS_SOURCE | ||
"" | ||
CACHE | ||
PATH | ||
"Path to WOSS source directory, for NS-3 WOSS Integration Framework support" | ||
) | ||
set(NS3_WITH_WOSS_LIBRARY | ||
"" | ||
CACHE | ||
PATH | ||
"Path to WOSS library directory, for NS-3 WOSS Integration Framework support" | ||
) | ||
|
||
set(NS3_WITH_NETCDF_INSTALL | ||
"" | ||
CACHE | ||
PATH | ||
"Path to NetCDF legacy library install, for WOSS Integration Framework support" | ||
) | ||
set(NS3_WITH_NETCDF4_INSTALL | ||
"" | ||
CACHE | ||
PATH | ||
"Path to NetCDF4 and HDF5 library install, for WOSS Integration Framework support" | ||
) | ||
|
||
set(ENABLE_WOSS | ||
"OFF" | ||
CACHE INTERNAL | ||
"ON if WOSS can be built" | ||
) | ||
|
||
find_external_library( | ||
DEPENDENCY_NAME WOSS | ||
LIBRARY_NAME WOSS | ||
HEADER_NAMES | ||
location-definitions.h | ||
woss-manager.h | ||
woss-db-manager.h | ||
SEARCH_PATHS ${NS3_WITH_WOSS_SOURCE} | ||
${NS3_WITH_WOSS_LIBRARY} | ||
PATH_SUFFIXES | ||
/woss | ||
/woss_def | ||
/woss_db | ||
/woss/woss_def | ||
/woss/woss_db | ||
/build | ||
/build/lib | ||
) | ||
|
||
set(woss_libraries) | ||
|
||
# If we can't find WOSS sources or library, don't process this module | ||
if(NOT | ||
${WOSS_FOUND} | ||
) | ||
message( | ||
${HIGHLIGHTED_STATUS} | ||
"Skipping contrib/woss-ns3" | ||
) | ||
return() | ||
else() | ||
message(STATUS "WOSS library was found: ${WOSS_LIBRARIES}") | ||
set(ENABLE_WOSS | ||
"ON" | ||
CACHE INTERNAL | ||
"ON if woss-ns3 can be built" | ||
) | ||
include_directories(${WOSS_INCLUDE_DIRS}) | ||
set(woss_libraries | ||
${WOSS_LIBRARIES} | ||
) | ||
endif() | ||
|
||
# Process optional NETCDF libraries | ||
find_external_library( | ||
DEPENDENCY_NAME NETCDF | ||
HEADER_NAMES | ||
netcdf.h | ||
ncFile.h | ||
LIBRARY_NAME netcdf_c++ | ||
netcdf | ||
SEARCH_PATHS ${NS3_WITH_NETCDF_INSTALL} | ||
PATH_SUFFIXES | ||
/include | ||
/lib | ||
) | ||
|
||
find_external_library( | ||
DEPENDENCY_NAME NETCDF4 | ||
HEADER_NAMES | ||
hdf5.h | ||
netcdf.h | ||
ncFile.h | ||
LIBRARY_NAMES | ||
netcdf_c++4 | ||
netcdf | ||
hdf5 | ||
SEARCH_PATHS ${NS3_WITH_NETCDF4_INSTALL} | ||
PATH_SUFFIXES | ||
/include | ||
/lib | ||
) | ||
|
||
set(netcdf_libraries) | ||
if(${NETCDF4_FOUND}) | ||
message(STATUS "NETCDF4 was found.") | ||
add_definitions( | ||
-DWOSS_NETCDF_SUPPORT | ||
-DWOSS_NETCDF4_SUPPORT | ||
) | ||
include_directories(${NETCDF4_INCLUDE_DIRS}) | ||
set(netcdf_libraries | ||
${NETCDF4_LIBRARIES} | ||
) | ||
else() | ||
if(${NETCDF_FOUND}) | ||
message(STATUS "NETCDF was found.") | ||
add_definitions(-DWOSS_NETCDF_SUPPORT) | ||
include_directories(${NETCDF_INCLUDE_DIRS}) | ||
set(netcdf_libraries | ||
${NETCDF_LIBRARIES} | ||
) | ||
else() | ||
message(STATUS "NETCDF was not found") | ||
endif() | ||
endif() | ||
|
||
add_definitions( | ||
-DNS3_WOSS_SUPPORT | ||
-DWOSS_MULTITHREAD | ||
) | ||
|
||
build_lib( | ||
LIBNAME woss-ns3 | ||
SOURCE_FILES | ||
model/definitions/woss-location.cc | ||
model/definitions/woss-time-reference.cc | ||
model/definitions/woss-random-generator.cc | ||
model/woss-prop-model.cc | ||
model/woss-channel.cc | ||
model/woss-position-allocator.cc | ||
model/woss-waypoint-mobility-model.cc | ||
helper/woss-helper.cc | ||
HEADER_FILES | ||
model/definitions/woss-location.h | ||
model/definitions/woss-time-reference.h | ||
model/definitions/woss-random-generator.h | ||
model/woss-prop-model.h | ||
model/woss-channel.h | ||
model/woss-position-allocator.h | ||
model/woss-waypoint-mobility-model.h | ||
helper/woss-helper.h | ||
LIBRARIES_TO_LINK | ||
${libnetanim} | ||
${libnetwork} | ||
${libenergy} | ||
${libmobility} | ||
${libuan} | ||
${woss_libraries} | ||
${netcdf_libraries} | ||
TEST_SOURCES test/woss-test.cc | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ WOSS ns3 Integration Framework | |
|
||
This repository aims to introduce WOSS support for ns3 users. | ||
|
||
WOSS is a multi-threaded C++ framework that permits the integration of any existing underwater channel simulator that expects environmental data as input and provides as output a channel realization. | ||
Currently, WOSS integrates the Bellhop ray-tracing program. | ||
Thanks to its automation the user only has to specify the location in the world and the time where the simulation should take place. This is done by setting the simulated date and the wanted latitude and longitude of every node involved. The simulator automatically handles the rest (see technical description). | ||
WOSS is a multi-threaded C++ framework that permits the integration of any existing underwater channel simulator that expects environmental data as input and provides as output a channel realization. | ||
Currently, WOSS integrates the Bellhop ray-tracing program. | ||
Thanks to its automation the user only has to specify the location in the world and the time where the simulation should take place. This is done by setting the simulated date and the wanted latitude and longitude of every node involved. The simulator automatically handles the rest (see technical description). | ||
WOSS can be integrated in any network simulator or simulation tool that supports C++. | ||
|
||
'woss-ns3' relies on the following libraries: | ||
|
@@ -15,16 +15,21 @@ WOSS can be integrated in any network simulator or simulation tool that supports | |
|
||
Latest WOSS source code, installation instructions and related libraries can be found at http://telecom.dei.unipd.it/ns/woss/ | ||
|
||
'woss-ns3' module will be automatically installed by the ns3 app installer, but this feature is not yet complete. | ||
|
||
It can also be manually installed: | ||
- by downloading and installing the recommended Acoustic Toolbox library | ||
- with optional NetCDF support, by downloading and installing the recommended HDF5, NetCDF libraries, with NetCDF4 format support | ||
- by downloading and installing the latest WOSS library with optional NetCDF4 and HDF5 support | ||
- by cloning this repository in the `<ns3-dir>/src` path and then running one of the following: | ||
- NetCDF4 and HDF5 support, *pay attention to the CXXFLAGS inline redefinition due to a unresolved NetCDF-C++4 API warning* `./waf configure | ||
How to install 'woss-ns3' with *waf*: | ||
- download and install the recommended Acoustic Toolbox library | ||
- with optional NetCDF support, download and install the recommended HDF5, NetCDF libraries, with NetCDF4 format support | ||
- download and install the latest WOSS library with optional NetCDF4 and HDF5 support | ||
- clone this repository in the `<ns3-dir>/src` path and then run one of the following: | ||
- NetCDF4 and HDF5 support, *pay attention to the CXXFLAGS inline redefinition due to a unresolved NetCDF-C++4 API warning* `./waf configure | ||
--with-woss-source=<woss_source_path> --with-woss-library=<woss_lib_path> --with-netcdf4-install=<netcdf4_and_hdf5_installed_path> CXXFLAGS="-Wall -Werror -Wno-unused-variable"` | ||
- with no NetCDF support `./waf configure --with-woss-source=<woss_source_path> --with-woss-library=<woss_lib_path>` | ||
- for info on how to install all the required libraries with the suggested paths, please check http://telecom.dei.unipd.it/ns/woss/doxygen/installation.html | ||
|
||
*Any issue should be reported via github Issue tracker*. | ||
How to install 'woss-ns3' with *cmake*: | ||
- install the required libraries as in previous instructions | ||
- run one of the following: | ||
- NetCDF4 and HDF5 support, *pay attention to the CXXFLAGS inline redefinition due to a unresolved NetCDF-C++4 API warning* `CXXFLAGS="-Wno-unused-variable" ./ns3 configure --enable-examples --enable-tests -- -DNS3_WITH_WOSS_SOURCE=/<woss_source_path> -DNS3_WITH_WOSS_LIBRARY=<woss_lib_path> -DNS3_WITH_NETCDF4_INSTALL=<netcdf4_and_hdf5_installed_path>` | ||
- with no NetCDF support `CXXFLAGS="-Wno-unused-variable" ./ns3 configure --enable-examples --enable-tests -- -DNS3_WITH_WOSS_SOURCE=/<woss_source_path> -DNS3_WITH_WOSS_LIBRARY=<woss_lib_path>` | ||
|
||
For info on how to install all the required libraries with the suggested paths, please check http://telecom.dei.unipd.it/ns/woss/doxygen/installation.html | ||
|
||
*Any issue should be reported via github Issue tracker or via e-mail to [email protected]*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
build_lib_example( | ||
NAME woss-aloha-example | ||
SOURCE_FILES woss-aloha-example.cc | ||
HEADER_FILES woss-aloha-example.h | ||
LIBRARIES_TO_LINK | ||
${libnetanim} | ||
${libinternet} | ||
${libmobility} | ||
${libstats} | ||
${libapplications} | ||
${libuan} | ||
${WOSS_LIBRARIES} | ||
${libwoss-ns3} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters