commit 0cd8217bc5e20490596d87897acdba6dee8a6e39 Author: duongtd Date: Fri Oct 31 14:38:00 2025 +0700 first commit 1437_31102025 diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..4d7590e --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,156 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rostime +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.7.3 (2023-06-15) +------------------ +* Fix min() usage +* Use shorter wall sleeps in sim time for very short durations +* Changed maintainer to Martin Pecka +* Removed constants for WEEK and YEAR as they might be ambiguous. +* rostime: Added headers wherever std::numeric_limits are used. +* Fixed handling of infinite or >int64 doubles in Time and Duration constructors. Added tests for Rate(double) constructor, verified Rate(inf) works and Rate(0) does not. +* rostime: Added useful time and duration constants. +* Contributors: Martin Pecka + +0.7.2 (2020-05-28) +------------------ +* [Windows] Using C++11 std::chrono for ros_walltime & ros_steadytime (`#121 `_) + +0.7.1 (2020-01-25) +------------------ +* only depend on the boost components needed (`#117 `_) + +0.7.0 (2020-01-24) +------------------ +* rostime: remove empty destructor of DurationBase (`#104 `_) +* various code cleanup (`#116 `_) +* Bump CMake version to avoid CMP0048 warning (`#115 `_) + +0.6.13 (2019-10-03) +------------------- +* use _WIN32 for platform detection (`#110 `_) +* Clarified documentation for time validity (`#109 `_) +* rostime: replace c-style casts with static_casts (`#106 `_) + +0.6.12 (2019-03-04) +------------------- +* use std::numeric_limits instead of * _MAX macros for range checking (`#103 `_) +* use std::this_thread::sleep_for instead of WaitableTimer (`#101 `_) +* include windows.h in time.cpp (`#100 `_) +* fix duration bug and add tests. (`#98 `_) +* fix for Duration::fromSec() which had rounding issues (`#93 `_) +* fix bug in HAVE_CXXABI_H compiler check (`#89 `_) +* add ROSTIME_DECL storage-class attribute (`#90 `_) + +0.6.11 (2018-06-06) +------------------- +* argument to boost microseconds must be integral for Boost 1.67 and newer compatibility (`#79 `_) +* remove empty destructor of TimeBase (which makes TimeBase, Time and WallTime trivially copyable) (`#82 `_) + +0.6.10 (2018-05-01) +------------------- +* fix conversion of Duration on macOS (`#78 `_) + +0.6.9 (2018-02-02) +------------------ +* expose ros_walltime and ros_steadytime (`#73 `_) + +0.6.8 (2018-01-26) +------------------ + +0.6.7 (2017-11-03) +------------------ + +0.6.6 (2017-10-25) +------------------ +* only use Apple features on Apple (`#68 `_) +* remove exception specification (`#64 `_) + +0.6.5 (2017-07-27) +------------------ +* add additional checks for valid time values (`#62 `_) +* fix overflow bugs in Time and Duration (`#61 `_, `#63 `_) + +0.6.4 (2017-06-06) +------------------ +* add logic to support steady time on macOS (regression of 0.6.3) (`#59 `_) + +0.6.3 (2017-05-15) +------------------ +* add SteadyTime (`#57 `_) + +0.6.2 (2017-02-14) +------------------ + +0.6.1 (2016-09-02) +------------------ +* fix rounding errors leading to invalid stored data in ros::TimeBase (`#48 `_) + +0.6.0 (2016-03-17) +------------------ +* change Duration:sleep return semantic (`#47 `_) + +0.5.7 (2016-03-09) +------------------ +* Adjust return value of sleep() function (`#45 `_) +* fix WallRate(Duration) constructor (`#40 `_) + +0.5.6 (2015-05-20) +------------------ + +0.5.5 (2014-12-22) +------------------ +* move implementation of Duration(Rate) constructor (`#30 `_) +* fix Duration initialization from seconds for negative values (`#29 `_) + +0.5.4 (2014-07-23) +------------------ +* fix Rate initialized by Duration (`#26 `_) + +0.5.3 (2014-06-28) +------------------ + +0.5.2 (2014-06-27) +------------------ + +0.5.1 (2014-06-24) +------------------ + +0.5.0 (2014-02-19) +------------------ + +0.4.2 (2014-02-11) +------------------ + +0.4.1 (2014-02-11) +------------------ + +0.4.0 (2014-01-29) +------------------ + +0.3.17 (2014-01-07) +------------------- +* fix boost include dir + +0.3.16 (2013-07-14) +------------------- +* support for CATKIN_ENABLE_TESTING + +0.3.15 (2013-06-06) +------------------- +* fix install destination for dll's under Windows + +0.3.14 (2013-03-21) +------------------- + +0.3.13 (2013-03-08) +------------------- + +0.3.12 (2013-01-13) +------------------- +* improve string output of negative durations (`#3309 `_) + +0.3.11 (2012-12-21) +------------------- +* first public release for Groovy diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..1fe7369 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 3.10.2) +project(rostime LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +find_package(GTest REQUIRED) + +include_directories(${GTEST_INCLUDE_DIRS}) + +add_library(rostime + src/duration.cpp + src/rate.cpp + src/time.cpp) + +target_include_directories(rostime PUBLIC + $ + $) + + + +install(TARGETS rostime + EXPORT rostimeTargets + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) + +install(DIRECTORY include/ + DESTINATION include + FILES_MATCHING PATTERN "*.h") + +install(EXPORT rostimeTargets + NAMESPACE rostime:: + DESTINATION lib/cmake/rostime) + +add_executable(robot_time_test test/time.cpp) +add_executable(robot_duration_test test/duration.cpp) +target_link_libraries(robot_time_test PRIVATE +rostime +${GTEST_LIBRARIES} +GTest::GTest +GTest::Main) +target_link_libraries(robot_duration_test PRIVATE +rostime +${GTEST_LIBRARIES} +GTest::GTest +GTest::Main) diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt new file mode 100644 index 0000000..0f646bc --- /dev/null +++ b/build/CMakeCache.txt @@ -0,0 +1,382 @@ +# This is the CMakeCache file. +# For build in directory: /home/duongtd/robotics_core/robot_time/build +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//A wrapper around 'ar' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 + +//A wrapper around 'ranlib' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=rostime + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=/usr/bin/readelf + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Path to a library. +GMOCK_LIBRARY:FILEPATH=/usr/local/lib/libgmock.a + +//Path to a library. +GMOCK_LIBRARY_DEBUG:FILEPATH=GMOCK_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +GMOCK_MAIN_LIBRARY:FILEPATH=/usr/local/lib/libgmock_main.a + +//Path to a library. +GMOCK_MAIN_LIBRARY_DEBUG:FILEPATH=GMOCK_MAIN_LIBRARY_DEBUG-NOTFOUND + +//Path to a file. +GTEST_INCLUDE_DIR:PATH=/usr/local/include + +//Path to a library. +GTEST_LIBRARY:FILEPATH=/usr/local/lib/libgtest.a + +//Path to a library. +GTEST_LIBRARY_DEBUG:FILEPATH=GTEST_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +GTEST_MAIN_LIBRARY:FILEPATH=/usr/local/lib/libgtest_main.a + +//Path to a library. +GTEST_MAIN_LIBRARY_DEBUG:FILEPATH=GTEST_MAIN_LIBRARY_DEBUG-NOTFOUND + +//The directory containing a CMake configuration file for GTest. +GTest_DIR:PATH=GTest_DIR-NOTFOUND + +//Value Computed by CMake +rostime_BINARY_DIR:STATIC=/home/duongtd/robotics_core/robot_time/build + +//Value Computed by CMake +rostime_SOURCE_DIR:STATIC=/home/duongtd/robotics_core/robot_time + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/duongtd/robotics_core/robot_time/build +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR +CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB +CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Test CMAKE_HAVE_LIBC_PTHREAD +CMAKE_HAVE_LIBC_PTHREAD:INTERNAL= +//Have library pthreads +CMAKE_HAVE_PTHREADS_CREATE:INTERNAL= +//Have library pthread +CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1 +//Have include pthread.h +CMAKE_HAVE_PTHREAD_H:INTERNAL=1 +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/duongtd/robotics_core/robot_time +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Details about finding GTest +FIND_PACKAGE_MESSAGE_DETAILS_GTest:INTERNAL=[/usr/local/lib/libgtest.a][/usr/local/include][/usr/local/lib/libgtest_main.a][v()] +//ADVANCED property for variable: GMOCK_LIBRARY +GMOCK_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GMOCK_LIBRARY_DEBUG +GMOCK_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GMOCK_MAIN_LIBRARY +GMOCK_MAIN_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GMOCK_MAIN_LIBRARY_DEBUG +GMOCK_MAIN_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GTEST_INCLUDE_DIR +GTEST_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GTEST_LIBRARY +GTEST_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GTEST_LIBRARY_DEBUG +GTEST_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GTEST_MAIN_LIBRARY +GTEST_MAIN_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: GTEST_MAIN_LIBRARY_DEBUG +GTEST_MAIN_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 + diff --git a/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..278ef39 --- /dev/null +++ b/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake @@ -0,0 +1,88 @@ +set(CMAKE_CXX_COMPILER "/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "GNU") +set(CMAKE_CXX_COMPILER_VERSION "9.4.0") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000..a9f2f4f Binary files /dev/null and b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/build/CMakeFiles/3.16.3/CMakeSystem.cmake b/build/CMakeFiles/3.16.3/CMakeSystem.cmake new file mode 100644 index 0000000..8b384d4 --- /dev/null +++ b/build/CMakeFiles/3.16.3/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Linux-5.15.0-139-generic") +set(CMAKE_HOST_SYSTEM_NAME "Linux") +set(CMAKE_HOST_SYSTEM_VERSION "5.15.0-139-generic") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Linux-5.15.0-139-generic") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_VERSION "5.15.0-139-generic") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp b/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..69cfdba --- /dev/null +++ b/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,660 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__COMO__) +# define COMPILER_ID "Comeau" + /* __COMO_VERSION__ = VRR */ +# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) + +#elif defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out b/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out new file mode 100755 index 0000000..2881803 Binary files /dev/null and b/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out differ diff --git a/build/CMakeFiles/CMakeDirectoryInformation.cmake b/build/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..68a10d2 --- /dev/null +++ b/build/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/duongtd/robotics_core/robot_time") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/duongtd/robotics_core/robot_time/build") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/build/CMakeFiles/CMakeError.log b/build/CMakeFiles/CMakeError.log new file mode 100644 index 0000000..adb40c0 --- /dev/null +++ b/build/CMakeFiles/CMakeError.log @@ -0,0 +1,58 @@ +Performing C++ SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: +Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/make cmTC_cf1b1/fast && /usr/bin/make -f CMakeFiles/cmTC_cf1b1.dir/build.make CMakeFiles/cmTC_cf1b1.dir/build +make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_cf1b1.dir/src.cxx.o +/usr/bin/c++ -DCMAKE_HAVE_LIBC_PTHREAD -std=c++17 -o CMakeFiles/cmTC_cf1b1.dir/src.cxx.o -c /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp/src.cxx +Linking CXX executable cmTC_cf1b1 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cf1b1.dir/link.txt --verbose=1 +/usr/bin/c++ -DCMAKE_HAVE_LIBC_PTHREAD CMakeFiles/cmTC_cf1b1.dir/src.cxx.o -o cmTC_cf1b1 +/usr/bin/ld: CMakeFiles/cmTC_cf1b1.dir/src.cxx.o: in function `main': +src.cxx:(.text+0x46): undefined reference to `pthread_create' +/usr/bin/ld: src.cxx:(.text+0x52): undefined reference to `pthread_detach' +/usr/bin/ld: src.cxx:(.text+0x63): undefined reference to `pthread_join' +collect2: error: ld returned 1 exit status +make[1]: *** [CMakeFiles/cmTC_cf1b1.dir/build.make:87: cmTC_cf1b1] Error 1 +make[1]: Leaving directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +make: *** [Makefile:121: cmTC_cf1b1/fast] Error 2 + + +Source file was: +#include + +void* test_func(void* data) +{ + return data; +} + +int main(void) +{ + pthread_t thread; + pthread_create(&thread, NULL, test_func, NULL); + pthread_detach(thread); + pthread_join(thread, NULL); + pthread_atfork(NULL, NULL, NULL); + pthread_exit(NULL); + + return 0; +} + +Determining if the function pthread_create exists in the pthreads failed with the following output: +Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/make cmTC_45106/fast && /usr/bin/make -f CMakeFiles/cmTC_45106.dir/build.make CMakeFiles/cmTC_45106.dir/build +make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_45106.dir/CheckFunctionExists.cxx.o +/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=pthread_create -std=c++17 -o CMakeFiles/cmTC_45106.dir/CheckFunctionExists.cxx.o -c /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx +Linking CXX executable cmTC_45106 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_45106.dir/link.txt --verbose=1 +/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_45106.dir/CheckFunctionExists.cxx.o -o cmTC_45106 -lpthreads +/usr/bin/ld: cannot find -lpthreads +collect2: error: ld returned 1 exit status +make[1]: *** [CMakeFiles/cmTC_45106.dir/build.make:87: cmTC_45106] Error 1 +make[1]: Leaving directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +make: *** [Makefile:121: cmTC_45106/fast] Error 2 + + + diff --git a/build/CMakeFiles/CMakeOutput.log b/build/CMakeFiles/CMakeOutput.log new file mode 100644 index 0000000..e8b327b --- /dev/null +++ b/build/CMakeFiles/CMakeOutput.log @@ -0,0 +1,264 @@ +The system is: Linux - 5.15.0-139-generic - x86_64 +Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. +Compiler: /usr/bin/c++ +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + +The CXX compiler identification is GNU, found in "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out" + +Determining if the CXX compiler works passed with the following output: +Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/make cmTC_c7625/fast && /usr/bin/make -f CMakeFiles/cmTC_c7625.dir/build.make CMakeFiles/cmTC_c7625.dir/build +make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_c7625.dir/testCXXCompiler.cxx.o +/usr/bin/c++ -o CMakeFiles/cmTC_c7625.dir/testCXXCompiler.cxx.o -c /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx +Linking CXX executable cmTC_c7625 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c7625.dir/link.txt --verbose=1 +/usr/bin/c++ CMakeFiles/cmTC_c7625.dir/testCXXCompiler.cxx.o -o cmTC_c7625 +make[1]: Leaving directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' + + + +Detecting CXX compiler ABI info compiled with the following output: +Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/make cmTC_76a7f/fast && /usr/bin/make -f CMakeFiles/cmTC_76a7f.dir/build.make CMakeFiles/cmTC_76a7f.dir/build +make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o +/usr/bin/c++ -v -o CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp +Using built-in specs. +COLLECT_GCC=/usr/bin/c++ +OFFLOAD_TARGET_NAMES=nvptx-none:hsa +OFFLOAD_TARGET_DEFAULT=1 +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccCCtNFR.s +GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu) + compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP + +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9" +ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include" +#include "..." search starts here: +#include <...> search starts here: + /usr/include/c++/9 + /usr/include/x86_64-linux-gnu/c++/9 + /usr/include/c++/9/backward + /usr/lib/gcc/x86_64-linux-gnu/9/include + /usr/local/include + /usr/include/x86_64-linux-gnu + /usr/include +End of search list. +GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu) + compiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP + +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +Compiler executable checksum: 3d1eba838554fa2348dba760e4770469 +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + as -v --64 -o CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccCCtNFR.s +GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34 +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +Linking CXX executable cmTC_76a7f +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_76a7f.dir/link.txt --verbose=1 +/usr/bin/c++ -v CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_76a7f +Using built-in specs. +COLLECT_GCC=/usr/bin/c++ +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper +OFFLOAD_TARGET_NAMES=nvptx-none:hsa +OFFLOAD_TARGET_DEFAULT=1 +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_76a7f' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccngIx4h.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_76a7f /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_76a7f' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +make[1]: Leaving directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' + + + +Parsed CXX implicit include dir info from above output: rv=done + found start of include info + found start of implicit include info + add: [/usr/include/c++/9] + add: [/usr/include/x86_64-linux-gnu/c++/9] + add: [/usr/include/c++/9/backward] + add: [/usr/lib/gcc/x86_64-linux-gnu/9/include] + add: [/usr/local/include] + add: [/usr/include/x86_64-linux-gnu] + add: [/usr/include] + end of search list found + collapse include dir [/usr/include/c++/9] ==> [/usr/include/c++/9] + collapse include dir [/usr/include/x86_64-linux-gnu/c++/9] ==> [/usr/include/x86_64-linux-gnu/c++/9] + collapse include dir [/usr/include/c++/9/backward] ==> [/usr/include/c++/9/backward] + collapse include dir [/usr/lib/gcc/x86_64-linux-gnu/9/include] ==> [/usr/lib/gcc/x86_64-linux-gnu/9/include] + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/usr/include/x86_64-linux-gnu] ==> [/usr/include/x86_64-linux-gnu] + collapse include dir [/usr/include] ==> [/usr/include] + implicit include dirs: [/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include] + + +Parsed CXX implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command(s):/usr/bin/make cmTC_76a7f/fast && /usr/bin/make -f CMakeFiles/cmTC_76a7f.dir/build.make CMakeFiles/cmTC_76a7f.dir/build] + ignore line: [make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp'] + ignore line: [Building CXX object CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/c++] + ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa] + ignore line: [OFFLOAD_TARGET_DEFAULT=1] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccCCtNFR.s] + ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)] + ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/9"] + ignore line: [ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed"] + ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/include/c++/9] + ignore line: [ /usr/include/x86_64-linux-gnu/c++/9] + ignore line: [ /usr/include/c++/9/backward] + ignore line: [ /usr/lib/gcc/x86_64-linux-gnu/9/include] + ignore line: [ /usr/local/include] + ignore line: [ /usr/include/x86_64-linux-gnu] + ignore line: [ /usr/include] + ignore line: [End of search list.] + ignore line: [GNU C++14 (Ubuntu 9.4.0-1ubuntu1~20.04.2) version 9.4.0 (x86_64-linux-gnu)] + ignore line: [ compiled by GNU C version 9.4.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version isl-0.22.1-GMP] + ignore line: [] + ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] + ignore line: [Compiler executable checksum: 3d1eba838554fa2348dba760e4770469] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [ as -v --64 -o CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccCCtNFR.s] + ignore line: [GNU assembler version 2.34 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.34] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [Linking CXX executable cmTC_76a7f] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_76a7f.dir/link.txt --verbose=1] + ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_76a7f ] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/c++] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] + ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:hsa] + ignore line: [OFFLOAD_TARGET_DEFAULT=1] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c ada c++ go brig d fortran objc obj-c++ gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32 m64 mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_76a7f' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccngIx4h.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_76a7f /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/9/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccngIx4h.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-pie] ==> ignore + arg [-znow] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_76a7f] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] + arg [CMakeFiles/cmTC_76a7f.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lstdc++] ==> lib [stdc++] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o] ==> ignore + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9] ==> [/usr/lib/gcc/x86_64-linux-gnu/9] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/9/../../..] ==> [/usr/lib] + implicit libs: [stdc++;m;gcc_s;gcc;c;gcc_s;gcc] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + +Determining if the include file pthread.h exists passed with the following output: +Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/make cmTC_c8dac/fast && /usr/bin/make -f CMakeFiles/cmTC_c8dac.dir/build.make CMakeFiles/cmTC_c8dac.dir/build +make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_c8dac.dir/CheckIncludeFile.cxx.o +/usr/bin/c++ -std=c++17 -o CMakeFiles/cmTC_c8dac.dir/CheckIncludeFile.cxx.o -c /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx +Linking CXX executable cmTC_c8dac +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c8dac.dir/link.txt --verbose=1 +/usr/bin/c++ CMakeFiles/cmTC_c8dac.dir/CheckIncludeFile.cxx.o -o cmTC_c8dac +make[1]: Leaving directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' + + + +Determining if the function pthread_create exists in the pthread passed with the following output: +Change Dir: /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp + +Run Build Command(s):/usr/bin/make cmTC_ea5d4/fast && /usr/bin/make -f CMakeFiles/cmTC_ea5d4.dir/build.make CMakeFiles/cmTC_ea5d4.dir/build +make[1]: Entering directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' +Building CXX object CMakeFiles/cmTC_ea5d4.dir/CheckFunctionExists.cxx.o +/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=pthread_create -std=c++17 -o CMakeFiles/cmTC_ea5d4.dir/CheckFunctionExists.cxx.o -c /home/duongtd/robotics_core/robot_time/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx +Linking CXX executable cmTC_ea5d4 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ea5d4.dir/link.txt --verbose=1 +/usr/bin/c++ -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_ea5d4.dir/CheckFunctionExists.cxx.o -o cmTC_ea5d4 -lpthread +make[1]: Leaving directory '/home/duongtd/robotics_core/robot_time/build/CMakeFiles/CMakeTmp' + + + diff --git a/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx b/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx new file mode 100644 index 0000000..13435e0 --- /dev/null +++ b/build/CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx @@ -0,0 +1,28 @@ +#ifdef CHECK_FUNCTION_EXISTS + +# ifdef __cplusplus +extern "C" +# endif + char + CHECK_FUNCTION_EXISTS(void); +# ifdef __CLASSIC_C__ +int main() +{ + int ac; + char* av[]; +# else +int main(int ac, char* av[]) +{ +# endif + CHECK_FUNCTION_EXISTS(); + if (ac > 1000) { + return *av[0]; + } + return 0; +} + +#else /* CHECK_FUNCTION_EXISTS */ + +# error "CHECK_FUNCTION_EXISTS has to specify the function" + +#endif /* CHECK_FUNCTION_EXISTS */ diff --git a/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets-noconfig.cmake b/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets-noconfig.cmake new file mode 100644 index 0000000..751af93 --- /dev/null +++ b/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets-noconfig.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "rostime::rostime" for configuration "" +set_property(TARGET rostime::rostime APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(rostime::rostime PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/librostime.a" + ) + +list(APPEND _IMPORT_CHECK_TARGETS rostime::rostime ) +list(APPEND _IMPORT_CHECK_FILES_FOR_rostime::rostime "${_IMPORT_PREFIX}/lib/librostime.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets.cmake b/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets.cmake new file mode 100644 index 0000000..a02908e --- /dev/null +++ b/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets.cmake @@ -0,0 +1,94 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget rostime::rostime) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target rostime::rostime +add_library(rostime::rostime STATIC IMPORTED) + +set_target_properties(rostime::rostime PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Load information for each installed configuration. +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB CONFIG_FILES "${_DIR}/rostimeTargets-*.cmake") +foreach(f ${CONFIG_FILES}) + include(${f}) +endforeach() + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/build/CMakeFiles/Makefile.cmake b/build/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..9b262f1 --- /dev/null +++ b/build/CMakeFiles/Makefile.cmake @@ -0,0 +1,113 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "../CMakeLists.txt" + "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" + "CMakeFiles/3.16.3/CMakeSystem.cmake" + "CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx" + "/usr/share/cmake-3.16/Modules/CMakeCXXCompiler.cmake.in" + "/usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp" + "/usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake" + "/usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" + "/usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/share/cmake-3.16/Modules/CMakeCompilerIdDetection.cmake" + "/usr/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake" + "/usr/share/cmake-3.16/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/share/cmake-3.16/Modules/CMakeDetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake" + "/usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake" + "/usr/share/cmake-3.16/Modules/CMakeFindBinUtils.cmake" + "/usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake" + "/usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake" + "/usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake" + "/usr/share/cmake-3.16/Modules/CMakeParseImplicitIncludeInfo.cmake" + "/usr/share/cmake-3.16/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/share/cmake-3.16/Modules/CMakeSystem.cmake.in" + "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake" + "/usr/share/cmake-3.16/Modules/CMakeTestCompilerCommon.cmake" + "/usr/share/cmake-3.16/Modules/CMakeUnixFindMake.cmake" + "/usr/share/cmake-3.16/Modules/CheckCXXSourceCompiles.cmake" + "/usr/share/cmake-3.16/Modules/CheckFunctionExists.c" + "/usr/share/cmake-3.16/Modules/CheckIncludeFile.cxx.in" + "/usr/share/cmake-3.16/Modules/CheckIncludeFileCXX.cmake" + "/usr/share/cmake-3.16/Modules/CheckLibraryExists.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/GNU-FindBinUtils.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/GNU.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "/usr/share/cmake-3.16/Modules/FindGTest.cmake" + "/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake" + "/usr/share/cmake-3.16/Modules/FindPackageMessage.cmake" + "/usr/share/cmake-3.16/Modules/FindThreads.cmake" + "/usr/share/cmake-3.16/Modules/GoogleTest.cmake" + "/usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake" + "/usr/share/cmake-3.16/Modules/Internal/FeatureTesting.cmake" + "/usr/share/cmake-3.16/Modules/Platform/Linux-Determine-CXX.cmake" + "/usr/share/cmake-3.16/Modules/Platform/Linux-GNU-CXX.cmake" + "/usr/share/cmake-3.16/Modules/Platform/Linux-GNU.cmake" + "/usr/share/cmake-3.16/Modules/Platform/Linux.cmake" + "/usr/share/cmake-3.16/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.16.3/CMakeSystem.cmake" + "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" + "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" + "CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx" + "CMakeFiles/CheckLibraryExists/CheckFunctionExists.cxx" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/robot_duration_test.dir/DependInfo.cmake" + "CMakeFiles/robot_time_test.dir/DependInfo.cmake" + "CMakeFiles/rostime.dir/DependInfo.cmake" + ) diff --git a/build/CMakeFiles/Makefile2 b/build/CMakeFiles/Makefile2 new file mode 100644 index 0000000..e89a892 --- /dev/null +++ b/build/CMakeFiles/Makefile2 @@ -0,0 +1,164 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/duongtd/robotics_core/robot_time + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/duongtd/robotics_core/robot_time/build + +#============================================================================= +# Directory level rules for the build root directory + +# The main recursive "all" target. +all: CMakeFiles/robot_duration_test.dir/all +all: CMakeFiles/robot_time_test.dir/all +all: CMakeFiles/rostime.dir/all + +.PHONY : all + +# The main recursive "preinstall" target. +preinstall: + +.PHONY : preinstall + +# The main recursive "clean" target. +clean: CMakeFiles/robot_duration_test.dir/clean +clean: CMakeFiles/robot_time_test.dir/clean +clean: CMakeFiles/rostime.dir/clean + +.PHONY : clean + +#============================================================================= +# Target rules for target CMakeFiles/robot_duration_test.dir + +# All Build rule for target. +CMakeFiles/robot_duration_test.dir/all: CMakeFiles/rostime.dir/all + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/depend + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=1,2 "Built target robot_duration_test" +.PHONY : CMakeFiles/robot_duration_test.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/robot_duration_test.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 6 + $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/robot_duration_test.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 0 +.PHONY : CMakeFiles/robot_duration_test.dir/rule + +# Convenience name for target. +robot_duration_test: CMakeFiles/robot_duration_test.dir/rule + +.PHONY : robot_duration_test + +# clean rule for target. +CMakeFiles/robot_duration_test.dir/clean: + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/clean +.PHONY : CMakeFiles/robot_duration_test.dir/clean + +#============================================================================= +# Target rules for target CMakeFiles/robot_time_test.dir + +# All Build rule for target. +CMakeFiles/robot_time_test.dir/all: CMakeFiles/rostime.dir/all + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/depend + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=3,4 "Built target robot_time_test" +.PHONY : CMakeFiles/robot_time_test.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/robot_time_test.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 6 + $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/robot_time_test.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 0 +.PHONY : CMakeFiles/robot_time_test.dir/rule + +# Convenience name for target. +robot_time_test: CMakeFiles/robot_time_test.dir/rule + +.PHONY : robot_time_test + +# clean rule for target. +CMakeFiles/robot_time_test.dir/clean: + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/clean +.PHONY : CMakeFiles/robot_time_test.dir/clean + +#============================================================================= +# Target rules for target CMakeFiles/rostime.dir + +# All Build rule for target. +CMakeFiles/rostime.dir/all: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/depend + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=5,6,7,8 "Built target rostime" +.PHONY : CMakeFiles/rostime.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/rostime.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 4 + $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/rostime.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 0 +.PHONY : CMakeFiles/rostime.dir/rule + +# Convenience name for target. +rostime: CMakeFiles/rostime.dir/rule + +.PHONY : rostime + +# clean rule for target. +CMakeFiles/rostime.dir/clean: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/clean +.PHONY : CMakeFiles/rostime.dir/clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/build/CMakeFiles/TargetDirectories.txt b/build/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..f60c7a8 --- /dev/null +++ b/build/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,9 @@ +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/install/strip.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/install/local.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/install.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/list_install_components.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rebuild_cache.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/edit_cache.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/robot_duration_test.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/robot_time_test.dir +/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/build/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/build/CMakeFiles/progress.marks b/build/CMakeFiles/progress.marks new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/build/CMakeFiles/progress.marks @@ -0,0 +1 @@ +8 diff --git a/build/CMakeFiles/robot_duration_test.dir/CXX.includecache b/build/CMakeFiles/robot_duration_test.dir/CXX.includecache new file mode 100644 index 0000000..c82620e --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/CXX.includecache @@ -0,0 +1,64 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +../include/robot/duration.h +iostream +- +math.h +- +stdexcept +- +climits +- +stdint.h +- +robot_time_decl.h +../include/robot/robot_time_decl.h + +../include/robot/exception.h +stdexcept +- +string +- + +../include/robot/macros.h + +../include/robot/platform.h + +../include/robot/robot_time_decl.h +robot/macros.h +- + +../include/robot/time.h +robot/platform.h +- +iostream +- +cmath +- +robot/exception.h +- +duration.h +../include/robot/duration.h +robot_time_decl.h +../include/robot/robot_time_decl.h +sys/timeb.h +- +sys/time.h +- + +/home/duongtd/robotics_core/robot_time/test/duration.cpp +limits +- +gtest/gtest.h +- +robot/duration.h +- +robot/time.h +- + diff --git a/build/CMakeFiles/robot_duration_test.dir/DependInfo.cmake b/build/CMakeFiles/robot_duration_test.dir/DependInfo.cmake new file mode 100644 index 0000000..99cdfe9 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/DependInfo.cmake @@ -0,0 +1,22 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/home/duongtd/robotics_core/robot_time/test/duration.cpp" "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/robot_duration_test.dir/test/duration.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "GNU") + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "../include" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir/DependInfo.cmake" + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/robot_duration_test.dir/build.make b/build/CMakeFiles/robot_duration_test.dir/build.make new file mode 100644 index 0000000..24f9226 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/build.make @@ -0,0 +1,102 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/duongtd/robotics_core/robot_time + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/duongtd/robotics_core/robot_time/build + +# Include any dependencies generated for this target. +include CMakeFiles/robot_duration_test.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/robot_duration_test.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/robot_duration_test.dir/flags.make + +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: CMakeFiles/robot_duration_test.dir/flags.make +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../test/duration.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/robot_duration_test.dir/test/duration.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/robot_duration_test.dir/test/duration.cpp.o -c /home/duongtd/robotics_core/robot_time/test/duration.cpp + +CMakeFiles/robot_duration_test.dir/test/duration.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/robot_duration_test.dir/test/duration.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/duongtd/robotics_core/robot_time/test/duration.cpp > CMakeFiles/robot_duration_test.dir/test/duration.cpp.i + +CMakeFiles/robot_duration_test.dir/test/duration.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/robot_duration_test.dir/test/duration.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/duongtd/robotics_core/robot_time/test/duration.cpp -o CMakeFiles/robot_duration_test.dir/test/duration.cpp.s + +# Object files for target robot_duration_test +robot_duration_test_OBJECTS = \ +"CMakeFiles/robot_duration_test.dir/test/duration.cpp.o" + +# External object files for target robot_duration_test +robot_duration_test_EXTERNAL_OBJECTS = + +robot_duration_test: CMakeFiles/robot_duration_test.dir/test/duration.cpp.o +robot_duration_test: CMakeFiles/robot_duration_test.dir/build.make +robot_duration_test: librostime.a +robot_duration_test: /usr/local/lib/libgtest.a +robot_duration_test: /usr/local/lib/libgtest_main.a +robot_duration_test: /usr/local/lib/libgtest.a +robot_duration_test: CMakeFiles/robot_duration_test.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable robot_duration_test" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/robot_duration_test.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/robot_duration_test.dir/build: robot_duration_test + +.PHONY : CMakeFiles/robot_duration_test.dir/build + +CMakeFiles/robot_duration_test.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/robot_duration_test.dir/cmake_clean.cmake +.PHONY : CMakeFiles/robot_duration_test.dir/clean + +CMakeFiles/robot_duration_test.dir/depend: + cd /home/duongtd/robotics_core/robot_time/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/duongtd/robotics_core/robot_time /home/duongtd/robotics_core/robot_time /home/duongtd/robotics_core/robot_time/build /home/duongtd/robotics_core/robot_time/build /home/duongtd/robotics_core/robot_time/build/CMakeFiles/robot_duration_test.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/robot_duration_test.dir/depend + diff --git a/build/CMakeFiles/robot_duration_test.dir/cmake_clean.cmake b/build/CMakeFiles/robot_duration_test.dir/cmake_clean.cmake new file mode 100644 index 0000000..15d87c5 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/robot_duration_test.dir/test/duration.cpp.o" + "robot_duration_test" + "robot_duration_test.pdb" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/robot_duration_test.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/build/CMakeFiles/robot_duration_test.dir/depend.internal b/build/CMakeFiles/robot_duration_test.dir/depend.internal new file mode 100644 index 0000000..09835cf --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/depend.internal @@ -0,0 +1,11 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o + ../include/robot/duration.h + ../include/robot/exception.h + ../include/robot/macros.h + ../include/robot/platform.h + ../include/robot/robot_time_decl.h + ../include/robot/time.h + /home/duongtd/robotics_core/robot_time/test/duration.cpp diff --git a/build/CMakeFiles/robot_duration_test.dir/depend.make b/build/CMakeFiles/robot_duration_test.dir/depend.make new file mode 100644 index 0000000..42dd828 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/depend.make @@ -0,0 +1,11 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../include/robot/duration.h +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../include/robot/exception.h +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../include/robot/macros.h +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../include/robot/platform.h +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../include/robot/robot_time_decl.h +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../include/robot/time.h +CMakeFiles/robot_duration_test.dir/test/duration.cpp.o: ../test/duration.cpp + diff --git a/build/CMakeFiles/robot_duration_test.dir/flags.make b/build/CMakeFiles/robot_duration_test.dir/flags.make new file mode 100644 index 0000000..c8b80f8 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# compile CXX with /usr/bin/c++ +CXX_FLAGS = -std=c++17 + +CXX_DEFINES = + +CXX_INCLUDES = -I/home/duongtd/robotics_core/robot_time/include + diff --git a/build/CMakeFiles/robot_duration_test.dir/link.txt b/build/CMakeFiles/robot_duration_test.dir/link.txt new file mode 100644 index 0000000..615f8b4 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/c++ CMakeFiles/robot_duration_test.dir/test/duration.cpp.o -o robot_duration_test librostime.a /usr/local/lib/libgtest.a /usr/local/lib/libgtest_main.a /usr/local/lib/libgtest.a -lpthread diff --git a/build/CMakeFiles/robot_duration_test.dir/progress.make b/build/CMakeFiles/robot_duration_test.dir/progress.make new file mode 100644 index 0000000..abadeb0 --- /dev/null +++ b/build/CMakeFiles/robot_duration_test.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 + diff --git a/build/CMakeFiles/robot_duration_test.dir/test/duration.cpp.o b/build/CMakeFiles/robot_duration_test.dir/test/duration.cpp.o new file mode 100644 index 0000000..b62ba69 Binary files /dev/null and b/build/CMakeFiles/robot_duration_test.dir/test/duration.cpp.o differ diff --git a/build/CMakeFiles/robot_time_test.dir/CXX.includecache b/build/CMakeFiles/robot_time_test.dir/CXX.includecache new file mode 100644 index 0000000..7fbca2c --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/CXX.includecache @@ -0,0 +1,74 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +../include/robot/duration.h +iostream +- +math.h +- +stdexcept +- +climits +- +stdint.h +- +robot_time_decl.h +../include/robot/robot_time_decl.h + +../include/robot/exception.h +stdexcept +- +string +- + +../include/robot/macros.h + +../include/robot/platform.h + +../include/robot/rate.h +robot/time.h +../include/robot/robot/time.h +robot_time_decl.h +../include/robot/robot_time_decl.h + +../include/robot/robot_time_decl.h +robot/macros.h +- + +../include/robot/time.h +robot/platform.h +- +iostream +- +cmath +- +robot/exception.h +- +duration.h +../include/robot/duration.h +robot_time_decl.h +../include/robot/robot_time_decl.h +sys/timeb.h +- +sys/time.h +- + +/home/duongtd/robotics_core/robot_time/test/time.cpp +limits +- +vector +- +gtest/gtest.h +- +robot/rate.h +- +robot/time.h +- +sys/time.h +- + diff --git a/build/CMakeFiles/robot_time_test.dir/DependInfo.cmake b/build/CMakeFiles/robot_time_test.dir/DependInfo.cmake new file mode 100644 index 0000000..c4c8eb5 --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/DependInfo.cmake @@ -0,0 +1,22 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/home/duongtd/robotics_core/robot_time/test/time.cpp" "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/robot_time_test.dir/test/time.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "GNU") + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "../include" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir/DependInfo.cmake" + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/robot_time_test.dir/build.make b/build/CMakeFiles/robot_time_test.dir/build.make new file mode 100644 index 0000000..48a2fe2 --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/build.make @@ -0,0 +1,102 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/duongtd/robotics_core/robot_time + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/duongtd/robotics_core/robot_time/build + +# Include any dependencies generated for this target. +include CMakeFiles/robot_time_test.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/robot_time_test.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/robot_time_test.dir/flags.make + +CMakeFiles/robot_time_test.dir/test/time.cpp.o: CMakeFiles/robot_time_test.dir/flags.make +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../test/time.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/robot_time_test.dir/test/time.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/robot_time_test.dir/test/time.cpp.o -c /home/duongtd/robotics_core/robot_time/test/time.cpp + +CMakeFiles/robot_time_test.dir/test/time.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/robot_time_test.dir/test/time.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/duongtd/robotics_core/robot_time/test/time.cpp > CMakeFiles/robot_time_test.dir/test/time.cpp.i + +CMakeFiles/robot_time_test.dir/test/time.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/robot_time_test.dir/test/time.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/duongtd/robotics_core/robot_time/test/time.cpp -o CMakeFiles/robot_time_test.dir/test/time.cpp.s + +# Object files for target robot_time_test +robot_time_test_OBJECTS = \ +"CMakeFiles/robot_time_test.dir/test/time.cpp.o" + +# External object files for target robot_time_test +robot_time_test_EXTERNAL_OBJECTS = + +robot_time_test: CMakeFiles/robot_time_test.dir/test/time.cpp.o +robot_time_test: CMakeFiles/robot_time_test.dir/build.make +robot_time_test: librostime.a +robot_time_test: /usr/local/lib/libgtest.a +robot_time_test: /usr/local/lib/libgtest_main.a +robot_time_test: /usr/local/lib/libgtest.a +robot_time_test: CMakeFiles/robot_time_test.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable robot_time_test" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/robot_time_test.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/robot_time_test.dir/build: robot_time_test + +.PHONY : CMakeFiles/robot_time_test.dir/build + +CMakeFiles/robot_time_test.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/robot_time_test.dir/cmake_clean.cmake +.PHONY : CMakeFiles/robot_time_test.dir/clean + +CMakeFiles/robot_time_test.dir/depend: + cd /home/duongtd/robotics_core/robot_time/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/duongtd/robotics_core/robot_time /home/duongtd/robotics_core/robot_time /home/duongtd/robotics_core/robot_time/build /home/duongtd/robotics_core/robot_time/build /home/duongtd/robotics_core/robot_time/build/CMakeFiles/robot_time_test.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/robot_time_test.dir/depend + diff --git a/build/CMakeFiles/robot_time_test.dir/cmake_clean.cmake b/build/CMakeFiles/robot_time_test.dir/cmake_clean.cmake new file mode 100644 index 0000000..ff0b956 --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/robot_time_test.dir/test/time.cpp.o" + "robot_time_test" + "robot_time_test.pdb" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/robot_time_test.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/build/CMakeFiles/robot_time_test.dir/depend.internal b/build/CMakeFiles/robot_time_test.dir/depend.internal new file mode 100644 index 0000000..a07dcfa --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/depend.internal @@ -0,0 +1,12 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +CMakeFiles/robot_time_test.dir/test/time.cpp.o + ../include/robot/duration.h + ../include/robot/exception.h + ../include/robot/macros.h + ../include/robot/platform.h + ../include/robot/rate.h + ../include/robot/robot_time_decl.h + ../include/robot/time.h + /home/duongtd/robotics_core/robot_time/test/time.cpp diff --git a/build/CMakeFiles/robot_time_test.dir/depend.make b/build/CMakeFiles/robot_time_test.dir/depend.make new file mode 100644 index 0000000..4a150d2 --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/depend.make @@ -0,0 +1,12 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/duration.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/exception.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/macros.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/platform.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/rate.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/robot_time_decl.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../include/robot/time.h +CMakeFiles/robot_time_test.dir/test/time.cpp.o: ../test/time.cpp + diff --git a/build/CMakeFiles/robot_time_test.dir/flags.make b/build/CMakeFiles/robot_time_test.dir/flags.make new file mode 100644 index 0000000..c8b80f8 --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# compile CXX with /usr/bin/c++ +CXX_FLAGS = -std=c++17 + +CXX_DEFINES = + +CXX_INCLUDES = -I/home/duongtd/robotics_core/robot_time/include + diff --git a/build/CMakeFiles/robot_time_test.dir/link.txt b/build/CMakeFiles/robot_time_test.dir/link.txt new file mode 100644 index 0000000..d767af0 --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/c++ CMakeFiles/robot_time_test.dir/test/time.cpp.o -o robot_time_test librostime.a /usr/local/lib/libgtest.a /usr/local/lib/libgtest_main.a /usr/local/lib/libgtest.a -lpthread diff --git a/build/CMakeFiles/robot_time_test.dir/progress.make b/build/CMakeFiles/robot_time_test.dir/progress.make new file mode 100644 index 0000000..8c8fb6f --- /dev/null +++ b/build/CMakeFiles/robot_time_test.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 3 +CMAKE_PROGRESS_2 = 4 + diff --git a/build/CMakeFiles/robot_time_test.dir/test/time.cpp.o b/build/CMakeFiles/robot_time_test.dir/test/time.cpp.o new file mode 100644 index 0000000..1788ca5 Binary files /dev/null and b/build/CMakeFiles/robot_time_test.dir/test/time.cpp.o differ diff --git a/build/CMakeFiles/rostime.dir/CXX.includecache b/build/CMakeFiles/rostime.dir/CXX.includecache new file mode 100644 index 0000000..0eaf1d5 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/CXX.includecache @@ -0,0 +1,128 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +../include/robot/duration.h +iostream +- +math.h +- +stdexcept +- +climits +- +stdint.h +- +robot_time_decl.h +../include/robot/robot_time_decl.h + +../include/robot/exception.h +stdexcept +- +string +- + +../include/robot/impl/duration.h +cmath +- +limits +- +robot/duration.h +- +robot/rate.h +- + +../include/robot/impl/time.h +robot/platform.h +- +iostream +- +cmath +- +limits +- +robot/exception.h +- +robot/time.h +- +sys/timeb.h +- +sys/time.h +- + +../include/robot/macros.h + +../include/robot/platform.h + +../include/robot/rate.h +robot/time.h +../include/robot/robot/time.h +robot_time_decl.h +../include/robot/robot_time_decl.h + +../include/robot/robot_time_decl.h +robot/macros.h +- + +../include/robot/time.h +robot/platform.h +- +iostream +- +cmath +- +robot/exception.h +- +duration.h +../include/robot/duration.h +robot_time_decl.h +../include/robot/robot_time_decl.h +sys/timeb.h +- +sys/time.h +- + +/home/duongtd/robotics_core/robot_time/src/duration.cpp +robot/duration.h +- +robot/impl/duration.h +- + +/home/duongtd/robotics_core/robot_time/src/rate.cpp +robot/rate.h +- + +/home/duongtd/robotics_core/robot_time/src/time.cpp +robot/time.h +/home/duongtd/robotics_core/robot_time/src/robot/time.h +robot/impl/time.h +/home/duongtd/robotics_core/robot_time/src/robot/impl/time.h +cmath +- +ctime +- +iomanip +- +limits +- +stdexcept +- +mach/clock.h +- +mach/mach.h +- +chrono +- +thread +- +windows.h +- +mutex +- +chrono +- + diff --git a/build/CMakeFiles/rostime.dir/DependInfo.cmake b/build/CMakeFiles/rostime.dir/DependInfo.cmake new file mode 100644 index 0000000..206b904 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/DependInfo.cmake @@ -0,0 +1,23 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/home/duongtd/robotics_core/robot_time/src/duration.cpp" "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir/src/duration.cpp.o" + "/home/duongtd/robotics_core/robot_time/src/rate.cpp" "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir/src/rate.cpp.o" + "/home/duongtd/robotics_core/robot_time/src/time.cpp" "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir/src/time.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "GNU") + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "../include" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/rostime.dir/build.make b/build/CMakeFiles/rostime.dir/build.make new file mode 100644 index 0000000..e6bc78f --- /dev/null +++ b/build/CMakeFiles/rostime.dir/build.make @@ -0,0 +1,129 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/duongtd/robotics_core/robot_time + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/duongtd/robotics_core/robot_time/build + +# Include any dependencies generated for this target. +include CMakeFiles/rostime.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/rostime.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/rostime.dir/flags.make + +CMakeFiles/rostime.dir/src/duration.cpp.o: CMakeFiles/rostime.dir/flags.make +CMakeFiles/rostime.dir/src/duration.cpp.o: ../src/duration.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/rostime.dir/src/duration.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/rostime.dir/src/duration.cpp.o -c /home/duongtd/robotics_core/robot_time/src/duration.cpp + +CMakeFiles/rostime.dir/src/duration.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/rostime.dir/src/duration.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/duongtd/robotics_core/robot_time/src/duration.cpp > CMakeFiles/rostime.dir/src/duration.cpp.i + +CMakeFiles/rostime.dir/src/duration.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rostime.dir/src/duration.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/duongtd/robotics_core/robot_time/src/duration.cpp -o CMakeFiles/rostime.dir/src/duration.cpp.s + +CMakeFiles/rostime.dir/src/rate.cpp.o: CMakeFiles/rostime.dir/flags.make +CMakeFiles/rostime.dir/src/rate.cpp.o: ../src/rate.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/rostime.dir/src/rate.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/rostime.dir/src/rate.cpp.o -c /home/duongtd/robotics_core/robot_time/src/rate.cpp + +CMakeFiles/rostime.dir/src/rate.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/rostime.dir/src/rate.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/duongtd/robotics_core/robot_time/src/rate.cpp > CMakeFiles/rostime.dir/src/rate.cpp.i + +CMakeFiles/rostime.dir/src/rate.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rostime.dir/src/rate.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/duongtd/robotics_core/robot_time/src/rate.cpp -o CMakeFiles/rostime.dir/src/rate.cpp.s + +CMakeFiles/rostime.dir/src/time.cpp.o: CMakeFiles/rostime.dir/flags.make +CMakeFiles/rostime.dir/src/time.cpp.o: ../src/time.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/rostime.dir/src/time.cpp.o" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/rostime.dir/src/time.cpp.o -c /home/duongtd/robotics_core/robot_time/src/time.cpp + +CMakeFiles/rostime.dir/src/time.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/rostime.dir/src/time.cpp.i" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/duongtd/robotics_core/robot_time/src/time.cpp > CMakeFiles/rostime.dir/src/time.cpp.i + +CMakeFiles/rostime.dir/src/time.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/rostime.dir/src/time.cpp.s" + /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/duongtd/robotics_core/robot_time/src/time.cpp -o CMakeFiles/rostime.dir/src/time.cpp.s + +# Object files for target rostime +rostime_OBJECTS = \ +"CMakeFiles/rostime.dir/src/duration.cpp.o" \ +"CMakeFiles/rostime.dir/src/rate.cpp.o" \ +"CMakeFiles/rostime.dir/src/time.cpp.o" + +# External object files for target rostime +rostime_EXTERNAL_OBJECTS = + +librostime.a: CMakeFiles/rostime.dir/src/duration.cpp.o +librostime.a: CMakeFiles/rostime.dir/src/rate.cpp.o +librostime.a: CMakeFiles/rostime.dir/src/time.cpp.o +librostime.a: CMakeFiles/rostime.dir/build.make +librostime.a: CMakeFiles/rostime.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/duongtd/robotics_core/robot_time/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Linking CXX static library librostime.a" + $(CMAKE_COMMAND) -P CMakeFiles/rostime.dir/cmake_clean_target.cmake + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/rostime.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/rostime.dir/build: librostime.a + +.PHONY : CMakeFiles/rostime.dir/build + +CMakeFiles/rostime.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/rostime.dir/cmake_clean.cmake +.PHONY : CMakeFiles/rostime.dir/clean + +CMakeFiles/rostime.dir/depend: + cd /home/duongtd/robotics_core/robot_time/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/duongtd/robotics_core/robot_time /home/duongtd/robotics_core/robot_time /home/duongtd/robotics_core/robot_time/build /home/duongtd/robotics_core/robot_time/build /home/duongtd/robotics_core/robot_time/build/CMakeFiles/rostime.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/rostime.dir/depend + diff --git a/build/CMakeFiles/rostime.dir/cmake_clean.cmake b/build/CMakeFiles/rostime.dir/cmake_clean.cmake new file mode 100644 index 0000000..1e4c520 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/cmake_clean.cmake @@ -0,0 +1,12 @@ +file(REMOVE_RECURSE + "CMakeFiles/rostime.dir/src/duration.cpp.o" + "CMakeFiles/rostime.dir/src/rate.cpp.o" + "CMakeFiles/rostime.dir/src/time.cpp.o" + "librostime.a" + "librostime.pdb" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/rostime.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/build/CMakeFiles/rostime.dir/cmake_clean_target.cmake b/build/CMakeFiles/rostime.dir/cmake_clean_target.cmake new file mode 100644 index 0000000..ad3ec04 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/cmake_clean_target.cmake @@ -0,0 +1,3 @@ +file(REMOVE_RECURSE + "librostime.a" +) diff --git a/build/CMakeFiles/rostime.dir/depend.internal b/build/CMakeFiles/rostime.dir/depend.internal new file mode 100644 index 0000000..f9c9202 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/depend.internal @@ -0,0 +1,31 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +CMakeFiles/rostime.dir/src/duration.cpp.o + ../include/robot/duration.h + ../include/robot/exception.h + ../include/robot/impl/duration.h + ../include/robot/macros.h + ../include/robot/platform.h + ../include/robot/rate.h + ../include/robot/robot_time_decl.h + ../include/robot/time.h + /home/duongtd/robotics_core/robot_time/src/duration.cpp +CMakeFiles/rostime.dir/src/rate.cpp.o + ../include/robot/duration.h + ../include/robot/exception.h + ../include/robot/macros.h + ../include/robot/platform.h + ../include/robot/rate.h + ../include/robot/robot_time_decl.h + ../include/robot/time.h + /home/duongtd/robotics_core/robot_time/src/rate.cpp +CMakeFiles/rostime.dir/src/time.cpp.o + ../include/robot/duration.h + ../include/robot/exception.h + ../include/robot/impl/time.h + ../include/robot/macros.h + ../include/robot/platform.h + ../include/robot/robot_time_decl.h + ../include/robot/time.h + /home/duongtd/robotics_core/robot_time/src/time.cpp diff --git a/build/CMakeFiles/rostime.dir/depend.make b/build/CMakeFiles/rostime.dir/depend.make new file mode 100644 index 0000000..7871543 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/depend.make @@ -0,0 +1,31 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/duration.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/exception.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/impl/duration.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/macros.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/platform.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/rate.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/robot_time_decl.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../include/robot/time.h +CMakeFiles/rostime.dir/src/duration.cpp.o: ../src/duration.cpp + +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/duration.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/exception.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/macros.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/platform.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/rate.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/robot_time_decl.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../include/robot/time.h +CMakeFiles/rostime.dir/src/rate.cpp.o: ../src/rate.cpp + +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/duration.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/exception.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/impl/time.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/macros.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/platform.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/robot_time_decl.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../include/robot/time.h +CMakeFiles/rostime.dir/src/time.cpp.o: ../src/time.cpp + diff --git a/build/CMakeFiles/rostime.dir/flags.make b/build/CMakeFiles/rostime.dir/flags.make new file mode 100644 index 0000000..c8b80f8 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# compile CXX with /usr/bin/c++ +CXX_FLAGS = -std=c++17 + +CXX_DEFINES = + +CXX_INCLUDES = -I/home/duongtd/robotics_core/robot_time/include + diff --git a/build/CMakeFiles/rostime.dir/link.txt b/build/CMakeFiles/rostime.dir/link.txt new file mode 100644 index 0000000..42ee8b7 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/link.txt @@ -0,0 +1,2 @@ +/usr/bin/ar qc librostime.a CMakeFiles/rostime.dir/src/duration.cpp.o CMakeFiles/rostime.dir/src/rate.cpp.o CMakeFiles/rostime.dir/src/time.cpp.o +/usr/bin/ranlib librostime.a diff --git a/build/CMakeFiles/rostime.dir/progress.make b/build/CMakeFiles/rostime.dir/progress.make new file mode 100644 index 0000000..245cd69 --- /dev/null +++ b/build/CMakeFiles/rostime.dir/progress.make @@ -0,0 +1,5 @@ +CMAKE_PROGRESS_1 = 5 +CMAKE_PROGRESS_2 = 6 +CMAKE_PROGRESS_3 = 7 +CMAKE_PROGRESS_4 = 8 + diff --git a/build/CMakeFiles/rostime.dir/src/duration.cpp.o b/build/CMakeFiles/rostime.dir/src/duration.cpp.o new file mode 100644 index 0000000..18dd9da Binary files /dev/null and b/build/CMakeFiles/rostime.dir/src/duration.cpp.o differ diff --git a/build/CMakeFiles/rostime.dir/src/rate.cpp.o b/build/CMakeFiles/rostime.dir/src/rate.cpp.o new file mode 100644 index 0000000..ad62abd Binary files /dev/null and b/build/CMakeFiles/rostime.dir/src/rate.cpp.o differ diff --git a/build/CMakeFiles/rostime.dir/src/time.cpp.o b/build/CMakeFiles/rostime.dir/src/time.cpp.o new file mode 100644 index 0000000..dc36a3b Binary files /dev/null and b/build/CMakeFiles/rostime.dir/src/time.cpp.o differ diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..4cc89dd --- /dev/null +++ b/build/Makefile @@ -0,0 +1,376 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.16 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/duongtd/robotics_core/robot_time + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/duongtd/robotics_core/robot_time/build + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." + /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles /home/duongtd/robotics_core/robot_time/build/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/duongtd/robotics_core/robot_time/build/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named robot_duration_test + +# Build rule for target. +robot_duration_test: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 robot_duration_test +.PHONY : robot_duration_test + +# fast build rule for target. +robot_duration_test/fast: + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/build +.PHONY : robot_duration_test/fast + +#============================================================================= +# Target rules for targets named robot_time_test + +# Build rule for target. +robot_time_test: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 robot_time_test +.PHONY : robot_time_test + +# fast build rule for target. +robot_time_test/fast: + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/build +.PHONY : robot_time_test/fast + +#============================================================================= +# Target rules for targets named rostime + +# Build rule for target. +rostime: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rostime +.PHONY : rostime + +# fast build rule for target. +rostime/fast: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/build +.PHONY : rostime/fast + +src/duration.o: src/duration.cpp.o + +.PHONY : src/duration.o + +# target to build an object file +src/duration.cpp.o: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/duration.cpp.o +.PHONY : src/duration.cpp.o + +src/duration.i: src/duration.cpp.i + +.PHONY : src/duration.i + +# target to preprocess a source file +src/duration.cpp.i: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/duration.cpp.i +.PHONY : src/duration.cpp.i + +src/duration.s: src/duration.cpp.s + +.PHONY : src/duration.s + +# target to generate assembly for a file +src/duration.cpp.s: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/duration.cpp.s +.PHONY : src/duration.cpp.s + +src/rate.o: src/rate.cpp.o + +.PHONY : src/rate.o + +# target to build an object file +src/rate.cpp.o: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/rate.cpp.o +.PHONY : src/rate.cpp.o + +src/rate.i: src/rate.cpp.i + +.PHONY : src/rate.i + +# target to preprocess a source file +src/rate.cpp.i: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/rate.cpp.i +.PHONY : src/rate.cpp.i + +src/rate.s: src/rate.cpp.s + +.PHONY : src/rate.s + +# target to generate assembly for a file +src/rate.cpp.s: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/rate.cpp.s +.PHONY : src/rate.cpp.s + +src/time.o: src/time.cpp.o + +.PHONY : src/time.o + +# target to build an object file +src/time.cpp.o: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/time.cpp.o +.PHONY : src/time.cpp.o + +src/time.i: src/time.cpp.i + +.PHONY : src/time.i + +# target to preprocess a source file +src/time.cpp.i: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/time.cpp.i +.PHONY : src/time.cpp.i + +src/time.s: src/time.cpp.s + +.PHONY : src/time.s + +# target to generate assembly for a file +src/time.cpp.s: + $(MAKE) -f CMakeFiles/rostime.dir/build.make CMakeFiles/rostime.dir/src/time.cpp.s +.PHONY : src/time.cpp.s + +test/duration.o: test/duration.cpp.o + +.PHONY : test/duration.o + +# target to build an object file +test/duration.cpp.o: + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/test/duration.cpp.o +.PHONY : test/duration.cpp.o + +test/duration.i: test/duration.cpp.i + +.PHONY : test/duration.i + +# target to preprocess a source file +test/duration.cpp.i: + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/test/duration.cpp.i +.PHONY : test/duration.cpp.i + +test/duration.s: test/duration.cpp.s + +.PHONY : test/duration.s + +# target to generate assembly for a file +test/duration.cpp.s: + $(MAKE) -f CMakeFiles/robot_duration_test.dir/build.make CMakeFiles/robot_duration_test.dir/test/duration.cpp.s +.PHONY : test/duration.cpp.s + +test/time.o: test/time.cpp.o + +.PHONY : test/time.o + +# target to build an object file +test/time.cpp.o: + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/test/time.cpp.o +.PHONY : test/time.cpp.o + +test/time.i: test/time.cpp.i + +.PHONY : test/time.i + +# target to preprocess a source file +test/time.cpp.i: + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/test/time.cpp.i +.PHONY : test/time.cpp.i + +test/time.s: test/time.cpp.s + +.PHONY : test/time.s + +# target to generate assembly for a file +test/time.cpp.s: + $(MAKE) -f CMakeFiles/robot_time_test.dir/build.make CMakeFiles/robot_time_test.dir/test/time.cpp.s +.PHONY : test/time.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/strip" + @echo "... install/local" + @echo "... install" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... robot_duration_test" + @echo "... robot_time_test" + @echo "... rostime" + @echo "... src/duration.o" + @echo "... src/duration.i" + @echo "... src/duration.s" + @echo "... src/rate.o" + @echo "... src/rate.i" + @echo "... src/rate.s" + @echo "... src/time.o" + @echo "... src/time.i" + @echo "... src/time.s" + @echo "... test/duration.o" + @echo "... test/duration.i" + @echo "... test/duration.s" + @echo "... test/time.o" + @echo "... test/time.i" + @echo "... test/time.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/build/cmake_install.cmake b/build/cmake_install.cmake new file mode 100644 index 0000000..aa54a82 --- /dev/null +++ b/build/cmake_install.cmake @@ -0,0 +1,76 @@ +# Install script for directory: /home/duongtd/robotics_core/robot_time + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/home/duongtd/robotics_core/robot_time/build/librostime.a") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE DIRECTORY FILES "/home/duongtd/robotics_core/robot_time/include/" FILES_MATCHING REGEX "/[^/]*\\.h$") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/rostime/rostimeTargets.cmake") + file(DIFFERENT EXPORT_FILE_CHANGED FILES + "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/rostime/rostimeTargets.cmake" + "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets.cmake") + if(EXPORT_FILE_CHANGED) + file(GLOB OLD_CONFIG_FILES "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/rostime/rostimeTargets-*.cmake") + if(OLD_CONFIG_FILES) + message(STATUS "Old export file \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/rostime/rostimeTargets.cmake\" will be replaced. Removing files [${OLD_CONFIG_FILES}].") + file(REMOVE ${OLD_CONFIG_FILES}) + endif() + endif() + endif() + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/rostime" TYPE FILE FILES "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets.cmake") + if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^()$") + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/rostime" TYPE FILE FILES "/home/duongtd/robotics_core/robot_time/build/CMakeFiles/Export/lib/cmake/rostime/rostimeTargets-noconfig.cmake") + endif() +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/home/duongtd/robotics_core/robot_time/build/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/build/librostime.a b/build/librostime.a new file mode 100644 index 0000000..3e9fabc Binary files /dev/null and b/build/librostime.a differ diff --git a/build/robot_duration_test b/build/robot_duration_test new file mode 100755 index 0000000..4372cff Binary files /dev/null and b/build/robot_duration_test differ diff --git a/build/robot_time_test b/build/robot_time_test new file mode 100755 index 0000000..34f72f8 Binary files /dev/null and b/build/robot_time_test differ diff --git a/include/robot/duration.h b/include/robot/duration.h new file mode 100644 index 0000000..6e47fbc --- /dev/null +++ b/include/robot/duration.h @@ -0,0 +1,185 @@ +/********************************************************************* +* Software License Agreement (BSD License) +* +* Copyright (c) 2008, Willow Garage, Inc. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of Willow Garage, Inc. nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +*********************************************************************/ + +#ifndef ROBOT_DURATION_H +#define ROBOT_DURATION_H + +/********************************************************************* + ** Pragmas + *********************************************************************/ + +#ifdef _MSC_VER + // Robot_time has some magic interface that doesn't directly include + // its implementation, this just disbales those warnings. + #pragma warning(disable: 4244) + #pragma warning(disable: 4661) +#endif + +#include +#include +#include +#include +#include +#include "robot_time_decl.h" + +namespace robot +{ +ROBOT_TIME_DECL void normalizeSecNSecSigned(int64_t& sec, int64_t& nsec); +ROBOT_TIME_DECL void normalizeSecNSecSigned(int32_t& sec, int32_t& nsec); + +/** + * \brief Base class for Duration implementations. Provides storage, common functions and operator overloads. + * This should not need to be used directly. + */ +template +class DurationBase +{ +public: + int32_t sec, nsec; + DurationBase() : sec(0), nsec(0) { } + DurationBase(int32_t _sec, int32_t _nsec); + explicit DurationBase(double t){fromSec(t);}; + T operator+(const T &rhs) const; + T operator-(const T &rhs) const; + T operator-() const; + T operator*(double scale) const; + T& operator+=(const T &rhs); + T& operator-=(const T &rhs); + T& operator*=(double scale); + bool operator==(const T &rhs) const; + inline bool operator!=(const T &rhs) const { return !(*static_cast(this) == rhs); } + bool operator>(const T &rhs) const; + bool operator<(const T &rhs) const; + bool operator>=(const T &rhs) const; + bool operator<=(const T &rhs) const; + double toSec() const { return static_cast(sec) + 1e-9*static_cast(nsec); }; + int64_t toNSec() const {return static_cast(sec)*1000000000ll + static_cast(nsec); }; + T& fromSec(double t); + T& fromNSec(int64_t t); + bool isZero() const; + // boost::posix_time conversion removed in std-only build + static const T MIN; //!< Minimum representable duration (negative) + static const T MAX; //!< Maximum representable duration + static const T ZERO; //!< Zero duration + static const T DAY; //!< One day duration + static const T HOUR; //!< One hour duration + static const T MINUTE; //!< One minute duration + static const T SECOND; //!< One second duration + static const T MILLISECOND; //!< One millisecond duration + static const T MICROSECOND; //!< One microsecond duration + static const T NANOSECOND; //!< One nanosecond duration +}; + +class Rate; + +/** + * \brief Duration representation for use with the Time class. + * + * robot::DurationBase provides most of its functionality. + */ +class ROBOT_TIME_DECL Duration : public DurationBase +{ +public: + Duration() + : DurationBase() + { } + + Duration(int32_t _sec, int32_t _nsec) + : DurationBase(_sec, _nsec) + {} + + explicit Duration(double t) { fromSec(t); } + explicit Duration(const Rate&); + /** + * \brief sleep for the amount of time specified by this Duration. If a signal interrupts the sleep, resleeps for the time remaining. + * @return True if the desired sleep duration was met, false otherwise. + */ + bool sleep() const; +}; + +extern ROBOT_TIME_DECL const Duration DURATION_MAX; +extern ROBOT_TIME_DECL const Duration DURATION_MIN; +template<> const Duration DurationBase::MAX; +template<> const Duration DurationBase::MIN; +template<> const Duration DurationBase::ZERO; +template<> const Duration DurationBase::DAY; +template<> const Duration DurationBase::HOUR; +template<> const Duration DurationBase::MINUTE; +template<> const Duration DurationBase::SECOND; +template<> const Duration DurationBase::MILLISECOND; +template<> const Duration DurationBase::MICROSECOND; +template<> const Duration DurationBase::NANOSECOND; + +/** + * \brief Duration representation for use with the WallTime class. + * + * robot::DurationBase provides most of its functionality. + */ +class ROBOT_TIME_DECL WallDuration : public DurationBase +{ +public: + WallDuration() + : DurationBase() + { } + + WallDuration(int32_t _sec, int32_t _nsec) + : DurationBase(_sec, _nsec) + {} + + explicit WallDuration(double t) { fromSec(t); } + explicit WallDuration(const Rate&); + /** + * \brief sleep for the amount of time specified by this Duration. If a signal interrupts the sleep, resleeps for the time remaining. + * @return True if the desired sleep duration was met, false otherwise. + */ + bool sleep() const; +}; + +template<> const WallDuration DurationBase::MAX; +template<> const WallDuration DurationBase::MIN; +template<> const WallDuration DurationBase::ZERO; +template<> const WallDuration DurationBase::DAY; +template<> const WallDuration DurationBase::HOUR; +template<> const WallDuration DurationBase::MINUTE; +template<> const WallDuration DurationBase::SECOND; +template<> const WallDuration DurationBase::MILLISECOND; +template<> const WallDuration DurationBase::MICROSECOND; +template<> const WallDuration DurationBase::NANOSECOND; + +ROBOT_TIME_DECL std::ostream &operator <<(std::ostream &os, const Duration &rhs); +ROBOT_TIME_DECL std::ostream &operator <<(std::ostream &os, const WallDuration &rhs); + +} + +#endif // ROBOT_DURATION_H diff --git a/include/robot/exception.h b/include/robot/exception.h new file mode 100644 index 0000000..2a2de29 --- /dev/null +++ b/include/robot/exception.h @@ -0,0 +1,22 @@ +/********************************************************************* + * Minimal exception type compatible with existing code. + *********************************************************************/ +#ifndef ROBOT_MINIMAL_EXCEPTION_H +#define ROBOT_MINIMAL_EXCEPTION_H + +#include +#include + +namespace robot { + +class Exception : public std::runtime_error { +public: + explicit Exception(const std::string& what_arg) + : std::runtime_error(what_arg) {} +}; + +} // namespace robot + +#endif // ROBOT_MINIMAL_EXCEPTION_H + + diff --git a/include/robot/impl/duration.h b/include/robot/impl/duration.h new file mode 100644 index 0000000..3262c03 --- /dev/null +++ b/include/robot/impl/duration.h @@ -0,0 +1,190 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2010, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ +#ifndef ROBOT_TIME_IMPL_DURATION_H_INCLUDED +#define ROBOT_TIME_IMPL_DURATION_H_INCLUDED + +#include +#include + +#include +#include + +namespace robot { + // + // DurationBase template member function implementation + // + template + DurationBase::DurationBase(int32_t _sec, int32_t _nsec) + : sec(_sec), nsec(_nsec) + { + normalizeSecNSecSigned(sec, nsec); + } + + template + T& DurationBase::fromSec(double d) + { + if (!std::isfinite(d)) + throw std::runtime_error("Duration has to be finite."); + constexpr double minInt64AsDouble = static_cast(std::numeric_limits::min()); + constexpr double maxInt64AsDouble = static_cast(std::numeric_limits::max()); + if (d <= minInt64AsDouble || d >= maxInt64AsDouble) + throw std::runtime_error("Duration is out of 64-bit integer range"); + int64_t sec64 = static_cast(floor(d)); + if (sec64 < std::numeric_limits::min() || sec64 > std::numeric_limits::max()) + throw std::runtime_error("Duration is out of dual 32-bit range"); + sec = static_cast(sec64); + nsec = static_cast(std::llround((d - sec) * 1e9)); + int32_t rollover = nsec / 1000000000ul; + sec += rollover; + nsec %= 1000000000ul; + return *static_cast(this); + } + + template + T& DurationBase::fromNSec(int64_t t) + { + int64_t sec64 = t / 1000000000LL; + if (sec64 < std::numeric_limits::min() || sec64 > std::numeric_limits::max()) + throw std::runtime_error("Duration is out of dual 32-bit range"); + sec = static_cast(sec64); + nsec = static_cast(t % 1000000000LL); + + normalizeSecNSecSigned(sec, nsec); + + return *static_cast(this); + } + + template + T DurationBase::operator+(const T &rhs) const + { + T t; + return t.fromNSec(toNSec() + rhs.toNSec()); + } + + template + T DurationBase::operator*(double scale) const + { + return T(toSec() * scale); + } + + template + T DurationBase::operator-(const T &rhs) const + { + T t; + return t.fromNSec(toNSec() - rhs.toNSec()); + } + + template + T DurationBase::operator-() const + { + T t; + return t.fromNSec(-toNSec()); + } + + template + T& DurationBase::operator+=(const T &rhs) + { + *this = *this + rhs; + return *static_cast(this); + } + + template + T& DurationBase::operator-=(const T &rhs) + { + *this += (-rhs); + return *static_cast(this); + } + + template + T& DurationBase::operator*=(double scale) + { + fromSec(toSec() * scale); + return *static_cast(this); + } + + template + bool DurationBase::operator<(const T &rhs) const + { + if (sec < rhs.sec) + return true; + else if (sec == rhs.sec && nsec < rhs.nsec) + return true; + return false; + } + + template + bool DurationBase::operator>(const T &rhs) const + { + if (sec > rhs.sec) + return true; + else if (sec == rhs.sec && nsec > rhs.nsec) + return true; + return false; + } + + template + bool DurationBase::operator<=(const T &rhs) const + { + if (sec < rhs.sec) + return true; + else if (sec == rhs.sec && nsec <= rhs.nsec) + return true; + return false; + } + + template + bool DurationBase::operator>=(const T &rhs) const + { + if (sec > rhs.sec) + return true; + else if (sec == rhs.sec && nsec >= rhs.nsec) + return true; + return false; + } + + template + bool DurationBase::operator==(const T &rhs) const + { + return sec == rhs.sec && nsec == rhs.nsec; + } + + template + bool DurationBase::isZero() const + { + return sec == 0 && nsec == 0; + } + + // boost::posix_time conversion removed in std-only build +} +#endif diff --git a/include/robot/impl/time.h b/include/robot/impl/time.h new file mode 100644 index 0000000..312afb0 --- /dev/null +++ b/include/robot/impl/time.h @@ -0,0 +1,185 @@ +/********************************************************************* +* Software License Agreement (BSD License) +* +* Copyright (c) 2008, Willow Garage, Inc. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of Willow Garage, Inc. nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +*********************************************************************/ + +#ifndef ROBOT_TIME_IMPL_H_INCLUDED +#define ROBOT_TIME_IMPL_H_INCLUDED + +/********************************************************************* +** Headers +*********************************************************************/ + +#include +#include +#include +#include +#include +#include + +/********************************************************************* +** Cross Platform Headers +*********************************************************************/ + +#if defined(_WIN32) + #include +#else + #include +#endif + +namespace robot +{ + + template + T& TimeBase::fromNSec(uint64_t t) + { + uint64_t sec64 = 0; + uint64_t nsec64 = t; + + normalizeSecNSec(sec64, nsec64); + + sec = static_cast(sec64); + nsec = static_cast(nsec64); + + return *static_cast(this); + } + + template + T& TimeBase::fromSec(double t) { + if (t < 0) + throw std::runtime_error("Time cannot be negative."); + if (!std::isfinite(t)) + throw std::runtime_error("Time has to be finite."); + constexpr double maxInt64AsDouble = static_cast(std::numeric_limits::max()); + if (t >= maxInt64AsDouble) + throw std::runtime_error("Time is out of 64-bit integer range"); + int64_t sec64 = static_cast(floor(t)); + if (sec64 > std::numeric_limits::max()) + throw std::runtime_error("Time is out of dual 32-bit range"); + sec = static_cast(sec64); + nsec = static_cast(std::llround((t-sec) * 1e9)); + // avoid rounding errors + sec += (nsec / 1000000000ul); + nsec %= 1000000000ul; + return *static_cast(this); + } + + template + D TimeBase::operator-(const T &rhs) const + { + D d; + return d.fromNSec(toNSec() - rhs.toNSec()); + } + + template + T TimeBase::operator-(const D &rhs) const + { + return *static_cast(this) + ( -rhs); + } + + template + T TimeBase::operator+(const D &rhs) const + { + int64_t sec_sum = static_cast(sec) + static_cast(rhs.sec); + int64_t nsec_sum = static_cast(nsec) + static_cast(rhs.nsec); + + // Throws an exception if we go out of 32-bit range + normalizeSecNSecUnsigned(sec_sum, nsec_sum); + + // now, it's safe to downcast back to uint32 bits + return T(static_cast(sec_sum), static_cast(nsec_sum)); + } + + template + T& TimeBase::operator+=(const D &rhs) + { + *this = *this + rhs; + return *static_cast(this); + } + + template + T& TimeBase::operator-=(const D &rhs) + { + *this += (-rhs); + return *static_cast(this); + } + + template + bool TimeBase::operator==(const T &rhs) const + { + return sec == rhs.sec && nsec == rhs.nsec; + } + + template + bool TimeBase::operator<(const T &rhs) const + { + if (sec < rhs.sec) + return true; + else if (sec == rhs.sec && nsec < rhs.nsec) + return true; + return false; + } + + template + bool TimeBase::operator>(const T &rhs) const + { + if (sec > rhs.sec) + return true; + else if (sec == rhs.sec && nsec > rhs.nsec) + return true; + return false; + } + + template + bool TimeBase::operator<=(const T &rhs) const + { + if (sec < rhs.sec) + return true; + else if (sec == rhs.sec && nsec <= rhs.nsec) + return true; + return false; + } + + template + bool TimeBase::operator>=(const T &rhs) const + { + if (sec > rhs.sec) + return true; + else if (sec == rhs.sec && nsec >= rhs.nsec) + return true; + return false; + } + + // boost::posix_time conversion removed in std-only build +} + +#endif // ROBOT_IMPL_TIME_H_INCLUDED diff --git a/include/robot/macros.h b/include/robot/macros.h new file mode 100644 index 0000000..473cb22 --- /dev/null +++ b/include/robot/macros.h @@ -0,0 +1,23 @@ +/********************************************************************* + * Minimal macros to decouple from ROS build system. + *********************************************************************/ +#ifndef ROBOT_MINIMAL_MACROS_H +#define ROBOT_MINIMAL_MACROS_H + +#if defined(_WIN32) && !defined(ROSTIME_STATIC) + #define ROBOT_HELPER_EXPORT __declspec(dllexport) + #define ROBOT_HELPER_IMPORT __declspec(dllimport) +#else + #define ROBOT_HELPER_EXPORT + #define ROBOT_HELPER_IMPORT +#endif + +#if defined(_MSC_VER) + #define ROBOT_FORCE_INLINE __forceinline +#else + #define ROBOT_FORCE_INLINE inline __attribute__((always_inline)) +#endif + +#endif // ROBOT_MINIMAL_MACROS_H + + diff --git a/include/robot/platform.h b/include/robot/platform.h new file mode 100644 index 0000000..8e0b83e --- /dev/null +++ b/include/robot/platform.h @@ -0,0 +1,9 @@ +/********************************************************************* + * Minimal platform header placeholder to satisfy includes. + *********************************************************************/ +#ifndef ROBOT_MINIMAL_PLATFORM_H +#define ROBOT_MINIMAL_PLATFORM_H + +#endif // ROBOT_MINIMAL_PLATFORM_H + + diff --git a/include/robot/rate.h b/include/robot/rate.h new file mode 100644 index 0000000..23e3b10 --- /dev/null +++ b/include/robot/rate.h @@ -0,0 +1,131 @@ +/********************************************************************* +* +* Software License Agreement (BSD License) +* +* Copyright (c) 2009, Willow Garage, Inc. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of the Willow Garage nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +* +* Author: Eitan Marder-Eppstein +*********************************************************************/ +#ifndef ROBOT_LIB_RATE_H +#define ROBOT_LIB_RATE_H + +#include "robot/time.h" +#include "robot_time_decl.h" + +namespace robot +{ +class Duration; + +/** + * @class Rate + * @brief Class to help run loops at a desired frequency + */ +class ROBOT_TIME_DECL Rate +{ +public: + /** + * @brief Constructor, creates a Rate + * @param frequency The desired rate to run at in Hz + */ + Rate(double frequency); + explicit Rate(const Duration&); + + /** + * @brief Sleeps for any leftover time in a cycle. Calculated from the last time sleep, reset, or the constructor was called. + * @return True if the desired rate was met for the cycle, false otherwise. + */ + bool sleep(); + + /** + * @brief Sets the start time for the rate to now + */ + void reset(); + + /** + * @brief Get the actual run time of a cycle from start to sleep + * @return The runtime of the cycle + */ + Duration cycleTime() const; + + /** + * @brief Get the expected cycle time -- one over the frequency passed in to the constructor + */ + Duration expectedCycleTime() const { return expected_cycle_time_; } + +private: + Time start_; + Duration expected_cycle_time_, actual_cycle_time_; +}; + +/** + * @class WallRate + * @brief Class to help run loops at a desired frequency. This version always uses wall-clock time. + */ +class ROBOT_TIME_DECL WallRate +{ +public: + /** + * @brief Constructor, creates a Rate + * @param frequency The desired rate to run at in Hz + */ + WallRate(double frequency); + explicit WallRate(const Duration&); + + /** + * @brief Sleeps for any leftover time in a cycle. Calculated from the last time sleep, reset, or the constructor was called. + * @return Passes through the return value from WallDuration::sleep() if it slept, false otherwise. + */ + bool sleep(); + + /** + * @brief Sets the start time for the rate to now + */ + void reset(); + + /** + * @brief Get the actual run time of a cycle from start to sleep + * @return The runtime of the cycle + */ + WallDuration cycleTime() const; + + /** + * @brief Get the expected cycle time -- one over the frequency passed in to the constructor + */ + WallDuration expectedCycleTime() const { return expected_cycle_time_; } + +private: + WallTime start_; + WallDuration expected_cycle_time_, actual_cycle_time_; +}; + +} + +#endif diff --git a/include/robot/robot_time_decl.h b/include/robot/robot_time_decl.h new file mode 100644 index 0000000..d5ef1b8 --- /dev/null +++ b/include/robot/robot_time_decl.h @@ -0,0 +1,55 @@ +/********************************************************************* +* +* Software License Agreement (BSD License) +* +* Copyright (c) 2009, Willow Garage, Inc. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above +* copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided +* with the distribution. +* * Neither the name of the Willow Garage nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +* +*********************************************************************/ +/* + * Cross platform macros. + * + */ +#ifndef ROBOT_TIME_DECL_HPP_INCLUDED +#define ROBOT_TIME_DECL_HPP_INCLUDED + +#include + +#ifdef ROBOT_BUILD_SHARED_LIBS // robot is being built around shared libraries + #ifdef robot_time_EXPORTS // we are building a shared lib/dll + #define ROBOT_TIME_DECL ROBOT_HELPER_EXPORT + #else // we are using shared lib/dll + #define ROBOT_TIME_DECL ROBOT_HELPER_IMPORT + #endif +#else // robot is being built around static libraries + #define ROBOT_TIME_DECL +#endif + +#endif /* ROBOT_TIME_DECL_HPP_INCLUDED */ diff --git a/include/robot/time.h b/include/robot/time.h new file mode 100644 index 0000000..fb48d95 --- /dev/null +++ b/include/robot/time.h @@ -0,0 +1,301 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2010, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ + +#ifndef ROBOT_TIME_H_INCLUDED +#define ROBOT_TIME_H_INCLUDED + +/********************************************************************* + ** Pragmas + *********************************************************************/ + +#ifdef _MSC_VER + // Robot_time has some magic interface that doesn't directly include + // its implementation, this just disables those warnings. + #pragma warning(disable: 4244) + #pragma warning(disable: 4661) +#endif + +/********************************************************************* + ** Headers + *********************************************************************/ + +#include +#include +#include +#include +#include "duration.h" +#include "robot_time_decl.h" + +/********************************************************************* + ** Cross Platform Headers + *********************************************************************/ + +#if defined(_WIN32) + #include +#else + #include +#endif + +namespace robot +{ + + /********************************************************************* + ** Exceptions + *********************************************************************/ + + /** + * @brief Thrown if the robot subsystem hasn't been initialised before use. + */ + class ROBOT_TIME_DECL TimeNotInitializedException : public Exception + { + public: + TimeNotInitializedException() + : Exception("Cannot use robot::Time::now() before the first NodeHandle has been created or robot::start() has been called. " + "If this is a standalone app or test that just uses robot::Time and does not communicate over ROBOT, you may also call robot::Time::init()") + {} + }; + + /** + * @brief Thrown if windows high perf. timestamping is unavailable. + * + * @sa getWallTime + */ + class ROBOT_TIME_DECL NoHighPerformanceTimersException : public Exception + { + public: + NoHighPerformanceTimersException() + : Exception("This windows platform does not " + "support the high-performance timing api.") + {} + }; + + /********************************************************************* + ** Functions + *********************************************************************/ + + ROBOT_TIME_DECL void normalizeSecNSec(uint64_t& sec, uint64_t& nsec); + ROBOT_TIME_DECL void normalizeSecNSec(uint32_t& sec, uint32_t& nsec); + ROBOT_TIME_DECL void normalizeSecNSecUnsigned(int64_t& sec, int64_t& nsec); + ROBOT_TIME_DECL void robot_walltime(uint32_t& sec, uint32_t& nsec); + ROBOT_TIME_DECL void robot_steadytime(uint32_t& sec, uint32_t& nsec); + + /********************************************************************* + ** Time Classes + *********************************************************************/ + + /** + * \brief Base class for Time implementations. Provides storage, common functions and operator overloads. + * This should not need to be used directly. + */ + template + class TimeBase + { + public: + uint32_t sec, nsec; + + TimeBase() : sec(0), nsec(0) { } + TimeBase(uint32_t _sec, uint32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSec(sec, nsec); + } + explicit TimeBase(double t) { fromSec(t); } + D operator-(const T &rhs) const; + T operator+(const D &rhs) const; + T operator-(const D &rhs) const; + T& operator+=(const D &rhs); + T& operator-=(const D &rhs); + bool operator==(const T &rhs) const; + inline bool operator!=(const T &rhs) const { return !(*static_cast(this) == rhs); } + bool operator>(const T &rhs) const; + bool operator<(const T &rhs) const; + bool operator>=(const T &rhs) const; + bool operator<=(const T &rhs) const; + + double toSec() const { return static_cast(sec) + 1e-9*static_cast(nsec); }; + T& fromSec(double t); + + uint64_t toNSec() const {return static_cast(sec)*1000000000ull + static_cast(nsec); } + T& fromNSec(uint64_t t); + + inline bool isZero() const { return sec == 0 && nsec == 0; } + inline bool is_zero() const { return isZero(); } + // boost::posix_time conversion removed in std-only build + + static const T MIN; //!< Minimum representable time + static const T MAX; //!< Maximum representable time + static const T ZERO; //!< Zero (invalid) time + static const T UNINITIALIZED; //!< Uninitialized time + }; + + /** + * \brief Time representation. May either represent wall clock time or ROBOT clock time. + * + * robot::TimeBase provides most of its functionality. + */ + class ROBOT_TIME_DECL Time : public TimeBase + { + public: + Time() + : TimeBase() + {} + + Time(uint32_t _sec, uint32_t _nsec) + : TimeBase(_sec, _nsec) + {} + + explicit Time(double t) { fromSec(t); } + + /** + * \brief Retrieve the current time. If ROBOT clock time is in use, this returns the time according to the + * ROBOT clock. Otherwise returns the current wall clock time. + */ + static Time now(); + /** + * \brief Sleep until a specific time has been reached. + * @return True if the desired sleep time was met, false otherwise. + */ + static bool sleepUntil(const Time& end); + + static void init(); + static void shutdown(); + static void setNow(const Time& new_now); + static bool useSystemTime(); + static bool isSimTime(); + static bool isSystemTime(); + + /** + * \brief Returns whether or not the current time source is valid. Simulation time is valid if it is non-zero. + */ + static bool isValid(); + /** + * \brief Wait for time source to become valid + */ + static bool waitForValid(); + /** + * \brief Wait for time source to become valid, with timeout + */ + static bool waitForValid(const robot::WallDuration& timeout); + + // boost::posix_time conversion removed in std-only build + }; + + extern ROBOT_TIME_DECL const Time TIME_MAX; + extern ROBOT_TIME_DECL const Time TIME_MIN; + template<> const Time TimeBase::MAX; + template<> const Time TimeBase::MIN; + template<> const Time TimeBase::ZERO; + template<> const Time TimeBase::UNINITIALIZED; + + /** + * \brief Time representation. Always wall-clock time. + * + * robot::TimeBase provides most of its functionality. + */ + class ROBOT_TIME_DECL WallTime : public TimeBase + { + public: + WallTime() + : TimeBase() + {} + + WallTime(uint32_t _sec, uint32_t _nsec) + : TimeBase(_sec, _nsec) + {} + + explicit WallTime(double t) { fromSec(t); } + + /** + * \brief Returns the current wall clock time. + */ + static WallTime now(); + + /** + * \brief Sleep until a specific time has been reached. + * @return True if the desired sleep time was met, false otherwise. + */ + static bool sleepUntil(const WallTime& end); + + static bool isSystemTime() { return true; } + }; + + template<> const WallTime TimeBase::MAX; + template<> const WallTime TimeBase::MIN; + template<> const WallTime TimeBase::ZERO; + template<> const WallTime TimeBase::UNINITIALIZED; + + /** + * \brief Time representation. Always steady-clock time. + * + * Not affected by ROBOT time. + * + * robot::TimeBase provides most of its functionality. + */ + class ROBOT_TIME_DECL SteadyTime : public TimeBase + { + public: + SteadyTime() + : TimeBase() + {} + + SteadyTime(uint32_t _sec, uint32_t _nsec) + : TimeBase(_sec, _nsec) + {} + + explicit SteadyTime(double t) { fromSec(t); } + + /** + * \brief Returns the current steady (monotonic) clock time. + */ + static SteadyTime now(); + + /** + * \brief Sleep until a specific time has been reached. + * @return True if the desired sleep time was met, false otherwise. + */ + static bool sleepUntil(const SteadyTime& end); + + static bool isSystemTime() { return true; } + }; + + template<> const SteadyTime TimeBase::MAX; + template<> const SteadyTime TimeBase::MIN; + template<> const SteadyTime TimeBase::ZERO; + template<> const SteadyTime TimeBase::UNINITIALIZED; + + ROBOT_TIME_DECL std::ostream &operator <<(std::ostream &os, const Time &rhs); + ROBOT_TIME_DECL std::ostream &operator <<(std::ostream &os, const WallTime &rhs); + ROBOT_TIME_DECL std::ostream &operator <<(std::ostream &os, const SteadyTime &rhs); +} + +#endif // ROBOT_TIME_H diff --git a/src/duration.cpp b/src/duration.cpp new file mode 100644 index 0000000..8d70b73 --- /dev/null +++ b/src/duration.cpp @@ -0,0 +1,77 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2010, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ +#include +#include + +namespace robot { + + Duration::Duration(const Rate& rate) + : DurationBase(rate.expectedCycleTime().sec, rate.expectedCycleTime().nsec) + { } + + WallDuration::WallDuration(const Rate& rate) + : DurationBase(rate.expectedCycleTime().sec, rate.expectedCycleTime().nsec) + { } + + void normalizeSecNSecSigned(int64_t& sec, int64_t& nsec) + { + int64_t nsec_part = nsec % 1000000000L; + int64_t sec_part = sec + nsec / 1000000000L; + if (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + + if (sec_part < std::numeric_limits::min() || sec_part > std::numeric_limits::max()) + throw std::runtime_error("Duration is out of dual 32-bit range"); + + sec = sec_part; + nsec = nsec_part; + } + + void normalizeSecNSecSigned(int32_t& sec, int32_t& nsec) + { + int64_t sec64 = sec; + int64_t nsec64 = nsec; + + normalizeSecNSecSigned(sec64, nsec64); + + sec = (int32_t)sec64; + nsec = (int32_t)nsec64; + } + + template class DurationBase; + template class DurationBase; +} diff --git a/src/rate.cpp b/src/rate.cpp new file mode 100644 index 0000000..de48f46 --- /dev/null +++ b/src/rate.cpp @@ -0,0 +1,159 @@ +/********************************************************************* + * + * Software License Agreement (BSD License) + * + * Copyright (c) 2009, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the Willow Garage nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Author: Eitan Marder-Eppstein + *********************************************************************/ +#include + +namespace robot +{ + +Rate::Rate(double frequency) +: start_(Time::now()) +, expected_cycle_time_(1.0 / frequency) +, actual_cycle_time_(0.0) +{ } + +Rate::Rate(const Duration& d) + : start_(Time::now()) + , expected_cycle_time_(d.sec, d.nsec) + , actual_cycle_time_(0.0) +{ } + +bool Rate::sleep() +{ + Time expected_end = start_ + expected_cycle_time_; + + Time actual_end = Time::now(); + + // detect backward jumps in time + if (actual_end < start_) + { + expected_end = actual_end + expected_cycle_time_; + } + + //calculate the time we'll sleep for + Duration sleep_time = expected_end - actual_end; + + //set the actual amount of time the loop took in case the user wants to know + actual_cycle_time_ = actual_end - start_; + + //make sure to reset our start time + start_ = expected_end; + + //if we've taken too much time we won't sleep + if(sleep_time <= Duration(0.0)) + { + // if we've jumped forward in time, or the loop has taken more than a full extra + // cycle, reset our cycle + if (actual_end > expected_end + expected_cycle_time_) + { + start_ = actual_end; + } + // return false to show that the desired rate was not met + return false; + } + + return sleep_time.sleep(); +} + +void Rate::reset() +{ + start_ = Time::now(); +} + +Duration Rate::cycleTime() const +{ + return actual_cycle_time_; +} + +WallRate::WallRate(double frequency) +: start_(WallTime::now()) +, expected_cycle_time_(1.0 / frequency) +, actual_cycle_time_(0.0) +{} + +WallRate::WallRate(const Duration& d) +: start_(WallTime::now()) +, expected_cycle_time_(d.sec, d.nsec) +, actual_cycle_time_(0.0) +{} + +bool WallRate::sleep() +{ + WallTime expected_end = start_ + expected_cycle_time_; + + WallTime actual_end = WallTime::now(); + + // detect backward jumps in time + if (actual_end < start_) + { + expected_end = actual_end + expected_cycle_time_; + } + + //calculate the time we'll sleep for + WallDuration sleep_time = expected_end - actual_end; + + //set the actual amount of time the loop took in case the user wants to know + actual_cycle_time_ = actual_end - start_; + + //make sure to reset our start time + start_ = expected_end; + + //if we've taken too much time we won't sleep + if(sleep_time <= WallDuration(0.0)) + { + // if we've jumped forward in time, or the loop has taken more than a full extra + // cycle, reset our cycle + if (actual_end > expected_end + expected_cycle_time_) + { + start_ = actual_end; + } + return false; + } + + return sleep_time.sleep(); +} + +void WallRate::reset() +{ + start_ = WallTime::now(); +} + +WallDuration WallRate::cycleTime() const +{ + return actual_cycle_time_; +} + +} diff --git a/src/time.cpp b/src/time.cpp new file mode 100644 index 0000000..91392c9 --- /dev/null +++ b/src/time.cpp @@ -0,0 +1,521 @@ +/********************************************************************* + * Software License Agreement (BSD License) + * + * Copyright (c) 2010, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *********************************************************************/ +#ifdef _MSC_VER + #ifndef NOMINMAX + #define NOMINMAX + #endif +#endif + +#include "robot/time.h" +#include "robot/impl/time.h" +#include +#include +#include +#include +#include + +// time related includes for macOS +#if defined(__APPLE__) +#include +#include +#endif // defined(__APPLE__) + +#ifdef _WINDOWS +#include +#include +#include +#endif + +#include +#include + +/********************************************************************* + ** Preprocessor + *********************************************************************/ + +// Could probably do some better and more elaborate checking +// and definition here. +#define HAS_CLOCK_GETTIME (_POSIX_C_SOURCE >= 199309L) + +/********************************************************************* + ** Namespaces + *********************************************************************/ + +namespace robot +{ + + /********************************************************************* + ** Variables + *********************************************************************/ + + const Duration DURATION_MAX(std::numeric_limits::max(), 999999999); + const Duration DURATION_MIN(std::numeric_limits::min(), 0); + + template<> const Duration DurationBase::MAX = DURATION_MAX; + template<> const Duration DurationBase::MIN = DURATION_MIN; + template<> const Duration DurationBase::ZERO = Duration(0, 0); + template<> const Duration DurationBase::NANOSECOND = Duration(0, 1); + template<> const Duration DurationBase::MICROSECOND = Duration(0, 1000); + template<> const Duration DurationBase::MILLISECOND = Duration(0, 1000000); + template<> const Duration DurationBase::SECOND = Duration(1, 0); + template<> const Duration DurationBase::MINUTE = Duration(60, 0); + template<> const Duration DurationBase::HOUR = Duration(60 * 60, 0); + template<> const Duration DurationBase::DAY = Duration(60 * 60 * 24, 0); + + template<> const WallDuration DurationBase::MAX = WallDuration(Duration::MAX.sec, Duration::MAX.nsec); + template<> const WallDuration DurationBase::MIN = WallDuration(Duration::MIN.sec, Duration::MIN.nsec); + template<> const WallDuration DurationBase::ZERO = WallDuration(Duration::ZERO.sec, Duration::ZERO.nsec); + template<> const WallDuration DurationBase::DAY = WallDuration(Duration::DAY.sec, Duration::DAY.nsec); + template<> const WallDuration DurationBase::HOUR = WallDuration(Duration::HOUR.sec, Duration::HOUR.nsec); + template<> const WallDuration DurationBase::MINUTE = WallDuration(Duration::MINUTE.sec, Duration::MINUTE.nsec); + template<> const WallDuration DurationBase::SECOND = WallDuration(Duration::SECOND.sec, Duration::SECOND.nsec); + template<> const WallDuration DurationBase::MILLISECOND = WallDuration(Duration::MILLISECOND.sec, Duration::MILLISECOND.nsec); + template<> const WallDuration DurationBase::MICROSECOND = WallDuration(Duration::MICROSECOND.sec, Duration::MICROSECOND.nsec); + template<> const WallDuration DurationBase::NANOSECOND = WallDuration(Duration::NANOSECOND.sec, Duration::NANOSECOND.nsec); + + const Time TIME_MAX(std::numeric_limits::max(), 999999999); + const Time TIME_MIN(0, 1); + + template<> const Time TimeBase::MAX = TIME_MAX; + template<> const Time TimeBase::MIN = TIME_MIN; + template<> const Time TimeBase::ZERO = Time(0, 0); + template<> const Time TimeBase::UNINITIALIZED = Time::ZERO; + + template<> const WallTime TimeBase::MAX = WallTime(Time::MAX.sec, Time::MAX.nsec); + template<> const WallTime TimeBase::MIN = WallTime(Time::MIN.sec, Time::MIN.nsec); + template<> const WallTime TimeBase::ZERO = WallTime(Time::ZERO.sec, Time::ZERO.nsec); + template<> const WallTime TimeBase::UNINITIALIZED = WallTime(Time::UNINITIALIZED.sec, Time::UNINITIALIZED.nsec); + + template<> const SteadyTime TimeBase::MAX = SteadyTime(Time::MAX.sec, Time::MAX.nsec); + template<> const SteadyTime TimeBase::MIN = SteadyTime(Time::MIN.sec, Time::MIN.nsec); + template<> const SteadyTime TimeBase::ZERO = SteadyTime(Time::ZERO.sec, Time::ZERO.nsec); + template<> const SteadyTime TimeBase::UNINITIALIZED = SteadyTime(Time::UNINITIALIZED.sec, Time::UNINITIALIZED.nsec); + + // This is declared here because it's set from the Time class but read from + // the Duration class, and need not be exported to users of either. + static bool g_stopped(false); + + // I assume that this is declared here, instead of time.h, to keep users + // of time.h from including boost/thread/mutex.hpp + static std::mutex g_sim_time_mutex; + + static bool g_initialized(false); + static bool g_use_sim_time(true); + static Time g_sim_time(0, 0); + + /********************************************************************* + ** Cross Platform Functions + *********************************************************************/ + void robot_walltime(uint32_t& sec, uint32_t& nsec) + { + using namespace std::chrono; + uint64_t now_ns = duration_cast(system_clock::now().time_since_epoch()).count(); + uint64_t s = 0; + normalizeSecNSec(s, now_ns); + sec = static_cast(s); + nsec = static_cast(now_ns); + } + + void robot_steadytime(uint32_t& sec, uint32_t& nsec) + { + using namespace std::chrono; + uint64_t now_ns = duration_cast(steady_clock::now().time_since_epoch()).count(); + uint64_t s = 0; + normalizeSecNSec(s, now_ns); + sec = static_cast(s); + nsec = static_cast(now_ns); + } + + /* + * These have only internal linkage to this translation unit. + * (i.e. not exposed to users of the time classes) + */ + + /** + * @brief Simple representation of the rt library nanosleep function. + */ + int robot_nanosleep(const uint32_t &sec, const uint32_t &nsec) + { +#if defined(_WIN32) + std::this_thread::sleep_for(std::chrono::nanoseconds(static_cast(sec * 1e9 + nsec))); + return 0; +#else + timespec req = { sec, nsec }; + return nanosleep(&req, NULL); +#endif + } + + /** + * @brief Go to the wall! + * + * @todo Fully implement the win32 parts, currently just like a regular sleep. + */ + bool robot_wallsleep(uint32_t sec, uint32_t nsec) + { +#if defined(_WIN32) + robot_nanosleep(sec,nsec); +#else + timespec req = { sec, nsec }; + timespec rem = {0, 0}; + while (nanosleep(&req, &rem) && !g_stopped) + { + req = rem; + } +#endif + return !g_stopped; + } + + /********************************************************************* + ** Class Methods + *********************************************************************/ + + bool Time::useSystemTime() + { + return !g_use_sim_time; + } + + bool Time::isSimTime() + { + return g_use_sim_time; + } + + bool Time::isSystemTime() + { + return !isSimTime(); + } + + Time Time::now() + { + if (!g_initialized) + { + throw TimeNotInitializedException(); + } + + if (g_use_sim_time) + { + std::lock_guard lock(g_sim_time_mutex); + Time t = g_sim_time; + return t; + } + + Time t; + robot_walltime(t.sec, t.nsec); + + return t; + } + + void Time::setNow(const Time& new_now) + { + std::lock_guard lock(g_sim_time_mutex); + + g_sim_time = new_now; + g_use_sim_time = true; + } + + void Time::init() + { + g_stopped = false; + g_use_sim_time = false; + g_initialized = true; + } + + void Time::shutdown() + { + g_stopped = true; + } + + bool Time::isValid() + { + return (!g_use_sim_time) || !g_sim_time.isZero(); + } + + bool Time::waitForValid() + { + return waitForValid(robot::WallDuration()); + } + + bool Time::waitForValid(const robot::WallDuration& timeout) + { + robot::WallTime start = robot::WallTime::now(); + while (!isValid() && !g_stopped) + { + robot::WallDuration(0.01).sleep(); + + if (timeout > robot::WallDuration(0, 0) && (robot::WallTime::now() - start > timeout)) + { + return false; + } + } + + if (g_stopped) + { + return false; + } + + return true; + } + + // boost::posix_time conversion removed in std-only build + + std::ostream& operator<<(std::ostream& os, const Time &rhs) + { + auto flags = os.flags(); + auto fillc = os.fill(); + auto width = os.width(); + os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec; + os.flags(flags); + os.fill(fillc); + os.width(width); + return os; + } + + std::ostream& operator<<(std::ostream& os, const Duration& rhs) + { + auto flags = os.flags(); + auto fillc = os.fill(); + auto width = os.width(); + if (rhs.sec >= 0 || rhs.nsec == 0) + { + os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec; + } + else + { + os << (rhs.sec == -1 ? "-" : "") << (rhs.sec + 1) << "." << std::setw(9) << std::setfill('0') << (1000000000 - rhs.nsec); + } + os.flags(flags); + os.fill(fillc); + os.width(width); + return os; + } + + bool Time::sleepUntil(const Time& end) + { + if (Time::useSystemTime()) + { + Duration d(end - Time::now()); + if (d > Duration(0)) + { + return d.sleep(); + } + + return true; + } + else + { + Time start = Time::now(); + while (!g_stopped && (Time::now() < end)) + { + robot_nanosleep(0,1000000); + if (Time::now() < start) + { + return false; + } + } + + return true; + } + } + + bool WallTime::sleepUntil(const WallTime& end) + { + WallDuration d(end - WallTime::now()); + if (d > WallDuration(0)) + { + return d.sleep(); + } + + return true; + } + + bool SteadyTime::sleepUntil(const SteadyTime& end) + { + WallDuration d(end - SteadyTime::now()); + if (d > WallDuration(0)) + { + return d.sleep(); + } + + return true; + } + + bool Duration::sleep() const + { + if (Time::useSystemTime()) + { + return robot_wallsleep(sec, nsec); + } + else + { + Time start = Time::now(); + Time end = start + *this; + if (start.isZero()) + { + end = TIME_MAX; + } + + bool rc = false; + // This allows sim time to run up to 10x real-time even for very short sleep durations. + const uint32_t sleep_nsec = (sec != 0) ? 1000000 : (std::min)(1000000, nsec/10); + while (!g_stopped && (Time::now() < end)) + { + robot_wallsleep(0, sleep_nsec); + rc = true; + + // If we started at time 0 wait for the first actual time to arrive before starting the timer on + // our sleep + if (start.isZero()) + { + start = Time::now(); + end = start + *this; + } + + // If time jumped backwards from when we started sleeping, return immediately + if (Time::now() < start) + { + return false; + } + } + + return rc && !g_stopped; + } + } + + std::ostream &operator<<(std::ostream& os, const WallTime &rhs) + { + auto flags = os.flags(); + auto fillc = os.fill(); + auto width = os.width(); + os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec; + os.flags(flags); + os.fill(fillc); + os.width(width); + return os; + } + + std::ostream &operator<<(std::ostream& os, const SteadyTime &rhs) + { + auto flags = os.flags(); + auto fillc = os.fill(); + auto width = os.width(); + os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec; + os.flags(flags); + os.fill(fillc); + os.width(width); + return os; + } + + WallTime WallTime::now() + { + WallTime t; + robot_walltime(t.sec, t.nsec); + + return t; + } + + SteadyTime SteadyTime::now() + { + SteadyTime t; + robot_steadytime(t.sec, t.nsec); + + return t; + } + + std::ostream &operator<<(std::ostream& os, const WallDuration& rhs) + { + auto flags = os.flags(); + auto fillc = os.fill(); + auto width = os.width(); + if (rhs.sec >= 0 || rhs.nsec == 0) + { + os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec; + } + else + { + os << (rhs.sec == -1 ? "-" : "") << (rhs.sec + 1) << "." << std::setw(9) << std::setfill('0') << (1000000000 - rhs.nsec); + } + os.flags(flags); + os.fill(fillc); + os.width(width); + return os; + } + + bool WallDuration::sleep() const + { + return robot_wallsleep(sec, nsec); + } + + void normalizeSecNSec(uint64_t& sec, uint64_t& nsec) + { + uint64_t nsec_part = nsec % 1000000000UL; + uint64_t sec_part = nsec / 1000000000UL; + + if (sec + sec_part > std::numeric_limits::max()) + throw std::runtime_error("Time is out of dual 32-bit range"); + + sec += sec_part; + nsec = nsec_part; + } + + void normalizeSecNSec(uint32_t& sec, uint32_t& nsec) + { + uint64_t sec64 = sec; + uint64_t nsec64 = nsec; + + normalizeSecNSec(sec64, nsec64); + + sec = (uint32_t)sec64; + nsec = (uint32_t)nsec64; + } + + void normalizeSecNSecUnsigned(int64_t& sec, int64_t& nsec) + { + int64_t nsec_part = nsec % 1000000000L; + int64_t sec_part = sec + nsec / 1000000000L; + if (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + + if (sec_part < 0 || sec_part > std::numeric_limits::max()) + throw std::runtime_error("Time is out of dual 32-bit range"); + + sec = sec_part; + nsec = nsec_part; + } + + template class TimeBase; + template class TimeBase; + template class TimeBase; +} diff --git a/test/duration.cpp b/test/duration.cpp new file mode 100644 index 0000000..9f1c5fb --- /dev/null +++ b/test/duration.cpp @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2016, Open Source Robotics Foundation, Inc.. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#include +#include + +using namespace robot; + +TEST(Duration, sleepWithSimTime) +{ + robot::Time::init(); + + Time start = Time::now(); + start -= Duration(2.0); + Time::setNow(start); + + Time::shutdown(); + + Duration d(1.0); + bool rc = d.sleep(); + ASSERT_FALSE(rc); +} + +TEST(Duration, castFromDoubleExceptions) +{ + robot::Time::init(); + + Duration d1, d2, d3, d4, d5, d6, d7, d8, d9; + // Valid values to cast, must not throw exceptions + EXPECT_NO_THROW(d1.fromSec(-2147483648.0)); + EXPECT_NO_THROW(d2.fromSec(-2147483647.999999)); + EXPECT_NO_THROW(d3.fromSec(2147483647.0)); + EXPECT_NO_THROW(d4.fromSec(2147483647.999999)); + + // The next casts all incorrect. + EXPECT_THROW(d1.fromSec(2147483648.0), std::runtime_error); + EXPECT_THROW(d2.fromSec(6442450943.0), std::runtime_error); // It's 2^31 - 1 + 2^32, and it could pass the test. + EXPECT_THROW(d3.fromSec(-2147483648.001), std::runtime_error); + EXPECT_THROW(d4.fromSec(-6442450943.0), std::runtime_error); + EXPECT_THROW(d5.fromSec(std::numeric_limits::infinity()), std::runtime_error); + EXPECT_THROW(d6.fromSec(-std::numeric_limits::infinity()), std::runtime_error); + EXPECT_THROW(d7.fromSec(std::numeric_limits::quiet_NaN()), std::runtime_error); + // max int64 value is 9223372036854775807 + EXPECT_THROW(d8.fromSec(9223372036854775808.0), std::runtime_error); + EXPECT_THROW(d9.fromSec(-9223372036854775809.0), std::runtime_error); +} + +TEST(Duration, castFromInt64Exceptions) +{ + robot::Time::init(); + + Duration d1, d2, d3, d4; + // Valid values to cast, must not throw exceptions + EXPECT_NO_THROW(d1.fromNSec(-2147483648000000000)); + EXPECT_NO_THROW(d2.fromNSec(-2147483647999999999)); + EXPECT_NO_THROW(d3.fromNSec(2147483647000000000)); + EXPECT_NO_THROW(d4.fromNSec(2147483647999999999)); + + // The next casts all incorrect. + EXPECT_THROW(d1.fromSec(2147483648000000000), std::runtime_error); + EXPECT_THROW(d2.fromSec(4294967296000000000), std::runtime_error); + EXPECT_THROW(d3.fromSec(-2147483648000000001), std::runtime_error); + EXPECT_THROW(d4.fromSec(-6442450943000000000), std::runtime_error); +} + +TEST(Duration, arithmeticExceptions) +{ + robot::Time::init(); + + Duration d1(2147483647, 0); + Duration d2(2147483647, 999999999); + EXPECT_THROW(d1 + d2, std::runtime_error); + + Duration d3(-2147483648, 0); + Duration d4(2147483647, 0); + EXPECT_THROW(d3 - d4, std::runtime_error); + EXPECT_THROW(d4 - d3, std::runtime_error); + + Duration d5(-2147483647, 1); + Duration d6(-2, 999999999); + Duration d7; + EXPECT_NO_THROW(d7 = d5 + d6); + EXPECT_EQ(-2147483648000000000, d7.toNSec()); +} + +TEST(Duration, negativeSignExceptions) +{ + robot::Time::init(); + + Duration d1(2147483647, 0); + Duration d2(2147483647, 999999999); + Duration d3; + EXPECT_NO_THROW(d3 = -d1); + EXPECT_EQ(-2147483647000000000, d3.toNSec()); + EXPECT_NO_THROW(d3 = -d2); + EXPECT_EQ(-2147483647999999999, d3.toNSec()); + + Duration d4(-2147483647, 0); + Duration d5(-2147483648, 999999999); + Duration d6(-2147483648, 2); + Duration d7; + EXPECT_NO_THROW(d7 = -d4); + EXPECT_EQ(2147483647000000000, d7.toNSec()); + EXPECT_NO_THROW(d7 = -d5); + EXPECT_EQ(2147483647000000001, d7.toNSec()); + EXPECT_NO_THROW(d7 = -d6); + EXPECT_EQ(2147483647999999998, d7.toNSec()); +} + +TEST(Duration, rounding) +{ + robot::Time::init(); + + Duration d1(49.0000000004); + EXPECT_EQ(49, d1.sec); + EXPECT_EQ(0, d1.nsec); + Duration d2(-49.0000000004); + EXPECT_EQ(-49, d2.sec); + EXPECT_EQ(0, d2.nsec); + + Duration d3(49.0000000006); + EXPECT_EQ(49, d3.sec); + EXPECT_EQ(1, d3.nsec); + Duration d4(-49.0000000006); + EXPECT_EQ(-50, d4.sec); + EXPECT_EQ(999999999, d4.nsec); + + Duration d5(49.9999999994); + EXPECT_EQ(49, d5.sec); + EXPECT_EQ(999999999, d5.nsec); + Duration d6(-49.9999999994); + EXPECT_EQ(-50, d6.sec); + EXPECT_EQ(1, d6.nsec); + + Duration d7(49.9999999996); + EXPECT_EQ(50, d7.sec); + EXPECT_EQ(0, d7.nsec); + Duration d8(-49.9999999996); + EXPECT_EQ(-50, d8.sec); + EXPECT_EQ(0, d8.nsec); +} + +int main(int argc, char **argv){ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/time.cpp b/test/time.cpp new file mode 100644 index 0000000..185cfcb --- /dev/null +++ b/test/time.cpp @@ -0,0 +1,705 @@ +/* + * Copyright (c) 2008, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#include +#include +#include + +#if !defined(_WIN32) +#include +#endif + +// Boost tests removed in std-only build + +using namespace robot; + +/// \todo All the tests in here that use randomized values are not unit tests, replace them + +double epsilon = 1e-9; + +void seed_rand() +{ + //Seed random number generator with current microseond count +#if !defined(_WIN32) + timeval temp_time_struct; + gettimeofday(&temp_time_struct,NULL); + srand(temp_time_struct.tv_usec); +#else + srand(time(nullptr)); +#endif +}; + +void generate_rand_times(uint32_t range, uint64_t runs, std::vector& values1, std::vector& values2) +{ + seed_rand(); + values1.clear(); + values2.clear(); + values1.reserve(runs); + values2.reserve(runs); + for ( uint32_t i = 0; i < runs ; i++ ) + { + values1.push_back(robot::Time( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX))); + values2.push_back(robot::Time( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX))); + } +} + +void generate_rand_durations(uint32_t range, uint64_t runs, std::vector& values1, std::vector& values2) +{ + seed_rand(); + values1.clear(); + values2.clear(); + values1.reserve(runs * 4); + values2.reserve(runs * 4); + for ( uint32_t i = 0; i < runs ; i++ ) + { + // positive durations + values1.push_back(robot::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX))); + values2.push_back(robot::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX))); + EXPECT_GE(values1.back(), robot::Duration(0,0)); + EXPECT_GE(values2.back(), robot::Duration(0,0)); + + // negative durations + values1.push_back(robot::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX))); + values2.push_back(robot::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX))); + EXPECT_LE(values1.back(), robot::Duration(0,0)); + EXPECT_LE(values2.back(), robot::Duration(0,0)); + + // positive and negative durations + values1.push_back(robot::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX))); + values2.push_back(robot::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX))); + EXPECT_GE(values1.back(), robot::Duration(0,0)); + EXPECT_LE(values2.back(), robot::Duration(0,0)); + + // negative and positive durations + values1.push_back(robot::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX))); + values2.push_back(robot::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX))); + EXPECT_LE(values1.back(), robot::Duration(0,0)); + EXPECT_GE(values2.back(), robot::Duration(0,0)); + } +} + +TEST(Time, size) +{ + ASSERT_EQ(sizeof(Time), 8); + ASSERT_EQ(sizeof(Duration), 8); +} + +TEST(Time, Comparitors) +{ + std::vector v1; + std::vector v2; + generate_rand_times(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + if (v1[i].sec * 1000000000ULL + v1[i].nsec < v2[i].sec * 1000000000ULL + v2[i].nsec) + { + EXPECT_LT(v1[i], v2[i]); + // printf("%f %d ", v1[i].toSec(), v1[i].sec * 1000000000ULL + v1[i].nsec); + //printf("vs %f %d\n", v2[i].toSec(), v2[i].sec * 1000000000ULL + v2[i].nsec); + EXPECT_LE(v1[i], v2[i]); + EXPECT_NE(v1[i], v2[i]); + } + else if (v1[i].sec * 1000000000ULL + v1[i].nsec > v2[i].sec * 1000000000ULL + v2[i].nsec) + { + EXPECT_GT(v1[i], v2[i]); + EXPECT_GE(v1[i], v2[i]); + EXPECT_NE(v1[i], v2[i]); + } + else + { + EXPECT_EQ(v1[i], v2[i]); + EXPECT_LE(v1[i], v2[i]); + EXPECT_GE(v1[i], v2[i]); + } + + } + +} + +TEST(Time, ToFromDouble) +{ + std::vector v1; + std::vector v2; + generate_rand_times(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + EXPECT_EQ(v1[i].toSec(), v1[i].fromSec(v1[i].toSec()).toSec()); + + } + +} + +TEST(Time, RoundingError) +{ + double someInt = 1031.0; // some integer + double t = std::nextafter(someInt, 0); // someint - epsilon + // t should be 1031.000000 + + robot::Time exampleTime; + exampleTime.fromSec(t); + + // if rounded incorrectly, sec may be 1030 + // and nsec may be 1e9. + EXPECT_EQ(exampleTime.sec, 1031); + EXPECT_EQ(exampleTime.nsec, 0); +} + +TEST(Time, OperatorPlus) +{ + Time t(100, 0); + Duration d(100, 0); + Time r = t + d; + EXPECT_EQ(r.sec, 200UL); + EXPECT_EQ(r.nsec, 0UL); + + t = Time(0, 100000UL); + d = Duration(0, 100UL); + r = t + d; + EXPECT_EQ(r.sec, 0UL); + EXPECT_EQ(r.nsec, 100100UL); + + t = Time(0, 0); + d = Duration(10, 2000003000UL); + r = t + d; + EXPECT_EQ(r.sec, 12UL); + EXPECT_EQ(r.nsec, 3000UL); +} + +TEST(Time, OperatorMinus) +{ + Time t(100, 0); + Duration d(100, 0); + Time r = t - d; + EXPECT_EQ(r.sec, 0UL); + EXPECT_EQ(r.nsec, 0UL); + + t = Time(0, 100000UL); + d = Duration(0, 100UL); + r = t - d; + EXPECT_EQ(r.sec, 0UL); + EXPECT_EQ(r.nsec, 99900UL); + + t = Time(30, 0); + d = Duration(10, 2000003000UL); + r = t - d; + EXPECT_EQ(r.sec, 17UL); + EXPECT_EQ(r.nsec, 999997000ULL); +} + +TEST(Time, OperatorPlusEquals) +{ + Time t(100, 0); + Duration d(100, 0); + t += d; + EXPECT_EQ(t.sec, 200UL); + EXPECT_EQ(t.nsec, 0UL); + + t = Time(0, 100000UL); + d = Duration(0, 100UL); + t += d; + EXPECT_EQ(t.sec, 0UL); + EXPECT_EQ(t.nsec, 100100UL); + + t = Time(0, 0); + d = Duration(10, 2000003000UL); + t += d; + EXPECT_EQ(t.sec, 12UL); + EXPECT_EQ(t.nsec, 3000UL); +} + +TEST(Time, OperatorMinusEquals) +{ + Time t(100, 0); + Duration d(100, 0); + t -= d; + EXPECT_EQ(t.sec, 0UL); + EXPECT_EQ(t.nsec, 0UL); + + t = Time(0, 100000UL); + d = Duration(0, 100UL); + t -= d; + EXPECT_EQ(t.sec, 0UL); + EXPECT_EQ(t.nsec, 99900UL); + + t = Time(30, 0); + d = Duration(10, 2000003000UL); + t -= d; + EXPECT_EQ(t.sec, 17UL); + EXPECT_EQ(t.nsec, 999997000ULL); +} + +TEST(Time, SecNSecConstructor) +{ + Time t(100, 2000003000UL); + EXPECT_EQ(t.sec, 102UL); + EXPECT_EQ(t.nsec, 3000UL); +} + +TEST(Time, DontMungeStreamState) +{ + std::ostringstream oss; + Time t(100, 2000003000UL); + oss << std::setfill('N'); + oss << std::setw(13); + oss << t; + + EXPECT_EQ(oss.width(), 13); + EXPECT_EQ(oss.fill(), 'N'); +} + +// TEST(Time, ToFromBoost) removed + +TEST(Time, CastFromDoubleExceptions) +{ + robot::Time::init(); + + Time t1, t2, t3, t4, t5, t6, t7, t8; + // Valid values to cast, must not throw exceptions + EXPECT_NO_THROW(t1.fromSec(4294967295.0)); + EXPECT_NO_THROW(t2.fromSec(4294967295.999)); + EXPECT_NO_THROW(t3.fromSec(0.0000001)); + + // The next casts all incorrect. + EXPECT_THROW(t1.fromSec(4294967296.0), std::runtime_error); + EXPECT_THROW(t2.fromSec(-0.0001), std::runtime_error); + EXPECT_THROW(t3.fromSec(-4294967296.0), std::runtime_error); + EXPECT_THROW(t4.fromSec(std::numeric_limits::infinity()), std::runtime_error); + EXPECT_THROW(t5.fromSec(-std::numeric_limits::infinity()), std::runtime_error); + EXPECT_THROW(t6.fromSec(std::numeric_limits::quiet_NaN()), std::runtime_error); + // max int64 value is 9223372036854775807 + EXPECT_THROW(t7.fromSec(9223372036854775808.0), std::runtime_error); + EXPECT_THROW(t8.fromSec(-9223372036854775809.0), std::runtime_error); +} + +TEST(Time, OperatorMinusExceptions) +{ + robot::Time::init(); + + Time t1(2147483648, 0); + Time t2(2147483647, 999999999); + Time t3(2147483647, 999999998); + Time t4(4294967295, 999999999); + Time t5(4294967295, 999999998); + Time t6(0, 1); + + Duration d1(2147483647, 999999999); + Duration d2(-2147483648, 0); + Duration d3(-2147483648, 1); + Duration d4(0, 1); + + EXPECT_NO_THROW(t1 - t2); + EXPECT_NO_THROW(t3 - t2); + EXPECT_NO_THROW(t4 - t5); + + EXPECT_NO_THROW(t1 - d1); + EXPECT_NO_THROW(t5 - d1); + + EXPECT_THROW(t4 - t6, std::runtime_error); + EXPECT_THROW(t4 - t3, std::runtime_error); + + EXPECT_THROW(t1 - d2, std::runtime_error); + EXPECT_THROW(t2 - d2, std::runtime_error); + EXPECT_THROW(t4 - d3, std::runtime_error); +} + +TEST(Time, OperatorPlusExceptions) +{ + robot::Time::init(); + + Time t1(2147483648, 0); + Time t2(2147483647, 999999999); + Time t4(4294967295, 999999999); + Time t5(4294967295, 999999998); + + Duration d1(2147483647, 999999999); + Duration d2(-2147483648, 1); + Duration d3(0, 2); + Duration d4(0, 1); + + EXPECT_NO_THROW(t2 + d2); + EXPECT_NO_THROW(t1 + d1); + + EXPECT_THROW(t4 + d4, std::runtime_error); + EXPECT_THROW(t4 + d1, std::runtime_error); + EXPECT_THROW(t5 + d3, std::runtime_error); +} + +TEST(Time, Constants) +{ + EXPECT_EQ(Time::MAX.sec, static_cast(-1)); + EXPECT_EQ(Time::MAX.nsec, 999999999); + EXPECT_EQ(Time::MIN.sec, 0); + EXPECT_EQ(Time::MIN.nsec, 1); + EXPECT_EQ(Time::ZERO.sec, 0); + EXPECT_EQ(Time::ZERO.nsec, 0); + EXPECT_EQ(Time::UNINITIALIZED.sec, 0); + EXPECT_EQ(Time::UNINITIALIZED.nsec, 0); + + EXPECT_EQ(WallTime::MAX.sec, static_cast(-1)); + EXPECT_EQ(WallTime::MAX.nsec, 999999999); + EXPECT_EQ(WallTime::MIN.sec, 0); + EXPECT_EQ(WallTime::MIN.nsec, 1); + EXPECT_EQ(WallTime::ZERO.sec, 0); + EXPECT_EQ(WallTime::ZERO.nsec, 0); + EXPECT_EQ(WallTime::UNINITIALIZED.sec, 0); + EXPECT_EQ(WallTime::UNINITIALIZED.nsec, 0); + + EXPECT_EQ(SteadyTime::MAX.sec, static_cast(-1)); + EXPECT_EQ(SteadyTime::MAX.nsec, 999999999); + EXPECT_EQ(SteadyTime::MIN.sec, 0); + EXPECT_EQ(SteadyTime::MIN.nsec, 1); + EXPECT_EQ(SteadyTime::ZERO.sec, 0); + EXPECT_EQ(SteadyTime::ZERO.nsec, 0); + EXPECT_EQ(SteadyTime::UNINITIALIZED.sec, 0); + EXPECT_EQ(SteadyTime::UNINITIALIZED.nsec, 0); +} + +/************************************* Duration Tests *****************/ + +TEST(Duration, Comparitors) +{ + std::vector v1; + std::vector v2; + generate_rand_durations(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + if (v1[i].sec * 1000000000LL + v1[i].nsec < v2[i].sec * 1000000000LL + v2[i].nsec) + { + EXPECT_LT(v1[i], v2[i]); +// printf("%f %lld ", v1[i].toSec(), v1[i].sec * 1000000000LL + v1[i].nsec); +// printf("vs %f %lld\n", v2[i].toSec(), v2[i].sec * 1000000000LL + v2[i].nsec); + EXPECT_LE(v1[i], v2[i]); + EXPECT_NE(v1[i], v2[i]); + } + else if (v1[i].sec * 1000000000LL + v1[i].nsec > v2[i].sec * 1000000000LL + v2[i].nsec) + { + EXPECT_GT(v1[i], v2[i]); +// printf("%f %lld ", v1[i].toSec(), v1[i].sec * 1000000000LL + v1[i].nsec); +// printf("vs %f %lld\n", v2[i].toSec(), v2[i].sec * 1000000000LL + v2[i].nsec); + EXPECT_GE(v1[i], v2[i]); + EXPECT_NE(v1[i], v2[i]); + } + else + { + EXPECT_EQ(v1[i], v2[i]); + EXPECT_LE(v1[i], v2[i]); + EXPECT_GE(v1[i], v2[i]); + } + + } +} + +TEST(Duration, ToFromSec) +{ + std::vector v1; + std::vector v2; + generate_rand_durations(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + EXPECT_EQ(v1[i].toSec(), v1[i].fromSec(v1[i].toSec()).toSec()); + EXPECT_GE(robot::Duration(v1[i].toSec()).nsec, 0); + } + + EXPECT_EQ(robot::Duration(-0.5), robot::Duration(-1LL, 500000000LL)); + EXPECT_EQ(robot::Duration(-0.5), robot::Duration(0, -500000000LL)); +} + +TEST(Duration, FromNSec) +{ + robot::Duration t; + t.fromNSec(-500000000LL); + EXPECT_EQ(robot::Duration(-0.5), t); + + t.fromNSec(-1500000000LL); + EXPECT_EQ(robot::Duration(-1.5), t); + + t.fromNSec(500000000LL); + EXPECT_EQ(robot::Duration(0.5), t); + + t.fromNSec(1500000000LL); + EXPECT_EQ(robot::Duration(1.5), t); +} + +TEST(Duration, OperatorPlus) +{ + std::vector v1; + std::vector v2; + generate_rand_durations(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + EXPECT_NEAR(v1[i].toSec() + v2[i].toSec(), (v1[i] + v2[i]).toSec(), epsilon); + robot::Duration temp = v1[i]; + EXPECT_NEAR(v1[i].toSec() + v2[i].toSec(), (temp += v2[i]).toSec(), epsilon); + + } + +} + +TEST(Duration, OperatorMinus) +{ + std::vector v1; + std::vector v2; + generate_rand_durations(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + EXPECT_NEAR(v1[i].toSec() - v2[i].toSec(), (v1[i] - v2[i]).toSec(), epsilon); + robot::Duration temp = v1[i]; + EXPECT_NEAR(v1[i].toSec() - v2[i].toSec(), (temp -= v2[i]).toSec(), epsilon); + + EXPECT_NEAR(- v2[i].toSec(), (-v2[i]).toSec(), epsilon); + + } + + robot::Time t1(1.1); + robot::Time t2(1.3); + robot::Duration time_diff = t1 - t2; //=-0.2 + + EXPECT_NEAR(time_diff.toSec(), -0.2, epsilon); + EXPECT_LE(time_diff, robot::Duration(-0.19)); + EXPECT_GE(time_diff, robot::Duration(-0.21)); +} + +TEST(Duration, OperatorTimes) +{ + std::vector v1; + std::vector v2; + generate_rand_durations(100, 1000, v1,v2); + + for (uint32_t i = 0; i < v1.size(); i++) + { + EXPECT_NEAR(v1[i].toSec() * v2[i].toSec(), (v1[i] * v2[i].toSec()).toSec(), epsilon); + robot::Duration temp = v1[i]; + EXPECT_NEAR(v1[i].toSec() * v2[i].toSec(), (temp *= v2[i].toSec()).toSec(), epsilon); + + } + +} + +TEST(Duration, OperatorPlusEquals) +{ + Duration t(100, 0); + Duration d(100, 0); + t += d; + EXPECT_EQ(t.sec, 200L); + EXPECT_EQ(t.nsec, 0L); + + t = Duration(0, 100000L); + d = Duration(0, 100L); + t += d; + EXPECT_EQ(t.sec, 0L); + EXPECT_EQ(t.nsec, 100100L); + + t = Duration(0, 0); + d = Duration(10, 2000003000L); + t += d; + EXPECT_EQ(t.sec, 12L); + EXPECT_EQ(t.nsec, 3000L); +} + +TEST(Duration, OperatorMinusEquals) +{ + Duration t(100, 0); + Duration d(100, 0); + t -= d; + EXPECT_EQ(t.sec, 0L); + EXPECT_EQ(t.nsec, 0L); + + t = Duration(0, 100000L); + d = Duration(0, 100L); + t -= d; + EXPECT_EQ(t.sec, 0L); + EXPECT_EQ(t.nsec, 99900L); + + t = Duration(30, 0); + d = Duration(10, 2000003000L); + t -= d; + EXPECT_EQ(t.sec, 17L); + EXPECT_EQ(t.nsec, 999997000L); +} + +void alarmHandler(int sig) +{ + +} + +TEST(Duration, sleepWithSignal) +{ +#if !defined(_WIN32) + signal(SIGALRM, alarmHandler); + alarm(1); +#endif + + Time start = Time::now(); + Duration d(5.0); + bool rc = d.sleep(); + // std::cout << "rc: " << rc << std::endl; + Time end = Time::now(); + + ASSERT_GT(end - start, d); + ASSERT_TRUE(rc); +} + +TEST(Duration, Constants) +{ + EXPECT_EQ(Duration::MAX.sec, std::numeric_limits::max()); + EXPECT_EQ(Duration::MAX.nsec, 999999999); + EXPECT_EQ(Duration::MIN.sec, std::numeric_limits::min()); + EXPECT_EQ(Duration::MIN.nsec, 0); + EXPECT_EQ(Duration::ZERO.sec, 0); + EXPECT_EQ(Duration::ZERO.nsec, 0); + EXPECT_EQ(Duration::NANOSECOND.sec, 0); + EXPECT_EQ(Duration::NANOSECOND.nsec, 1); + EXPECT_EQ(Duration::MICROSECOND.sec, 0); + EXPECT_EQ(Duration::MICROSECOND.nsec, 1000); + EXPECT_EQ(Duration::MILLISECOND.sec, 0); + EXPECT_EQ(Duration::MILLISECOND.nsec, 1000000); + EXPECT_EQ(Duration::SECOND.sec, 1); + EXPECT_EQ(Duration::SECOND.nsec, 0); + EXPECT_EQ(Duration::MINUTE.sec, 60); + EXPECT_EQ(Duration::MINUTE.nsec, 0); + EXPECT_EQ(Duration::HOUR.sec, 60 * 60); + EXPECT_EQ(Duration::HOUR.nsec, 0); + EXPECT_EQ(Duration::DAY.sec, 60 * 60 * 24); + EXPECT_EQ(Duration::DAY.nsec, 0); + + EXPECT_EQ(WallDuration::MAX.sec, std::numeric_limits::max()); + EXPECT_EQ(WallDuration::MAX.nsec, 999999999); + EXPECT_EQ(WallDuration::MIN.sec, std::numeric_limits::min()); + EXPECT_EQ(WallDuration::MIN.nsec, 0); + EXPECT_EQ(WallDuration::ZERO.sec, 0); + EXPECT_EQ(WallDuration::ZERO.nsec, 0); + EXPECT_EQ(WallDuration::NANOSECOND.sec, 0); + EXPECT_EQ(WallDuration::NANOSECOND.nsec, 1); + EXPECT_EQ(WallDuration::MICROSECOND.sec, 0); + EXPECT_EQ(WallDuration::MICROSECOND.nsec, 1000); + EXPECT_EQ(WallDuration::MILLISECOND.sec, 0); + EXPECT_EQ(WallDuration::MILLISECOND.nsec, 1000000); + EXPECT_EQ(WallDuration::SECOND.sec, 1); + EXPECT_EQ(WallDuration::SECOND.nsec, 0); + EXPECT_EQ(WallDuration::MINUTE.sec, 60); + EXPECT_EQ(WallDuration::MINUTE.nsec, 0); + EXPECT_EQ(WallDuration::HOUR.sec, 60 * 60); + EXPECT_EQ(WallDuration::HOUR.nsec, 0); + EXPECT_EQ(WallDuration::DAY.sec, 60 * 60 * 24); + EXPECT_EQ(WallDuration::DAY.nsec, 0); +} + +TEST(Rate, constructFromDuration){ + Duration d(4, 0); + Rate r(d); + EXPECT_EQ(r.expectedCycleTime(), d); +} + +TEST(Rate, constructFromDouble){ + Rate r(0.5); + EXPECT_EQ(r.expectedCycleTime(), robot::Duration(2, 0)); + + Rate r2(-0.5); + EXPECT_EQ(r2.expectedCycleTime(), robot::Duration(-2, 0)); + + Rate r3(std::numeric_limits::infinity()); + EXPECT_EQ(r3.expectedCycleTime(), robot::Duration(0, 0)); + + EXPECT_THROW(Rate(0.0), std::runtime_error); +} + +TEST(Rate, sleep_return_value_true){ + Rate r(Duration(0.2)); + Duration(r.expectedCycleTime() * 0.5).sleep(); + EXPECT_TRUE(r.sleep()); +} + +TEST(Rate, sleep_return_value_false){ + Rate r(Duration(0.2)); + Duration(r.expectedCycleTime() * 2).sleep(); + EXPECT_FALSE(r.sleep()); // requested rate cannot be achieved +} + +TEST(WallRate, constructFromDuration){ + Duration d(4, 0); + WallRate r(d); + WallDuration wd(4, 0); + EXPECT_EQ(r.expectedCycleTime(), wd); +} + +TEST(WallRate, constructFromDouble){ + WallRate r(0.5); + EXPECT_EQ(r.expectedCycleTime(), robot::WallDuration(2, 0)); + + WallRate r2(-0.5); + EXPECT_EQ(r2.expectedCycleTime(), robot::WallDuration(-2, 0)); + + WallRate r3(std::numeric_limits::infinity()); + EXPECT_EQ(r3.expectedCycleTime(), robot::WallDuration(0, 0)); + + EXPECT_THROW(WallRate(0.0), std::runtime_error); +} + +/////////////////////////////////////////////////////////////////////////////////// +// WallTime/WallDuration +/////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////// +// SteadyTime/WallDuration +/////////////////////////////////////////////////////////////////////////////////// + +TEST(SteadyTime, sleep){ + SteadyTime start = SteadyTime::now(); + WallDuration d(2.0); + bool rc = d.sleep(); + SteadyTime end = SteadyTime::now(); + + ASSERT_GT(end - start, d); + ASSERT_TRUE(rc); +} + +TEST(SteadyTime, sleepUntil){ + SteadyTime start = SteadyTime::now(); + SteadyTime end = start + WallDuration(2.0); + bool rc = SteadyTime::sleepUntil(end); + SteadyTime finished = SteadyTime::now(); + + ASSERT_GT(finished, end); + ASSERT_TRUE(rc); +} + +int main(int argc, char **argv){ + testing::InitGoogleTest(&argc, argv); + robot::Time::init(); + return RUN_ALL_TESTS(); +}