ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

CMake Error when using ros_build in Indigo for code earlier used in Groovy

asked 2016-07-19 20:52:04 -0500

perfectspeed gravatar image

Hi I have upgraded a system from Ubuntu 12.04 and Groovy to 14.04 and Indigo. The system was earlier based on packages build with ros_build. I now switched to catkin for the standard packaes. However, there are two packages that are created for the specific system with ros_build. To make it easy, I used the tutorial to Developing rosbuild packages on top of groovy and made a rosbuild_ws so that I have a ~/rosbuild_ws and a ~/catkin_ws. Building the first package went quite smoothly, but the other gave some errors. The package depends on some libraries that are placed in the same directory. These libraries are just added and not compiled on my computer.

Question: What do need to change to compile this code without errors?

The structure:

~/rosbuild_ws
     /the-other-pkg
    /fotonic
        /bin
        /build
        /CMakeFiles
        /include
        /launch
        /lib
        /src
        /test    
        /fz-linux-api        ---this directory contains libraries from Fotonic 
       CMakeLists.txt
       mainpage.dox
       Makefile
       manifest.xml

When I run ros_make fotonic i get the following error in the terminal window:

 [rosbuild] Including /opt/ros/indigo/share/roscpp/rosbuild/roscpp.cmake
  [rosbuild] Including /opt/ros/indigo/share/rospy/rosbuild/rospy.cmake
  CMake Error at CMakeLists.txt:38 (if):
    if given arguments:

      "CMAKE_SIZEOF_VOID_P" "EQUALS" "4"

    Unknown arguments specified

  -- Configuring incomplete, errors occurred!
  See also "/home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeOutput.log".
  See also "/home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeError.log".
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package fotonic written to:
[ rosmake ]    /home/klas/.ros/rosmake/rosmake_output-20160720-030402/fotonic/build_output.log
[rosmake-3] Finished <<< fotonic [FAIL] [ 2.79 seconds ]

Row 36-44 in CMakeList.txt contains:

36    SET (FOTONIC_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/fz-linux-api/include CACHE PATH "fotonic_include dir")

38    if( CMAKE_SIZEOF_VOID_P EQUALS 4 )
39      SET (FOTONIC_LIBRARY_DIRS ${PROJECT_SOURCE_DIR}/fz-linux-api/lib)

41    else( CMAKE_SIZEOF_VOID_P EQUALS 4 )
42      SET (FOTONIC_LIBRARY_DIRS ${PROJECT_SOURCE_DIR}/fz-linux-api/lib64)

44    endif( CMAKE_SIZEOF_VOID_P EQUALS 4 )

And the CMakeError.log tells the following:

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec3611313723/fast"
make[1]: Entering directory `/home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTryCompileExec3611313723.dir/build.make CMakeFiles/cmTryCompileExec3611313723.dir/build
make[2]: Entering directory `/home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3611313723.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec3611313723.dir/CheckSymbolExists.c.o   -c /home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec3611313723
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3611313723.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTryCompileExec3611313723.dir/CheckSymbolExists.c.o  -o cmTryCompileExec3611313723 -rdynamic 
CMakeFiles/cmTryCompileExec3611313723.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[2]: Leaving directory `/home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp'
make[2]: *** [cmTryCompileExec3611313723] Error 1
make[1]: Leaving directory `/home/klas/rosbuild_ws/fotonic/build/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec3611313723/fast] Error 2

File /home/klas/rosbuild_ws/fotonic/build ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-07-19 22:47:49 -0500

ahendrix gravatar image

The CMake log looks like normal operation of cmake; trying several different sets of flags and options to determine if the pthreads library is available or not.

The real issue here seems to be your equality operator; it looks like the semantics of EQUALS has changed in newer versions of cmake.

According the to the cmake documentation for IF, it looks like you should use EQUAL or STREQUAL.

edit flag offensive delete link more

Comments

Thanks, ahendrix! I changed it from EQUALS to EQUAL and it worked! :D

Afterwards I realize that I should have noticed this. The editor didn't mark the expression correctly, but I was focusing on the wrong part of the expression. Thanks again!

perfectspeed gravatar image perfectspeed  ( 2016-07-20 08:35:59 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-19 20:52:04 -0500

Seen: 412 times

Last updated: Jul 20 '16