[Documentation] [TitleIndex] [WordIndex

/!\ Note that this doc is INCOMPLETE

/!\ Although this page is located under ROS Groovy distro, the QNX portion content in this page should be distro-agnostic and therefore should be valid in newer distros (not confirmed).

Note that the command prompt on QNX when you're root is "#".

Authors / Contributors: Isaac Isao Saito (START project at JSK Lab, University of Tokyo), Stefan May (Nuremberg Institute of Technology Georg Simon Ohm - http://www.th-nuernberg.de)

Disclaimer

Preparing QNX

Following components need to be installed step-by-step (ie. in the order as they are written although you may be able to install them in a different order).

Assumption

- Set up the QNX environment as a virtual machine (assuming self hosting isn't that different)

Obtain license

Independent consultant can get a license for free by registration. For example, if you're and want to use QNX as an independent consultant, register here. Anything else is (TBD).

Create a new VM with QNX image

Download QNX image: QNX® Software Development Platform 6.5.0 [Build 201007091524] — QNX Neutrino RTOS Installation and Boot CD (X86-only)

On VMWare Player, create a new VM using .iso file. It might yield message similar to this:

Could not detect which operating system is in this image. You will need to specify which operating system will be installed.

Select "Next". Choose "Other"-"Other" at "Guest Operating System. Configure the rest no matter how you wish.

Once login window launches, login as SuperUser.

Make sure your QNX has an internet access. You may want to set Bridge on your VMWare configration.

Here are also some nice configs on QNX.

Create user

From the panel (likely on your right on QNX desktop), "Configure" --> "Users", and follow the GUI. Use /bin/sh since other common shells might not be available by default (otherwise you can't login to this user without the reason being told).

Set up SSH server

You might want to set up ssh (useful link). Note that you might have to use your own user (it seems root user might not be able to login over ssh).

Install QNX service pack 1 (SDP SP1)

Get the installer and run on your QNX.

Install pkgsrc

There are 2 ways to install pkgsrc, a package manager that we heavily depend on in this instruction.

Following sub sections explain how to install in each way.

pkgsrc via QNX user's community

Install pkgsrc. Follow bootstrap. Don't forget setting up environment as noted. You can run the sequence of commands similar to this:

$ su
# export PATH=/usr/pkg/bin:/usr/pkg/sbin:$PATH
# export CS_LIBPATH=/usr/pkg/lib
# echo $CS_LIBPATH
/usr/pkg/lib
# cd /usr/share && mkdir pkgsrc && cd pkgsrc  (since I'm installing pkgsrc at /usr/share/pkgsrc)
# svn checkout --username your@domain.org http://community.qnx.com/svn/repos/pkgsrc/HEAD_650  (will take a while depending on the internet connection)
# cd bootstrap  && ./bootstrap

%PKGSRC_HOME% is the path (absolute or relative) to your pkgsrc directory (eg. in my case /usr/share/pkgsrc).

Replace your@domain.org with your account you created on qnx.com.

pkgsrc via OpenRTM

Alternatively, you can install pkgsrc via OpenRTM, which is yet another robotics software platform. Its installer provides tailored pkgsrc and simpler installation steps as follows:

 # export PKG_PATH=http://www.openrtm.org/pub/pkgsrc/packages/QNX/i386/6.5.0/All
 # pkg_add -v OpenRTM-aist-1.1.0-RELEASE
 Running install with PRE-INSTALL for omniORB-4.1.6.
 bin/omkdepend
 bin/omnicpp
   : (here installs omniORB)
 man/man1/omniidl.1
 Running install with PRE-INSTALL for omniORB-4.1.6.
 Package omniORB-4.1.6 registered in /var/db/pkg/omniORB-4.1.6
   : (here installs OpenRTM-aist)
 lib/libcoil.so
 lib/libcoil.la
 lib/libcoil-1.1.0.so
  :
 share/openrtm-1.1/doc/IDLReference-en/html/unionSDOPackage_1_1Numeric.html
 etc/rtc.conf.sample
 Package OpenRTM-aist-1.1.0-RELEASE registered in /var/db/pkg/OpenRTM-aist-1.1.0-RELEASE
 #
 # pkg_info|grep OpenRTM
 OpenRTM-aist-1.1.0-RELEASE RT-Middleware and OMG RTC framework

Required / useful tools

Install python 2.7 via pkgsrc

Since QNX 6.5.0 comes with python 2.5 that is not supported by ROS Groovy, we need newer python.

# cd %PKGSRC_HOME%/lang/python27
# bmake
# bmake install
# ln -f -s /usr/pkg/bin/python2.7 /usr/qnx650/host/qnx6/x86/usr/bin/python  (NOTE: This last step is hacky. Needs better solution.)

Install pkg-config via pkgsrc

# cd %PKGSRC_HOME%/devel/pkg-config
# bmake
# bmake install
=> Bootstrap dependency digest>=20010302: found digest-20121220
===> Checking for vulnerabilities in pkg-config-0.28
===> Install binary package of pkg-config-0.28
pkg_add: package `pkg-config-0.28' already recorded as installed
# pkg-config --version
0.28

git client

Note: Installation of GIT is not mandatory when compiling from source. The source tree can be copied from a host machine by e.g. ssh.

git from source

/!\ installing git client hasn't been successful yet. Update is appreciated! source install http://git-scm.com/book/en/Getting-Started-Installing-Git

openssl missing. Just go on. get source from http://git-scm.com/download

git from pkgsrc

# cd %PKGSRC_HOME%/devel/scmgit
# bmake && bmake install

Prepare ROS system dependency

For Catkin

cmake

# cd %PKGSRC_HOME%/devel/cmake
# bmake && bmake install

empy

# cd %PKGSRC_HOME%/textproc/py-empy/
# bmake && bmake install

nose

# cd %PKGSRC_HOME%/devel/py-nose/
# bmake && bmake install

expat

# cd %PKGSRC_HOME%/devel/py-expat/
# bmake && bmake install

distribute (prereq for pip)

pip requires either setuptools or distribute. Although the former is included in pkgsrc, its installation seems problematic (see faq). So we use distribute.

pip (prereq for catkin_pkg)

Installation of pip

catkin_pkg

# pip install catkin_pkg
# pip freeze
:
catkin-pkg==0.1.15
:
# find /usr -iname '*catkin*'     (these files get installed)
/usr/pkg/bin/catkin_create_pkg
/usr/pkg/bin/catkin_generate_changelog
/usr/pkg/bin/catkin_tag_changelog
/usr/pkg/bin/catkin_test_changelog
/usr/pkg/lib/python2.7/site-packages/catkin_pkg
/usr/pkg/lib/python2.7/site-packages/catkin_pkg-0.1.15-py2.7.egg-info

It might be important NOT to use -U option for pip (see this thread).

gtest

There's google-test in pkgsrc/devel, but unfortunately that's not tried here (actually it is possible that using gtest from pkgsrc might be easier). Here instead we manually download its source and install it.

gtest should NOT to be pre-build (ref.). Thus, we only download and place it into an appropriate location.

# svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only
# mv googletest-read-only %CATKIN_WORKSPACE_ROOT%/src/gtest

mktemp

# cd %PKGSRC_HOME%/sysutils/mktemp
# bmake && bmake install

boost

# cd %PKGSRC_HOME%/devel/boost-headers && bmake && bmake install
# cd %PKGSRC_HOME%/devel/boost-jam && bmake && bmake install
# cd %PKGSRC_HOME%/devel/boost-build && bmake && bmake install

boost-libs

boost-libs is also needed, but you might need to tweak when you get error by the follwoing command similar to the one that's used for other boost components. Workarounds are introduced in subsequent sections.

# cd %PKGSRC_HOME%/devel/boost-libs && bmake && bmake install

Build boost-libs from source

The source tarballs from http://www.boost.org can be compiled in version 1.53. A few source modifications might be necessary:

in boost/atomic/detail/base.hpp add
#include <stddef.h>

in boost/smart_ptr/make_shared_array.hpp add
#include <stddef.h>

in boost/test/impl/execution_monitor.ipp add
#include <stdarg.h>

Then execute the following commands

# ./bootstrap.sh
# ./b2
# cp stage/lib/libboost_* /usr/pkg/lib
# cp -r bin.v2 /usr/pkg/lib

Using pre-compiled binary

Download appropriate/latest version of boost-libs from jaist's web site (where they packaged boost into their pkgsrc package for OpenRTM). Author used i386:      boost-libs-1.53.0.tgz   (NetBSD 6.0), which seems to work fine so far.

# tar xfvz boost-libs-1.53.0.tgz
# cd lib/
# cp ./libboost_* /usr/pkg/lib

/!\ This has side effects for sure, if compiling ROS packages! Compiling the source tarball is the prefered way

tinyxml

Download source from here and unzip it. Then do the following:

# cd %HOME_TINYXML_SRC%
# make
# g++ -fPIC -shared -o libtinyxml.so *.o
# cp libtinyxml.so  /usr/pkg/lib
# cp tiny*.h /usr/pkg/include

log4cxx

# cd %PKGSRC_HOME%/devel/log4cxx && bmake && bmake install

If the command above didn't pass, search in groovy/Installation/QNX#Troubleshoot.

Enabling wstool

Although wstool itself can be installed via pip on QNX, SCM tools internally used might not be available by default.

Install git

$ cd %PKGSRC_HOME%/devel/scmgit
$ bmake clean-depends
$ bmake package

'TODO' Isaac is getting error with the command above. Note (Stefan): Workaround, copy src folder of ros_catkin_ws by ssh.

Making all in lib
Making all in roken
/usr/pkg/bin/nawk -f ./roken.awk ./roken.h.in > make-roken.c
gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include  -I../../lib/roken -I../../lib/roken -DBUILD_ROKEN_LIB    -I/usr/pkg/include/readline -I/usr/pkg/include -I/usr/pkg/include/ncurses -I/usr/include -I/usr/pkg/include/db4 -D_LARGE_FILES= -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -DINET6 -O2 -I/usr/pkg/include -I/usr/pkg/include/ncurses -I/usr/include -I/usr/pkg/include/db4 -MT make-roken.o -MD -MP -MF .deps/make-roken.Tpo -c -o make-roken.o make-roken.c
:
In file included from bswap.c:35:
roken.h:207:2: error: #error Missing dirfd() and ->dd_fd
*** Error code 1

Stop.
bmake: stopped in /usr/share/pkgsrc/security/heimdal/work/heimdal-1.5.2/lib/roken
*** Error code 1

ROS itself

With the same reason where pip had to be run one-by-one for each package on QNX (which is strange but no solution found yet) when installing catkin_pkg, we need to run pip for several times.

# pip install pyyaml
# pip install vcstools
# pip install wstool
# pip install rosinstall
# pip install rosinstall-generator
# pip install rosdistro
# pip install rospkg
# pip install rosdistro
# pip install rosinstall
# pip install rosdistro

# rosdep init
# rosdep update

# rosdep install --from-paths src --ignore-src --rosdistro groovy -y

(7/11/2013) The rosdep command above doesn't run yet. rosdep keys need tailored for QNX. Link to the discussion about this.

For the moment, an installation of ros_comm from source is possible with a few modifications. Download source on host machine:

# cd /tmp
# mkdir ros_catkin_ws
# cd ros_catkin_ws
# rosinstall_generator ros_comm --rosdistro groovy --deps --wet-only > groovy-ros_comm-wet.rosinstall
# wstool init -j8 src groovy-ros_comm-wet.rosinstall

On QNX node execute:

# scp -r <USER>@<HOST_IP>:/tmp/ros_catkin_ws .

Do the following changes:

... in src/catkin/cmake/tools/rt.cmake comment out

# find_library(RT_LIBRARY rt)
# assert_file_exists(${RT_LIBRARY} "RT Library")

... in src/roslib/CMakeLists.txt remove rt library in

target_link_libraries(roslib rt)

... in src/rosout/CMakeLists.txt add

link_directories(/usr/pkg/lib)

Then start compilation with

# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/pkg/lib
# ./src/catkin/bin/catkin_make_isolated --install

Manual source modifications

The compilation will complain mostly about undefined functions. For the moment, you need to do modify these files manually, e.g.:

error: 'size_t' was not declared in this scope

add

#include <cstddef>
using std::size_t;

Cannot specify link libraries for target rospack-utest which is not build by this project

comment

if(CATKIN_ENABLE_TESTING)
 add_subdirectory(test)
endif()

error: ISO C++ forbids declaration of FILE with no type

add

#include <stdio.h>

no matching function for call to TiXmlElement::FirstChildElement(... char ...)

add

.c_str()

to variables of type string if char* is expected

conflict with void ros::param::set(...)

change

set(...)

to

ros::param::set(...)

error: isalnum was not declared ...

add

#include <ctype.h>

error: sockaddr_storage does not name a type

add

#include <sys/socket.h>

error: ptrdiff_t does not name a type

add

#include <stddef.h>

hostname not set to this machine / servname not supported for ai_socktype

in install_isolated/lib/python2.7/site-packages/rosgraph/network.py change

socket.getaddrinfo(..., 0, ...)

to

socket.getaddrinfo(..., None, ...)

Run

Catkin

Check first if installed catkin runs. There should be a number of ways to do so, but here let's follow How to bootstrap ROS from source.

Miscellaneous library

GNU Zile (Emacs alternative, optional)

You may experience hard time in trying to build Emacs on QNX via pkgsrc...Good news for lighter Emacs users is that there is a simple alternative Zile.

# cd %PKGSRC_HOME%/editor/zile
# bmake package && bmake install

Build omniORB (option)

omniORB is not required if you're using ROS only. This section is basically for those who combine with OpenRTM.

To install from public omniORB repository, (TBD).

To install it via OpenRTM, follow groovy/Installation/QNX#pkgsrc_via_OpenRTM to install OpenRTM.

Once you have either binary or source of omniORB on your QNX, follow the install instruction that should be available in %TOP_OMNIORB%/README.unix.

Troubleshoot

svn checkout on QNX doesn't proceed after authentication

You might want to reboot the OS and try again.

bmake pkg-config might complain "already installed as dependency"

If you see errors like this:

# cd pkgsrc/devel/pkg-config
# bmake
# bmake install
WARNING: To fix run: `/usr/pkg/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
==> Install binary package of pkg-config-0.28
:
pkg_add: package `pkg-config-0.28' was already installed as dependency, now marked as installed manually

or when running some command and stuck at:

checking for openldap... no
checking for i386-pc-nto-qnx6.5.0-pkg-config... no
checking for pkg-config... /usr/pkg/bin/pkg-config
checking pkg-config is at least version 0.9.0...       (stuck)

Make sure your terminal has this environment variable already set (in a single line although you might see the following in multiple lines):

# export MALLOC_BAND_CONFIG_STR="8:16,32,0:24,32,0:32,32,0:48,24,0:64,24,0:80,24,0:96,16,0:128,8,0"

Building cmake fails with

# cd cmake && bmake
:
Package libarchive-2.8.4nb1 has a multiple-vulnerabilities vulnerability, see http://secunia.com/advisories/47049/
ERROR: Define ALLOW_VULNERABLE_PACKAGES in mk.conf or IGNORE_URL in pkg_install.conf(5) if this package is absolutely essential.
*** Error code 1

Stop.
bmake: stopped in %PKGSRC_HOME%/archivers/libarchive
*** Error code 1

Stop.
bmake: stopped in %PKGSRC_HOME%/devel/cmake

-pthread is not available as an argument of g++

Error in xml python script

comment

#from xml.etree.ElementTree import *

in /usr/pkg/lib/python2.7/xml/etree/cElementTree.py and add

from xml.etree.ElementTree import *

bmake log4cxx error

# cd %PKGSRC_HOME%/devel/log4cxx && bmake
:
if c++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\" -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1 -DHAVE_SYSLOG=1 -DHAVE_FWIDE=1  -I. -I. -I../../../src/main/include -I../../../src/main/include  -I/usr/pkg/include/apr-1 -I/usr/pkg/include -I/usr/include  -D_LARGEFILE64_SOURCE  -I/usr/pkg/include/apr-1   -I/usr/pkg/include/apr-1 -I/usr/pkg/include  -O2 -I/usr/pkg/include/apr-1 -I/usr/pkg/include -I/usr/include -MT console.o -MD -MP -MF ".deps/console.Tpo" -c -o console.o console.cpp; \
        then mv -f ".deps/console.Tpo" ".deps/console.Po"; else rm -f ".deps/console.Tpo"; exit 1; fi
console.cpp: In function 'int main(int, char**)':
console.cpp:59: error: 'puts' was not declared in this scope
console.cpp:67: error: 'stderr' was not declared in this scope
console.cpp:67: error: 'stdout' was not declared in this scope
console.cpp:67: error: 'fputs' was not declared in this scope
console.cpp:70: error: 'stderr' was not declared in this scope
console.cpp:70: error: 'stdout' was not declared in this scope
console.cpp:103: error: 'stderr' was not declared in this scope
console.cpp:103: error: 'stdout' was not declared in this scope
console.cpp:105: error: 'stderr' was not declared in this scope
console.cpp:105: error: 'stdout' was not declared in this scope
console.cpp:108: error: 'stderr' was not declared in this scope
console.cpp:108: error: 'fputs' was not declared in this scope
console.cpp:111: error: 'fflush' was not declared in this scope
make[3]: *** [console.o] Error 1
make[3]: Leaving directory `/usr/share/pkgsrc/devel/log4cxx/work/apache-log4cxx-0.10.0/src/examples/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/share/pkgsrc/devel/log4cxx/work/apache-log4cxx-0.10.0/src/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/share/pkgsrc/devel/log4cxx/work/apache-log4cxx-0.10.0/src'
make: *** [all-recursive] Error 1
*** Error code 2

Stop.
bmake: stopped in /usr/share/pkgsrc/devel/log4cxx
*** Error code 1

Stop.
bmake: stopped in /usr/share/pkgsrc/devel/log4cxx

The workaround is:

in work/apache-log4cxx-0.10.0/src/examples/cpp/console.cpp add
#include <stdio.h>

If that fails, do the following:

# cd %PKGSRC_HOME%/devel/log4cxx/work/apache-log4cxx-0.10.0/src/examples/cpp
# mv console.cpp console.cpp.org
# vi Makefile

Then remove all console* related definition in Makefile (example entire file will be available).

Now bmake should run without errors. Obviously there might be side-effects though...

wstool error

Though not necessarilly associated to QNX, suspect your internet connection if you see the following error duroing wstool run.

ERROR in config: Unable to download URL [http:$DOMAIN$]: <urlopen error [Errno 7] No address associated with hostname>

sh: ifconfig: cannot execute no such file

It happens, sometimes. Run with absolute command then.

/usr/qnx650/target/qnx6/x86/sbin/ifconfig

Network interface is not found

On VMWare Fusion

Support

Feel free to modify this wiki page as it's open to public. When you find issues to discuss, please consider following continuing at channels:


2022-05-28 12:37