abb_robot_driver: Windows build failing
Hi, When I try to build the package on Windows using catkin_make_isolated (because catkin build isn’t supported on Windows) this is my CMakeError log:
Click to expand
Determining if the include file pthread.h exists failed with the following output:
Change Dir: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_d3d33 && [1/2] Building C object CMakeFiles\cmTC_d3d33.dir\CheckIncludeFile.c.obj
FAILED: CMakeFiles/cmTC_d3d33.dir/CheckIncludeFile.c.obj
C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_d3d33.dir\CheckIncludeFile.c.obj /FdCMakeFiles\cmTC_d3d33.dir\ /FS -c CheckIncludeFile.c
CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory
ninja: build stopped: subcommand failed.
And this is my CMakeOutput log:
Click to expand
The system is: Windows - 10.0.19042 - AMD64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
Build flags:
Id flags:
The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCCompilerId.c
Microsoft (R) Incremental Linker Version 14.28.29337.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:CMakeCCompilerId.exe
CMakeCCompilerId.obj
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.exe"
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.obj"
The C compiler identification is MSVC, found in "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/3.18.2/CompilerIdC/CMakeCCompilerId.exe"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe
Build flags:
Id flags:
The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.28.29337.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:CMakeCXXCompilerId.exe
CMakeCXXCompilerId.obj
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"
The CXX compiler identification is MSVC, found in "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/3.18.2/CompilerIdCXX/CMakeCXXCompilerId.exe"
Detecting C compiler ABI info compiled with the following output:
Change Dir: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_c4114 && [1/2] Building C object CMakeFiles\cmTC_c4114.dir\CMakeCCompilerABI.c.obj
[2/2] Linking C executable cmTC_c4114.exe
Detecting CXX compiler ABI info compiled with the following output:
Change Dir: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_92086 && [1/2] Building CXX object CMakeFiles\cmTC_92086.dir\CMakeCXXCompilerABI.cpp.obj
[2/2] Linking CXX executable cmTC_92086.exe
Can this package be build on Windows? If not, what is the best way to use this package on Ubuntu and run RobotStudio on Windows?
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 51 (21 by maintainers)
Commits related to this issue
- Add -DNOGDI to Windows build or RViz To avoid https://github.com/RoboStack/ros-noetic/pull/295#issuecomment-1281525978, see https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-1... — committed to traversaro/ros-noetic by traversaro 4 years ago
- Add -DNOGDI to Windows build or RViz (#296) To avoid https://github.com/RoboStack/ros-noetic/pull/295#issuecomment-1281525978, see https://github.com/ros-industrial/abb_robot_driver/issues/17#issueco... — committed to RoboStack/ros-noetic by traversaro 4 years ago
- Fresh builds (#295) * Update conda_forge_pinnings.yaml * Update pinnings * Bump build numbers * Build requested packages * Fixup * No need for opencv pinning anymore * Old ogre for ... — committed to RoboStack/ros-noetic by Tobias-Fischer 4 years ago
Thanks for that. The fix in https://github.com/ros-simulation/gazebo_ros_pkgs/pull/1023 seems like something which we could use here.
It isn’t a hack, clearly visible in the build script and there’s precedence for it in a package which sees a lot of usage.
A hold over from early DOS, ERROR, OK and several other common words were #defined. For source compatibility, these were brought into headers brought into windows.h. #define is not namespaced, so any user downstream will have these overwritten - and ultimately have a duplicate define or build break.
For most of ROS, we were able to resolve this, as ROS headers do include windows,h, but have an
#undef ERRORto work around the ROS versions of ERROR, including those in msg files.Internally to boost, the headers will include windows,h, which will redefine ERROR. In order to not pollute the code with Windows specific things, we typically reorder headers if that resolves the build break, otherwise add an additional #undef ERROR after boost headers.
I hope that helps explaining the root cause.
Thank you @traversaro, this fix the problem! It is necessary to modify also: https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_state_controller/CMakeLists.txt
Thanks to https://github.com/ros-controls/ros_control/pull/492 I found https://github.com/ros-controls/ros_control/pull/397, that seems to be related to this discussion.
Sorry for the previous post, for a moment I misunderstood and thought it is to build some windows stuff for the driver to work on Linux
I’d still throw in the idea of trying to avoid the offending header completely.
On Thu, 11 Mar 2021, 20:47 G.A. vd. Hoorn, @.***> wrote:
@bmagyar Keeping it building is quite easy - github actions can be added to build on Linux and Windows during CI. Check out https://aka.ms/ros for the docs.
Apparently something else brings in protobuf headers. Then the only alternative is to either generate the full header include tree to understand who is including it (by adding
/showIncludestoCMAKE_CXX_FLAGS, not sure how you do that via catkin), or just add a:before the problematic ros_control include, and:
after. However, this is not a great solution if some other part of the code use the
ERRORas defined byros_control.Quoting for the issue:
Our local modification transformed the RSI driver in a standalone library and switched to use cartesian interface instead of the joint one, so the first thing done was to remove any ros_control dependency.
@DyumanAditya: could you check whether https://github.com/ros-industrial/abb_robot_driver_interfaces/pull/9 solves your build issues?
Or at least this build issue?
Ok.
So first: I don’t think what you find in
CMakeError.logis related.I believe there is a problem with some of the characters in some of the
.msgfiles inabb_rapid_msgs. Linux and OSX are fine with this, but Windows is a bit stricter with the codepages and can’t decode the bytes to proper characters.These two
.msgs are suspicious:the links point to the specific lines which I believe contain the potentially “offending” characters.
Could you try to remove the
°fromRobTarget.msgfirst and see whether things build then.If they don’t, remove the
“fromExtJoint.msgand try again.