CMake Error when using ros_build in Indigo for code earlier used in Groovy
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 ...