8#include <rbdl/rbdl_config.h>
16 static int compile_version = RBDL_API_VERSION;
17 return compile_version;
23 int compile_major = (compile_version & 0xff0000) >> 16;
24 int compile_minor = (compile_version & 0x00ff00) >> 8;
25 int compile_patch = (compile_version & 0x0000ff);
27 std::ostringstream compile_version_string(
"");
28 compile_version_string << compile_major <<
"." << compile_minor <<
"."
31 int version_major = (version & 0xff0000) >> 16;
32 int version_minor = (version & 0x00ff00) >> 8;
33 int version_patch = (version & 0x0000ff);
35 std::ostringstream link_version_string (
"");
36 link_version_string << version_major <<
"." << version_minor <<
"."
39 if (version_major != compile_major) {
40 std::cerr <<
"Error: trying to link against an incompatible RBDL library."
42 std::cerr <<
"The library version is: " << compile_version_string.str()
43 <<
" but rbdl_config.h is version " << link_version_string.str()
46 }
else if (version_minor != compile_minor) {
47 std::cout <<
"Warning: RBDL library is of version "
48 << compile_version_string.str() <<
" but rbdl_config.h is from version "
49 << link_version_string.str() << std::endl;
56 int compile_major = (compile_version & 0xff0000) >> 16;
57 int compile_minor = (compile_version & 0x00ff00) >> 8;
58 int compile_patch = (compile_version & 0x0000ff);
60 std::ostringstream compile_version_string(
"");
61 compile_version_string << compile_major <<
"." << compile_minor <<
"."
64 std::cout <<
"RBDL version:" << std::endl
65 <<
" API version : " << compile_version_string.str() << std::endl;
67 if (std::string(
"unknown") != RBDL_BUILD_COMMIT) {
68 std::cout <<
" commit : " << RBDL_BUILD_COMMIT
69 <<
" (branch: " << RBDL_BUILD_BRANCH <<
")" << std::endl
70 <<
" build type : " << RBDL_BUILD_TYPE << std::endl;
73#ifdef RBDL_ENABLE_LOGGING
74 std::cout <<
" logging : on (warning: reduces performance!)" << std::endl;
76 std::cout <<
" logging : off" << std::endl;
79#ifdef RBDL_BUILD_ADDON_LUAMODEL
80 std::cout <<
" LuaModel : on" << std::endl;
82 std::cout <<
" LuaModel : off" << std::endl;
85#ifdef RBDL_BUILD_ADDON_URDFREADER
86 std::cout <<
" URDFReader : on" << std::endl;
88 std::cout <<
" URDFReader : off" << std::endl;
91 std::string build_revision (RBDL_BUILD_COMMIT);
92 if (build_revision ==
"unknown") {
93 std::cout << std::endl
94 <<
"Version information incomplete: to enable version information re-build"
96 <<
"library from valid repository and enable RBDL_STORE_VERSION."
RBDL_DLLAPI void rbdl_check_api_version(int version)
RBDL_DLLAPI int rbdl_get_api_version()
RBDL_DLLAPI void rbdl_print_version()