YARP install on Slackware 14.2

And now it’s time for YARP!
First fetch ACE from the official website and read the ACE_INSTALL.html inside the .tar.gz. Oh, it’s a lengthy and not-so-easy one. Step by step:

tar -xzf ACE-6.4.0.tar.gz
export ACE_ROOT=$PWD/ACE_wrappers
echo $ACE_ROOT
cd ACE_wrappers/
echo "#include <ace/config-linux.h>" > ace/config.h
echo "include $ACE_ROOT/include/makeinclude/platform_linux.GNU" > include/makeinclude/platform_macros.GNU 
echo "INSTALL_PREFIX=/usr/local" >> include/makeinclude/platform_macros.GNU
export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH
make
make install

Be sure to have GSL:

sbopkg -i gsl

Time for a YARP compile, they suggest on http://www.yarp.it/install_yarp_linux.html to have a couple options enabled in a ccmake GUI… who has time for clicking in GUIs?

git clone https://github.com/robotology/yarp.git
cd yarp
mkdir build && cd build
cmake -DCREATE_GUIS=on -DCREATE_LIB_MATH=on ../
make -j4

Oh, errors?

[ 58%] Linking CXX executable ../../../bin/yarpidl_rosmsg
/usr/lib64/libreadline.so.6: undefined reference to `tgetnum'
/usr/lib64/libreadline.so.6: undefined reference to `tgetent'
/usr/lib64/libreadline.so.6: undefined reference to `tgetstr'
/usr/lib64/libreadline.so.6: undefined reference to `tgoto'
/usr/lib64/libreadline.so.6: undefined reference to `UP'
/usr/lib64/libreadline.so.6: undefined reference to `BC'
/usr/lib64/libreadline.so.6: undefined reference to `tputs'
/usr/lib64/libreadline.so.6: undefined reference to `PC'
/usr/lib64/libreadline.so.6: undefined reference to `tgetflag'
collect2: error: ld returned 1 exit status
src/idls/rosmsg/CMakeFiles/yarpidl_rosmsg.dir/build.make:175: recipe for target 'bin/yarpidl_rosmsg' failed
make[2]: *** [bin/yarpidl_rosmsg] Error 1

… what the? That’s not a thing I’m used to see around here. No tgetnum? In readline?
First things first – is it really readline to blame? Is he the one supplying tgetnum?

nm -AD /usr/lib64/lib*.so 2>/dev/null | grep ' tgetnum'

Nope. So I need termcap+ncurses to be linked with -ltermcap -lncurses, but how to do this in an elegant way … screw the elegant way, how to do this in a BULLETPROOF way?
ACE! He is linked literally everywhere! Let me dive into FindACE.cmake, it’s nice to add this around line 120:

 list(APPEND ACE_LIBRARIES ncurses termcap)

Done, compiles nicely. But does it work?

bash-4.3$ yarpserver
    __  __ ___  ____   ____
    \ \/ //   ||  _ \ |  _ \
     \  // /| || |/ / | |/ /
     / // ___ ||  _ \ |  _/
    /_//_/  |_||_| \_\|_|
    ========================

Call with --help for information on available options
Using port database: :memory:
Using subscription database: :memory:
IP address: default
Port number: 10000
yarp: Port /root active at tcp://192.168.0.13:10000

Registering name server with itself:
 * register "/root" tcp "192.168.0.13" 10000
   + set "/root" ips "127.0.0.1" "192.168.0.13"
   + set "/root" process 19726
 * register fallback mcast "224.2.1.1" 10000
   + set fallback ips "127.0.0.1" "192.168.0.13"
   + set fallback process 19726
Name server can be browsed at http://192.168.0.13:10000/

Ok.  Ready!

Yeap.