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

Loading error in macOS on GitHub Actions #11

Closed
traversaro opened this issue Nov 18, 2020 · 13 comments
Closed

Loading error in macOS on GitHub Actions #11

traversaro opened this issue Nov 18, 2020 · 13 comments

Comments

@traversaro
Copy link
Contributor

I am using this recipe in a CI system, and the running of a simple program is failing in macOS with the following error:

2020-11-18T11:51:34.3357760Z [374/1056] Linking CXX executable bin/yarpidl_rosmsg
2020-11-18T11:51:34.3358720Z [375/1056] Generating code from ../../../extern/ros/geometry2/tf2_msgs/msg/TF2Error.msg
2020-11-18T11:51:34.3359650Z FAILED: src/libYARP_rosmsg/src/yarp/rosmsg/tf2_msgs/TF2Error.h src/libYARP_rosmsg/src/tf2_msgs/TF2Error.h src/libYARP_rosmsg/src/tf2_msgs_TF2Error.h 
2020-11-18T11:51:34.3364520Z cd /Users/runner/work/robotology-superbuild/robotology-superbuild/robotology/YARP/src/libYARP_rosmsg/src && /Users/runner/work/robotology-superbuild/robotology-superbuild/build/robotology/YARP/bin/yarpidl_rosmsg --no-index --no-ros true --no-cache --out /Users/runner/work/robotology-superbuild/robotology-superbuild/build/robotology/YARP/src/libYARP_rosmsg/src ../../../extern/ros/geometry2/tf2_msgs/msg/TF2Error.msg
2020-11-18T11:51:34.3367390Z dyld: Library not loaded: @rpath/64/libACE.dylib
2020-11-18T11:51:34.3368890Z   Referenced from: /Users/runner/work/robotology-superbuild/robotology-superbuild/build/robotology/YARP/bin/yarpidl_rosmsg
2020-11-18T11:51:34.3370150Z   Reason: image not found
2020-11-18T11:51:34.3373010Z /bin/sh: line 1: 17584 Abort trap: 6           /Users/runner/work/robotology-superbuild/robotology-superbuild/build/robotology/YARP/bin/yarpidl_rosmsg --no-index --no-ros true --no-cache --out /Users/runner/work/robotology-superbuild/robotology-superbuild/build/robotology/YARP/src/libYARP_rosmsg/src ../../../extern/ros/geometry2/tf2_msgs/msg/TF2Error.msg

Environment (conda list):
See https://github.com/robotology/robotology-superbuild/pull/513

Details about conda and system ( conda info ):
See https://github.com/robotology/robotology-superbuild/pull/513

I wondering if there is some rpath error. The same program runs fine on Linux. A possible strategy is to add a simple step in the recipe that compiles and run a program that uses ACE, as done for example in https://github.com/conda-forge/ipopt-feedstock/blob/master/recipe/run_test.sh .

@wolfv
Copy link
Member

wolfv commented Nov 18, 2020

yes this sounds like an RPATH issue ... https://cmake.org/cmake/help/v3.0/prop_tgt/MACOSX_RPATH.html

@wolfv
Copy link
Member

wolfv commented Nov 18, 2020

right, sorry, this didn't use cmake 🤦

@jwillemsen
Copy link
Contributor

@jwillemsen
Copy link
Contributor

Looks we detect the macosx version, which version does your CI use, maybe the rpath support in ACE could move to an older version

@traversaro
Copy link
Contributor Author

traversaro commented Nov 18, 2020

One thing that I am probably missing: in conda/conda-forge all the shared libraries get installed in a single directory <prefix>/lib, so we don't want to have rpath enabled at all, am I right?

@wolfv
Copy link
Member

wolfv commented Nov 18, 2020

conda-build and conda relocate binaries: that's why the install prefix is so super-long because it gets replaced by the install prefix when running conda install.

So if you have an absolute rpath to the install prefix, conda-build will detect that and conda will replace it with the final prefix when installing. That way libraries and all are relocatable.

Does this explanation make sense? :) I can retry tomorrow morning.

@traversaro
Copy link
Contributor Author

Yes, totally, so if rpath is enable or not if should not make a difference. However, from the error it is not clear how the rpath is set, but it seems that it would be expect the libACE.dylib library to be part of a directory called /64, that is definitely not the case.

@wolfv
Copy link
Member

wolfv commented Nov 18, 2020

Yeah it probably uses the rpath where it builds, but not where it installs :/

@traversaro
Copy link
Contributor Author

I reproduced the same error with a small test as part of the build of the recipe itself in #12 :

dyld: Library not loaded: @rpath/64/libACE.dylib
  Referenced from: /Users/runner/miniforge3/conda-bld/ace_1605999465756/test_tmp/./ace_example
  Reason: image not found
/Users/runner/miniforge3/conda-bld/ace_1605999465756/test_tmp/run_test.sh: line 11:  5728 Abort trap: 6           ./ace_example
Tests failed for ace-6.5.12-h2e338ed_0.tar.bz2 - moving package to /Users/runner/miniforge3/conda-bld/broken

@traversaro
Copy link
Contributor Author

The problem was discussed in #12 (comment) and will be fixed by #12 .

@wolfv wolfv closed this as completed Nov 23, 2020
@wolfv
Copy link
Member

wolfv commented Nov 23, 2020

Fixed?

@traversaro
Copy link
Contributor Author

Yes, the build at robotology/robotology-superbuild#513 are also now working correctly, thanks!

@wolfv
Copy link
Member

wolfv commented Nov 23, 2020

awesome!

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

No branches or pull requests

3 participants