OROCOS-OCL 架構編譯測試代碼

#
# This file sets some defaults from your *source* directory, such that
# for each build directory you create, the same defaults are used.
#

#
# BIG WARNING :
#
# DO NOT EDIT THIS FILE ! Instead: copy it to orocos-ocl.cmake (in the
# top source directory) and edit that file to set your defaults.
#
# ie: cp orocos-ocl.default.cmake orocos-ocl.cmake ; edit orocos-ocl.cmake
#
# It will be included by the build system, right after the compiler has been
# detected (see top level CMakeLists.txt file)

#
# BIG WARNING :
#
# This is *NOT* a CMake Toolchain file. See http://www.paraview.org/Wiki/CMake_Cross_Compiling
# on how to create and one. This file is included *too late* in the cmake process
# to function correctly as a toolchain file. ESPECIALLY: don't set a compiler
# in this file, this will reset all your cached settings. Do not use this
# file to setup a cross-compilation environment.

#
# Uncomment to set additional include and library paths for: 
# Boost, Xerces, TAO, Omniorb etc.
#
# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:/orocos/Boost-1_36_0/include")
# set(CMAKE_LIBRARY_PATH ${CMAKE_INCLUDE_PATH} "C:/orocos/Boost-1_36_0/lib")

#
# An option to make it easy to turn on all tests (defaults to OFF)
#
#option( BUILD_TESTS "Turn me off to disable compilation of all tests" OFF )
#
# Set the target operating system. One of [lxrt gnulinux xenomai macosx win32]
# You may leave this as-is or force a certain target by removing the if... logic.
#
if (MSVC)
  set( OROCOS_TARGET win32 CACHE STRING "The Operating System target. One of [lxrt gnulinux xenomai macosx win32]")
elseif( APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
  set( OROCOS_TARGET macosx CACHE STRING "The Operating System target. One of [lxrt gnulinux xenomai macosx win32]")
else()
  set( OROCOS_TARGET gnulinux CACHE STRING "The Operating System target. One of [lxrt gnulinux xenomai macosx win32]")
endif()

#
# Sets the CMAKE_BUILD_TYPE to Release by default. This is not a normal
# CMake flag which is not readable during configuration time.
if (NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()

# Useful for Windows/MSVC builds, sets all libraries and executables in one place.
#
# Uncomment to let output go to bin/ and libs/
#
# set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin CACHE PATH "Bin directory")
# set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs CACHE PATH "Lib directory")
#
# And additional link directories.
#
# LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/libs )

打開測試編譯

option( BUILD_TESTS "Turn me off to disable compilation of all tests" ON )

添加測試宏 

MACRO(GLOBAL_ADD_TEST TEST_NAME)
   STRING(LENGTH "${ARGN}" NOTEMPTY)
  IF(NOTEMPTY)
    include_directories(/opt/openrobots/include/)
    ADD_EXECUTABLE (${TEST_NAME} ${ARGN})
  ENDIF(NOTEMPTY) 
ENDMACRO(GLOBAL_ADD_TEST)

MACRO(PROGRAM_ADD_DEPS TEST_NAME)
 TARGET_LINK_LIBRARIES(${TEST_NAME} ${ARGN})
ENDMACRO(PROGRAM_ADD_DEPS)

 

編譯TEST文件

Orocos Component Library version 2.9.1
======================================================================No orocos-ocl.cmake file loaded, using default settings.See orocos-ocl.default.cmake
-- Orocos-RTT found in /opt/openrobots/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
-- Found orocos-rtt 2.9.1 for the gnulinux target. Available transports: mqueue
-- [UseOrocos] Building package ocl without an external buildtool like rosbuild or catkin
-- [UseOrocos] Using Orocos RTT in ocl
-- Checking for one of the modules 'log4cpp-gnulinux'
Looking for netcdf in /opt/openrobots
Found NetCDF
  include dirs: /usr/include
  libs: /usr/lib/x86_64-linux-gnu/libnetcdf.so
Found Doxygen -- documentation can be built
-- Looking for curses implementation - found libncurses
-- Looking for readline/readline.h - found
-- Looking for editline/readline.h - found
Setting LOG4CPP_ROOT to /opt/openrobots
Found orocos-log4cpp in /opt/openrobots/include/orocos
Found log4cxx in /usr/include
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   program_options
--   filesystem
--   system
-- [UseOrocos] Building component orocos-ocl-common in library orocos-ocl-common-gnulinux
-- [UseOrocos] Building typekit library ocl
-- [UseOrocos] Building plugin library print
-- [UseOrocos] Building plugin library os
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-common;ocl;print;os.
-- [UseOrocos] Exporting libraries orocos-ocl-common;ocl;print;os.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib/orocos/gnulinux/ocl;/opt/openrobots/lib/orocos/gnulinux/ocl/types;/opt/openrobots/lib/orocos/gnulinux/ocl/plugins.
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-common;ocl;print;os.
-- [UseOrocos] Exporting libraries orocos-ocl-common;ocl;print;os.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib/orocos/gnulinux/ocl;/opt/openrobots/lib/orocos/gnulinux/ocl/types;/opt/openrobots/lib/orocos/gnulinux/ocl/plugins.
Building TaskBrowser with readline support.
-- Found orocos-rtt 2.9.1 for the gnulinux target. 
-- Found RTT_PLUGIN_rtt-scripting_gnulinux 
-- [UseOrocos] Building library orocos-ocl-taskbrowser
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-taskbrowser.
-- [UseOrocos] Exporting libraries orocos-ocl-taskbrowser.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib.
-- [UseOrocos] Building component orocos-ocl-timer in library orocos-ocl-timer-gnulinux
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-timer.
-- [UseOrocos] Exporting libraries orocos-ocl-timer.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib/orocos/gnulinux/ocl.
-- Found orocos-rtt 2.9.1 for the gnulinux target. 
-- Found RTT_PLUGIN_rtt-scripting_gnulinux 
-- [UseOrocos] Building component orocos-ocl-logging in library orocos-ocl-logging-gnulinux
-- [UseOrocos] Building library orocos-ocl-log4cpp
-- [UseOrocos] Building component orocos-ocl-log4cxx in library orocos-ocl-log4cxx-gnulinux
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-logging;orocos-ocl-log4cpp;orocos-ocl-log4cxx.
-- [UseOrocos] Exporting libraries orocos-ocl-logging;orocos-ocl-log4cpp;orocos-ocl-log4cxx.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib/orocos/gnulinux/ocl;/opt/openrobots/lib.
-- [UseOrocos] Building component orocos-logging-tests in library orocos-logging-tests-gnulinux
failed to create symbolic link '/home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/logging/tests/data' because existing path cannot be removed: Is a directory
-- Found orocos-rtt 2.9.1 for the gnulinux target. 
-- Found RTT_PLUGIN_rtt-marshalling_gnulinux 
-- [UseOrocos] Building component orocos-ocl-reporting in library orocos-ocl-reporting-gnulinux
-- [UseOrocos] Building component orocos-ocl-reporting-netcdf in library orocos-ocl-reporting-netcdf-gnulinux
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-reporting;orocos-ocl-reporting-netcdf.
-- [UseOrocos] Exporting libraries orocos-ocl-reporting;orocos-ocl-reporting-netcdf.
-- [UseOrocos] Exporting include directories /usr/include.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib/orocos/gnulinux/ocl.
COMMAND copy /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/reporting/tests/reporter.cpf -> /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/reporting/tests/reporter.cpf
-- Found orocos-rtt 2.9.1 for the gnulinux target. 
-- Found RTT_PLUGIN_rtt-marshalling_gnulinux 
-- Found RTT_PLUGIN_rtt-scripting_gnulinux 
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- [UseOrocos] Building library orocos-ocl-deployment
-- [UseOrocos] Generating package version 2.9.1 from COMPONENT_VERSION.
-- [UseOrocos] Exporting targets orocos-ocl-deployment.
-- [UseOrocos] Exporting libraries orocos-ocl-deployment.
-- [UseOrocos] Exporting library directories /opt/openrobots/lib.
COMMAND copy /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/deployment/tests/ComponentA.cpf -> /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/deployment/tests/ComponentA.cpf
COMMAND copy /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/deployment/tests/ComponentB.cpf -> /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/deployment/tests/ComponentB.cpf
COMMAND copy /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/deployment/tests/deployment.cpf -> /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1/deployment/tests/deployment.cpf
-- [UseOrocos] Building executable helloworld
-- [UseOrocos] Building component orocos-ocl-helloworld in library orocos-ocl-helloworld-gnulinux
-- [UseOrocos] Building executable deployer
-- [UseOrocos] Building executable rttscript
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zz/robotpkg_workspace/robotpkg/architecture/orocos-ocl/work.ubuntu/ocl-2.9.1
Use: make\ docapi\ dochtml\ docpdf to build the documentation.
[  0%] Built target message
[  2%] Built target print
[  5%] Built target os
[  8%] Built target ocl
[ 13%] Built target orocos-ocl-common
[ 16%] Built target orocos-ocl-taskbrowser
Scanning dependencies of target taskb
[ 17%] Building CXX object taskbrowser/tests/CMakeFiles/taskb.dir/main.cpp.o
[ 19%] Linking CXX executable taskb
[ 19%] Built target taskb
[ 22%] Built target orocos-ocl-timer
Scanning dependencies of target testWithStateMachine
[ 23%] Building CXX object timer/tests/CMakeFiles/testWithStateMachine.dir/testWithStateMachine.cpp.o
[ 25%] Linking CXX executable testWithStateMachine
[ 25%] Built target testWithStateMachine
Scanning dependencies of target timer
[ 26%] Building CXX object timer/tests/CMakeFiles/timer.dir/main.cpp.o
[ 27%] Linking CXX executable timer
[ 27%] Built target timer
[ 33%] Built target orocos-ocl-log4cpp
[ 44%] Built target orocos-ocl-logging
[ 47%] Built target orocos-ocl-log4cxx
Scanning dependencies of target orocos-logging-tests
[ 48%] Building CXX object logging/tests/CMakeFiles/orocos-logging-tests.dir/TestComponent.cpp.o
[ 50%] Building CXX object logging/tests/CMakeFiles/orocos-logging-tests.dir/TestLoggingAvailability.cpp.o
[ 51%] Linking CXX shared library orocos/gnulinux/ocl/liborocos-logging-tests-gnulinux.so
[ 51%] Built target orocos-logging-tests
Scanning dependencies of target testlogging
[ 52%] Building CXX object logging/tests/CMakeFiles/testlogging.dir/testlogging.cpp.o
[ 54%] Linking CXX executable testlogging
[ 54%] Built target testlogging
[ 67%] Built target orocos-ocl-reporting
[ 70%] Built target orocos-ocl-reporting-netcdf
Scanning dependencies of target tcpreport
[ 72%] Building CXX object reporting/tests/CMakeFiles/tcpreport.dir/tcpmain.cpp.o
[ 73%] Linking CXX executable tcpreport
[ 73%] Built target tcpreport
Scanning dependencies of target report
[ 75%] Building CXX object reporting/tests/CMakeFiles/report.dir/main.cpp.o
[ 76%] Linking CXX executable report
[ 76%] Built target report
Scanning dependencies of target ncreport
[ 77%] Building CXX object reporting/tests/CMakeFiles/ncreport.dir/ncmain.cpp.o
[ 79%] Linking CXX executable ncreport
[ 79%] Built target ncreport
[ 82%] Built target orocos-ocl-deployment
Scanning dependencies of target deploy
[ 83%] Building CXX object deployment/tests/CMakeFiles/deploy.dir/main.cpp.o
[ 85%] Linking CXX executable deploy
[ 85%] Built target deploy
[ 88%] Built target helloworld
[ 91%] Built target orocos-ocl-helloworld
[ 95%] Built target deployer
[100%] Built target rttscript

 測試report

ocl-2.9.1/reporting/tests$ ./report
0.017 [ Info   ][./report::main()] ./report manually raises LogLevel to 'Info' (5). See also file 'orocos.log'.
0.017 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=1, CPU affinity=0, with name='Reporting'
0.018 [ Info   ][Reporting] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 0 (PID= 65938 ).
0.018 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=1, CPU affinity=0, with name='MyPeer'
0.018 [ Info   ][MyPeer] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 0 (PID= 65939 ).
0.018 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=1, CPU affinity=0, with name='MyPeer2'
0.018 [ Info   ][MyPeer2] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 0 (PID= 65940 ).
0.019 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=1, CPU affinity=0, with name='MySoloPeer'
0.019 [ Info   ][MySoloPeer] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 0 (PID= 65941 ).
0.019 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=1, CPU affinity=0, with name='TaskBrowser'
0.019 [ Info   ][TaskBrowser] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 0 (PID= 65942 ).
   Switched to : Reporting
0.019 [ Info   ][./report::main()] Entering Task Reporting
0.027 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=0, CPU affinity=0, with name='Activity'
0.027 [ Info   ][Activity] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 1 (PID= 65943 ).
0.027 [ Info   ][./report::main()] Loading Service or Plugin marshalling in TaskContext Reporting
0.027 [ Info   ][./report::main()] Found complete interface of requested service 'marshalling'
0.027 [ Info   ][PropertyLoader:load] Loading properties into Service 'Reporting' with 'reporter.cpf'.
0.030 [ ERROR  ][ReportingComponent] Can not report InputPort D2Port of Component MyPeer2
0.032 [ Info   ][ReportingComponent] Not buffering of data flow connections. You may miss samples.
0.032 [ Info   ][ReportingComponent] Monitoring OutputPort D1Port : ok.
0.032 [ Info   ][ReportingComponent] Not buffering of data flow connections. You may miss samples.
0.032 [ Info   ][ReportingComponent] Monitoring OutputPort D2Port : ok.

  This demo allows reporting of Components.
  Use 'reportComponent("MyPeer")' and/or 'reportComponent("MyPeer2")'
  Then invoke 'start()' and 'stop()'
  Other methods (type 'this') are available as well.

  This console reader allows you to browse and manipulate TaskContexts.
  You can type in an operation, expression, create or change variables.
  (type 'help' for instructions and 'ls' for context info)

    TAB completion and HISTORY is available ('bash' like)

    Use 'Ctrl-D' or type 'quit' to exit this program.

Reporting [S]> this.start
4.781 [ Info   ][Thread] Creating Thread for scheduler=ORO_SCHED_OTHER, priority=1, CPU affinity=0, with name='GlobalEngine'
4.781 [ Info   ][GlobalEngine] Thread created with scheduler type 'ORO_SCHED_OTHER', priority 0, cpu affinity 1 and period 0 (PID= 65944 ).
 TimeStamp MyPeer2.D1Port MyPeer.D2Port.0 MyPeer.D2Port.1 MyPeer.D2Port.2 MyPeer.D2Port.3 MyPeer.D2Port.4 MyPeer.D2Port.5 MyPeer.D2Port.6 MyPeer.D2Port.7 MyPeer.D2Port.8 MyPeer.D2Port.9 MyPeer.Hello.0 MyPeer.Hello.1 MyPeer.Hello.2 MyPeer.Hello.3 MyPeer.Hello.4
 1.396e-06 27.55  49.33 49.33 49.33 49.33 49.33 49.33 49.33 49.33 49.33 49.33  W o r l d 
 = true                

Reporting [R]>  0.251848 29.55  52.33 52.33 52.33 52.33 52.33 52.33 52.33 52.33 52.33 52.33  W o r l d 
 1.25235 34.55  62.33 62.33 62.33 62.33 62.33 62.33 62.33 62.33 62.33 62.33  W o r l d 
 2.25233 39.55  72.33 72.33 72.33 72.33 72.33 72.33 72.33 72.33 72.33 72.33  W o r l d 
 3.25178 44.55  82.33 82.33 82.33 82.33 82.33 82.33 82.33 82.33 82.33 82.33  W o r l d 
 4.25187 49.55  92.33 92.33 92.33 92.33 92.33 92.33 92.33 92.33 92.33 92.33  W o r l d 
 5.25181 54.55  2 2 2 2 2 2 2 2 2 2  W o r l d 
 6.25184 59.55  12 12 12 12 12 12 12 12 12 12  W o r l d 
 7.25161 64.55  22 22 22 22 22 22 22 22 22 22  W o r l d 
 8.25245 69.55  32 32 32 32 32 32 32 32 32 32  W o r l d 
 9.25281 74.55  42 42 42 42 42 42 42 42 42 42  W o r l d 
 10.2522 79.55  52 52 52 52 52 52 52 52 52 52  W o r l d 
 11.2521 84.55  62 62 62 62 62 62 62 62 62 62  W o r l d 
 12.2517 89.55  72 72 72 72 72 72 72 72 72 72  W o r l d 
 13.252 94.55  82 82 82 82 82 82 82 82 82 82  W o r l d 
 14.2524 99.55  92 92 92 92 92 92 92 92 92 92  W o r l d 
 15.2517 4  1 1 1 1 1 1 1 1 1 1  W o r l d 
 16.2514 9  11 11 11 11 11 11 11 11 11 11  W o r l d 
 17.2517 14  21 21 21 21 21 21 21 21 21 21  W o r l d 
 18.252 19  31 31 31 31 31 31 31 31 31 31  W o r l d 
 19.2525 24  41 41 41 41 41 41 41 41 41 41  W o r l d 

 
24.104 [ Info   ][Logger] Orocos Logging Deactivated.

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章