Adding VxWorks 7 Boost C++ Library Support
Table of Contents
1 Introduction
The Boost project provides a comprehensive set of peer-reviewed, portable C++ source libraries that work well with the C++ Standard Library.
VxWorks is a Real Time Operating System built by Wind River.
VxWorks supports a subset of the Boost C++ library. The supported libraries are:
Atomic Chrono Container Context Contract Date Time Exception Filesystem Graph Log Math Program Options Random Regex Serialization Timer Type Erasure BOOST Tests
This blog describes how to configure VxWorks with Boost and then how to validate that the Math library is functional using a dynamic test script which validates target operation using the Boost b2 utility on the workstation.
Note: Because we will run a test suite that was initially targeted for Linux workstations rather than Windows, it is recommended
you have Git bash installed on your Windows workstation. This is installed along with Git for Windows.
2 Prerequisites
These instructions assume that you are using:
A Windows workstation with the following installed on it:
Wind River VxWorks 7, SR0620
Git for Windows
3 Related Documentation
For more information on these topics, refer to:
Wind River documentation:
VxWorks Support for Third-Party Software
Non-Wind River documentation:
https://www.boost.org/
https://git-scm.com/download/win
4 Prepare the Boost Enabled VxWorks Projects
4.1 Create and Build the Boost VxWorks Source Build (VSB) Project Including the Math Library
Open a Windows command shell, configure the build environment, and then add the Boost Math library to a newly created VxWorks source build (VSB) project:
cd <WIND_HOME> // your installation directory wrenv -p vxworks-7 cd <YOUR_WORKSPACE> // your workspace vxprj vsb create boostvsb -bsp vxsim_windows -force -S cd boostvsb // your VSB directory vxprj vsb add BOOST // add the Boost layer to the VSB // enable only the Boost math library vxprj vsb config -s -add "_WRS_CONFIG_BOOST_MATH=y" // set a default filepath mapping vxprj vsb config -s -add "_WRS_CONFIG_BOOST_HOST_FILEPATH_MAPPING_PREFIX=wruserfedora:" make -j 32 // build the VSB
If you wish to enable other Boost libraries, you can enable these individually in the VSB configuration as required.
The VSB build time will extend significantly when Boost libraries are included.
4.2 Create and Build the Boost VxWorks Image Project (VIP) Including the Boost Test Infrastructure
Create the VxWorks image project (VIP) as follows:
cd .. vxprj create vxsim_windows boostvip -vsb boostvsb cd boostvip vxprj vip component add INCLUDE_IPTELNETS // enable the VxWorks time slicing scheduler to allow fair-scheduling Boost tests to pass vxprj vip component add INCLUDE_PX_SCHED_DEF_POLICIES vxprj vip component add INCLUDE_POSIX_PIPES vxprj vip component add INCLUDE_IPDHCPC vxprj vip parameter set DHCPC_REQ_OPTS "\"3"\" vxprj component add vxprj build
5 Setup Boost Test Environment
5.1 Launch the VxSim Network Daemon and the VxWorks Simulator Target
Open a new Windows command shell:
cd <WIND_HOME> // your installation directory wrenv -p vxworks-7 cd <YOUR_WORKSPACE> // your workspace vxsimnetd -sv // launch the simulator network daemon // launch the VxWorks simulator vxsim -netif simnet0=192.168.200.1 -f boostvip\default\vxWorks
The VxWorks simulator kernel shell will appear in a new window.
5.2 Launch the Boost Math Library Test Environment
From the same Windows command shell:
cd boostvsb\3pp\BOOST\boost_1_72_0 set BOOST_TELNET_ADDR=192.168.200.1 vxworks_env.sh build_run_tests.sh --limit-tests=math
The build_run_tests.sh boost test script uses the b2 utility, running on the Windows workstation, to run boost API tests on the VxWorks simulator.
Tests are run dynamically on the VxWorks simulator target and test output will appear in a separate bash shell window.
Expect warnings to be generated.