orocreate-pkg: compile error (typegen not found)

Hi

I'm using the orocos_toolchain_ros 2.2.x with ROS cturtle.

I try to set up a component project by using "rosrun ocl orocreate-pkg".
It creates a project but I can't compile it with "make".

eberlid@eberlid-desktop:~/orocos_toolchain_ros/HelloWorld$ make
mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find 
rosbuild`/rostoolchain.cmake  ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
[rosbuild] Building package HelloWorld
[rosbuild] Cached build flags older than manifests; calling rospack to 
get flags
[rosbuild] Including /opt/ros/cturtle/ros/core/roslisp/cmake/roslisp.cmake
[rosbuild] Including /opt/ros/cturtle/ros/core/rospy/cmake/rospy.cmake
[rosbuild] Including /opt/ros/cturtle/ros/core/roscpp/cmake/roscpp.cmake
Orocos-RTT found in 
/home/eberlid/orocos_toolchain_ros/rtt/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
-- Found orocos-rtt 2.2.1 for the gnulinux target. Available transports: 
mqueue
Building component HelloWorld in library HelloWorld-gnulinux
Generating typekit for HelloWorld...
CMake Error at 
/home/eberlid/orocos_toolchain_ros/rtt/install/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake:245 
(message):
   'typegen' not found in path.  Can't build typekit.  Did you 'source 
env.sh'
   ?
Call Stack (most recent call first):
   CMakeLists.txt:55 (orocos_typegen_headers)
 
 
-- Configuring incomplete, errors occurred!
make: *** [all] Error 1

The env.sh file is included in the .bashrc file with

source ~/orocos_toolchain_ros/env.sh

and this file has the content

export RUBYLIB=`rospack find 
utilrb`/build/orocos-toolchain-utilrb/lib:`rospack find 
orogen`/build/orocos-toolchain-orogen/lib:`rospack find 
typelib`/build/orocos-toolchain-typelib/bindings/ruby/lib:`rospack find 
typelib`/lib
export GEM_HOME=`rosstack find orocos_toolchain_ros`/.gems
export RUBYOPT=-rubygems
export PATH=`rospack find 
orogen`/build/orocos-toolchain-orogen/bin:`rosstack find 
orocos_toolchain_ros`/.gems/bin:$PATH
export TYPELIB_USE_GCCXML=1

How can I make it find the typegen? What may cause this problem?

Thanks
Dani

Ruben Smits's picture

orocreate-pkg: compile error (typegen not found)

On 07 Apr 2011, at 14:04, Daniel Eberli wrote:

> Hi
>
> I'm using the orocos_toolchain_ros 2.2.x with ROS cturtle.
>
> I try to set up a component project by using "rosrun ocl orocreate-pkg".
> It creates a project but I can't compile it with "make".
>
>

> eberlid@eberlid-desktop:~/orocos_toolchain_ros/HelloWorld$ make
> mkdir -p bin
> cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find 
> rosbuild`/rostoolchain.cmake  ..
> -- The C compiler identification is GNU
> -- The CXX compiler identification is GNU
> -- Check for working C compiler: /usr/bin/gcc
> -- Check for working C compiler: /usr/bin/gcc -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/c++
> -- Check for working CXX compiler: /usr/bin/c++ -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> [rosbuild] Building package HelloWorld
> [rosbuild] Cached build flags older than manifests; calling rospack to 
> get flags
> [rosbuild] Including /opt/ros/cturtle/ros/core/roslisp/cmake/roslisp.cmake
> [rosbuild] Including /opt/ros/cturtle/ros/core/rospy/cmake/rospy.cmake
> [rosbuild] Including /opt/ros/cturtle/ros/core/roscpp/cmake/roscpp.cmake
> Orocos-RTT found in 
> /home/eberlid/orocos_toolchain_ros/rtt/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake
> -- Found orocos-rtt 2.2.1 for the gnulinux target. Available transports: 
> mqueue
> Building component HelloWorld in library HelloWorld-gnulinux
> Generating typekit for HelloWorld...
> CMake Error at 
> /home/eberlid/orocos_toolchain_ros/rtt/install/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake:245 
> (message):
>   'typegen' not found in path.  Can't build typekit.  Did you 'source 
> env.sh'
>   ?
> Call Stack (most recent call first):
>   CMakeLists.txt:55 (orocos_typegen_headers)
> 
> 
> -- Configuring incomplete, errors occurred!
> make: *** [all] Error 1
> 

>
> The env.sh file is included in the .bashrc file with
>
>
> source ~/orocos_toolchain_ros/env.sh
> 

>
> and this file has the content
>
>
> export RUBYLIB=`rospack find 
> utilrb`/build/orocos-toolchain-utilrb/lib:`rospack find 
> orogen`/build/orocos-toolchain-orogen/lib:`rospack find 
> typelib`/build/orocos-toolchain-typelib/bindings/ruby/lib:`rospack find 
> typelib`/lib
> export GEM_HOME=`rosstack find orocos_toolchain_ros`/.gems
> export RUBYOPT=-rubygems
> export PATH=`rospack find 
> orogen`/build/orocos-toolchain-orogen/bin:`rosstack find 
> orocos_toolchain_ros`/.gems/bin:$PATH
> export TYPELIB_USE_GCCXML=1
> 

>
> How can I make it find the typegen? What may cause this problem?
>

Can you check if typegen is actually located in one directories listed in the PATH variable?

--- Ruben

> Thanks
> Dani

orocreate-pkg: compile error (typegen not found)

typegen is located at

/home/eberlid/orocos_toolchain_ros/orogen/build/orocos-toolchain-orogen/bin/typegen

and the content of the path variable is

/opt/ros/cturtle/ros/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

so it isn't listed in the PATH. I listed it in the .bashrc and tried again. Now the error is

Building component HelloWorld in library HelloWorld-gnulinux
Generating typekit for HelloWorld...
CMake Error at /home/eberlid/orocos_toolchain_ros/rtt/install/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake:253 (add_subdirectory):
  add_subdirectory given source "typekit" which is not an existing directory.
Call Stack (most recent call first):
  CMakeLists.txt:55 (orocos_typegen_headers)
 
 
-- Configuring incomplete, errors occurred!
make: *** [all] Error 1

can you help me with this error? Thanks! dani

orocreate-pkg: compile error (typegen not found)

This is the content of the CMakeLists.txt

#
# The find_package macro for Orocos-RTT works best with
# cmake >= 2.6.3
#
cmake_minimum_required(VERSION 2.6.3)
 
#
# This creates a standard cmake project. You may extend this file with
# any cmake macro you see fit.
#
project(HelloWorld)
 
#
# Do setup in case of ros package, If ROS_ROOT is set, it is
# recommended to use RTT/OCL through the ros packages.
#
set (ROS_ROOT $ENV{ROS_ROOT} )
if (ROS_ROOT)
   include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
   rosbuild_init()
   rosbuild_find_ros_package( rtt )
   set( RTT_HINTS HINTS ${rtt_PACKAGE_PATH}/install )
endif()
 
# Set the CMAKE_PREFIX_PATH in case you're not using Orocos through ROS
# for helping these find commands find RTT.
find_package(OROCOS-RTT REQUIRED ${RTT_HINTS})
 
# Defines the orocos_* cmake macros. See that file for additional
# documentation.
include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake)
 
#
# Components, types and plugins.
#
# The CMake 'target' names are identical to the first argument of the
# macros below, except for orocos_typegen_headers, where the target is fully
# controlled by generated code of 'typegen'.
#
 
 
# Creates a component library libHelloWorld-<target>.so
# and installs in the directory lib/orocos/HelloWorld/
#
orocos_component(HelloWorld HelloWorld-component.cpp) # ...you may add 
multiple source files
#
# You may add multiple orocos_component statements.
 
#
# Building a typekit (recommended):
#
# Creates a typekit library libHelloWorld-types-<target>.so
# and installs in the directory lib/orocos/HelloWorld/types/
#
orocos_typegen_headers(HelloWorld-types.hpp) # ...you may add multiple 
header files
#
# You may only have *ONE* orocos_typekit statement !
 
 
#
# Building a normal library (optional):
#
# Creates a library libsupport-<target>.so and installs it in
# lib/
#
#orocos_library(support support.cpp) # ...you may add multiple source files
#
# You may add multiple orocos_library statements.
 
 
#
# Building a Plugin or Service (optional):
#
# Creates a plugin library libHelloWorld-service-<target>.so or 
libHelloWorld-plugin-<target>.so
# and installs in the directory lib/orocos/HelloWorld/plugins/
#
# Be aware that a plugin may only have the loadRTTPlugin() function once 
defined in a .cpp file.
# This function is defined by the plugin and service CPP macros.
#
#orocos_service(HelloWorld-service HelloWorld-service.cpp) # ...only one 
service per library !
#orocos_plugin(HelloWorld-plugin HelloWorld-plugin.cpp) # ...only one 
plugin function per library !
#
# You may add multiple orocos_plugin/orocos_service statements.
 
 
#
# Additional headers (not in typekit):
#
# Installs in the include/orocos/HelloWorld/ directory
#
orocos_install_headers( HelloWorld-component.hpp ) # ...you may add 
multiple header files
#
# You may add multiple orocos_install_headers statements.
 
#
# Generates and installs our orocos-HelloWorld-<target>.pc and 
manifest.xml file
#
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/orocos-HelloWorld.pc.in 
${CMAKE_CURRENT_BINARY_DIR}/orocos-HelloWorld-${OROCOS_TARGET}.pc @ONLY)
install(FILES 
${CMAKE_CURRENT_BINARY_DIR}/orocos-HelloWorld-${OROCOS_TARGET}.pc 
DESTINATION  lib/pkgconfig )
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/manifest.xml DESTINATION  
lib/orocos/HelloWorld )
 
#
# Provided 'uninstall' target
#
orocos_uninstall_target()