Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failing against YARP devel and master #56

Closed
lrapetti opened this issue Oct 9, 2019 · 24 comments · Fixed by #65
Closed

Compilation failing against YARP devel and master #56

lrapetti opened this issue Oct 9, 2019 · 24 comments · Fixed by #65
Assignees
Milestone

Comments

@lrapetti
Copy link
Member

lrapetti commented Oct 9, 2019

See https://travis-ci.org/robotology/wearables/builds/595555081?utm_medium=notification&utm_source=email. The Travis CI seems to be broken on MacOS, probably after some update in YARP.

@traversaro
Copy link
Member

traversaro commented Oct 23, 2019

I guess this is related to robotology/yarp#2044 , even if I am not sure why it fails only in some specific case.

@traversaro traversaro changed the title CI failing on MacOS CI failing on MacOS and on robotology-superbuild unstable branches Oct 23, 2019
@traversaro
Copy link
Member

traversaro commented Oct 23, 2019

Other possibly related issues: robotology/yarp#2110 .

@traversaro
Copy link
Member

traversaro commented Oct 23, 2019

Actually I think that the regression was introduced by robotology/yarp#2102 , and the reason why it is not failing in Travis/Linux is that Linux is using an old version of YARP due to the docker caching.

@traversaro traversaro changed the title CI failing on MacOS and on robotology-superbuild unstable branches Compilation failing against YARP devel Oct 23, 2019
@lrapetti
Copy link
Member Author

As an initial step I am restoring the CI to the standard deps branches (#58) so that the CI for the master should be fixed. I will then investigate further the compatibility with YARP devel.

@lrapetti
Copy link
Member Author

Actually I think that the regression was introduced by robotology/yarp#2102 , and the reason why it is not failing in Travis/Linux is that Linux is using an old version of YARP due to the docker caching.

I confirm the regression in introduced by this commit

@traversaro
Copy link
Member

As the upstream issue is not really progressing, I would strongly suggest to have some sort of local workaround that fixes the build for the time being, for example by modifying the include to be include "WearableData.h", and modify the CMake script in

list(APPEND WEARABLEDATA_INCLUDE_DIRS ${parent_dir_path})
to have in WEARABLEDATA_INCLUDE_DIRS the necessary directories to be compatible both with YARP 3.2 and the future YARP 3.3 .

@lrapetti
Copy link
Member Author

lrapetti commented Nov 7, 2019

I would strongly suggest to have some sort of local workaround that fixes the build for the time being, for example by modifying the include to be include "WearableData.h"

I tried this fix, the problem is that the same problem is raised for the include of the generated WearableData.h:

/Users/lorenzorapetti/Software/robotology-superbuild/build/robotology/wearables/msgs/thrift/wearable/msg/WearableData.h:19:10: fatal error: 
      'thrift/wearable/msg/Accelerometer.h' file not found
#include <thrift/wearable/msg/Accelerometer.h>

In fact in its header it includes all the other thrift messages:

#include <thrift/wearable/msg/FreeBodyAccelerationSensor.h>
#include <thrift/wearable/msg/Gyroscope.h>
#include <thrift/wearable/msg/Magnetometer.h>
#include <thrift/wearable/msg/OrientationSensor.h>
#include <thrift/wearable/msg/PoseSensor.h>
#include <thrift/wearable/msg/PositionSensor.h>
#include <thrift/wearable/msg/SkinSensor.h>
#include <thrift/wearable/msg/TemperatureSensor.h>
#include <thrift/wearable/msg/Torque3DSensor.h>
#include <thrift/wearable/msg/VirtualJointKinSensor.h>
#include <thrift/wearable/msg/VirtualLinkKinSensor.h>
#include <thrift/wearable/msg/VirtualSphericalJointKinSensor.h>

and modify the CMake script in

list(APPEND WEARABLEDATA_INCLUDE_DIRS ${parent_dir_path})

to have in WEARABLEDATA_INCLUDE_DIRS the necessary directories to be compatible both with YARP 3.2 and the future YARP 3.3 .

Here to you mean for example to add also the parent directory of the thrift directory?

@traversaro
Copy link
Member

traversaro commented Nov 7, 2019

Here to you mean for example to add also the parent directory of the thrift directory?

Exactly. Just to understand, with YARP 3.3 , the include headers contain the thrift directory, but then the generated file is not in the thrift directory? This is even worse, for better visibility I suggest to open a new YARP issue instead of just commenting an old closed PR.

An alternative for the problem may be to move the *.thrift files outside of the thrift directory, perhaps that will work with both YARP 3.2 and 3.3 .

@lrapetti
Copy link
Member Author

for better visibility I suggest to open a new YARP issue instead of just commenting an old closed PR.

new PR opened at robotology/yarp#2118.

@lrapetti
Copy link
Member Author

Exactly. Just to understand, with YARP 3.3 , the include headers contain the thrift directory, but then the generated file is not in the thrift directory?

No, what happen is that all the generated files (e.g. Accelerometer.cpp, Accelerometer.h, WearableData.h, WearableData.cpp) are in the same folder build/robotology/wearable/msgs/thrift/wearable/msg, but still the WearableData.h cannot find the headers of the other generated messages with the error message above:

/Users/lorenzorapetti/Software/robotology-superbuild/build/robotology/wearables/msgs/thrift/wearable/msg/WearableData.h:19:10: fatal error: 
      'thrift/wearable/msg/Accelerometer.h' file not found
#include <thrift/wearable/msg/Accelerometer.h>

An alternative for the problem may be to move the *.thrift files outside of the thrift directory, perhaps that will work with both YARP 3.2 and 3.3 .

Same happen in this situation, and what change is just that the folder in which they are is: build/robotology/wearable/msgs/wearable/msg, and I am getting the error:

In file included from /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/src/IWearRemapper.cpp:12:
/Users/lorenzorapetti/Software/robotology-superbuild/build/robotology/wearables/msgs/wearable/msg/WearableData.h:19:10: fatal error: 'wearable/msg/Accelerometer.h' file not found
#include <wearable/msg/Accelerometer.h>

@traversaro
Copy link
Member

Can't you just pass build/robotology/wearable/msgs as additonal include directory?

@traversaro
Copy link
Member

Or any directory that is necessary to make sure that everything is correctly included.

@lrapetti
Copy link
Member Author

I am trying to fix the compilation with YARP devel:

  • the first step was to remove the thrift/ scoping so that we avoid the problem of differeces between master and devel. This was achieved with lrapetti@d89d6ea that was tested comipiling in master. I can see in case of using master all the generated .h messages have the include without any scoping . In case of using YARP devel however, all of them are generated using wearable/msg/ scoping, and indeed the following error is raised:
    In file included from /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/wrappers/IWear/src/IWearWrapper.cpp:11:
    /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/wearable/msg/WearableData.h:19:10: fatal error: 'wearable/msg/Accelerometer.h' file not found
    #include <wearable/msg/Accelerometer.h>
    
  • to avoid that error I tried to add the path to the include directory, as @traversaro suggested, adding list(APPEND WEARABLEDATA_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/msgs/thrift/wearable/msg) in lrapetti@a868e32, and it was able to compile all the messages in YARP devel. However, it results in the following error:
    /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/src/IWearRemapper.cpp:12:10: fatal error: 'WearableData.h' file not found
    #include "WearableData.h"
    
    and the same error results when trying to compile with YARP master.

@traversaro
Copy link
Member

Can't we append the directory of the generation of the WearableData.h file in the include directories as well, or change the #include "WearableData.h" line to have a path compatible with the used include dirs (for example by copying from whatever stile is used in the generated WearableData.cpp?).

@lrapetti
Copy link
Member Author

lrapetti commented Nov 12, 2019

Can't we append the directory of the generation of the WearableData.h file in the include directories as well

I tried also this, but then it was failing to find IWearRemapper.h from the generated yarp_plugin_iwear_remapper.cpp. However I will double check.

or change the #include "WearableData.h" line to have a path compatible with the used include dirs (for example by copying from whatever stile is used in the generated WearableData.cpp?).

The problem is that this path would be different using YARP master or devel

@traversaro
Copy link
Member

I tried also this, but then it was failing to find IWearRemapper.h from the generated yarp_plugin_iwear_remapper.cpp. However I will double check.

This seems to be a different problem.

The problem is that this path would be different using YARP master or devel

Ack, then it is not ideal, but if this is the only viable option you can also have an #ifdef from a definition that you can pass from CMake using target_compile_definitions depending on the YARP version.

@lrapetti
Copy link
Member Author

Can't we append the directory of the generation of the WearableData.h file in the include directories as well

Anyway, I am not understating why I have this problem also in YARP master after adding the path for including the generated messages (i.e. after lrapetti@a868e32), while previously to that commit It is compiling without any error in master.

@traversaro
Copy link
Member

Can't we append the directory of the generation of the WearableData.h file in the include directories as well

Anyway, I am not understating why I have this problem also in YARP master after adding the path for including the generated messages (i.e. after lrapetti@a868e32), while previously to that commit It is compiling without any error in master.

I am not really sure, probably inspecting directly the command line parameters passed to the compiler for the compilation unit that is failing (for make via VERBOSE=1 make) may provide useful information.

@traversaro
Copy link
Member

@lrapetti let me know if you need any f2f help.

@lrapetti
Copy link
Member Author

lrapetti commented Nov 12, 2019

Using verbose I notice something strange, in fact there is a path that is repeated twice: -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/msgs/thrift/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/include. The complete output is:

[ 75%] Building CXX object devices/IWearRemapper/CMakeFiles/IWearRemapper.dir/src/IWearRemapper.cpp.o
cd /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/devices/IWearRemapper && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DIWearRemapper_EXPORTS -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/include -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/interfaces/IWear/include -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/msgs/thrift/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/include -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/msgs/thrift/wearable/msg -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/impl/SensorsImpl/include -isystem /Users/lorenzorapetti/Software/robotology-superbuild/build/install/include  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fPIC   -std=gnu++14 -o CMakeFiles/IWearRemapper.dir/src/IWearRemapper.cpp.o -c /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/src/IWearRemapper.cpp
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/src/IWearRemapper.cpp:12:10: fatal error: 
      'WearableData.h' file not found
#include "WearableData.h"

While before that commit there is not that wrong path, while there is the correct included path -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/include:

[ 75%] Building CXX object devices/IWearRemapper/CMakeFiles/IWearRemapper.dir/src/IWearRemapper.cpp.o
cd /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/devices/IWearRemapper && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DIWearRemapper_EXPORTS -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/include -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/interfaces/IWear/include -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/include -I/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/impl/SensorsImpl/include -isystem /Users/lorenzorapetti/Software/robotology-superbuild/build/install/include  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fPIC   -std=gnu++14 -o CMakeFiles/IWearRemapper.dir/src/IWearRemapper.cpp.o -c /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/devices/IWearRemapper/src/IWearRemapper.cpp

so probably that strange path is due to te command list(APPEND WEARABLEDATA_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/msgs/thrift/wearable/msg)?

@traversaro
Copy link
Member

This is interesting, can you print WEARABLEDATA_INCLUDE_DIRS before and after the list(APPEND ..).

@lrapetti
Copy link
Member Author

This is interesting, can you print WEARABLEDATA_INCLUDE_DIRS before and after the list(APPEND ..).

WEARABLEDATA_INCLUDE_DIRS= /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/include
WEARABLEDATA_INCLUDE_DIRS= /Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/include;/Users/lorenzorapetti/Software/robotology-superbuild/robotology/wearables/build/msgs/thrift/msgs/thrift/wearable/msg

@traversaro
Copy link
Member

Apparently there has been another regression related to this, see robotology/yarp#2118 (comment) .

@lrapetti lrapetti reopened this Dec 5, 2019
@lrapetti lrapetti changed the title Compilation failing against YARP devel Compilation failing against YARP devel and master Dec 16, 2019
@lrapetti
Copy link
Member Author

With #71 the new regression should be addressed. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants