magic_enum icon indicating copy to clipboard operation
magic_enum copied to clipboard

The binary installation and source code installation paths are different

Open Plumezz opened this issue 7 months ago • 4 comments

Hello,

When I built package libhri, it needs the magic_enum package. So I built and installed the package from source.

For the face.cpp of libhri package, it includes magic_enum by this way #include "magic_enum.hpp".

But it built faild with follow error:

/home/qiguanxiao/ws/ws_libhri/hri/src/hri/face.cpp:27:10: fatal error: magic_enum.hpp: No such file or directory
   27 | #include "magic_enum.hpp"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/hri.dir/build.make:90: CMakeFiles/hri.dir/src/hri/face.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/hri.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< hri [17.3s, exited with code 2]

I found that the source installation paths is ws/install/magic_enum/include/magic_enum/magic_enum.hpp. So I replaced #include "magic_enum.hpp" with #include "magic_enum/magic_enum.hpp" in face.cpp. Finally it can be built correctly.

Then I used sudo apt install ros-humble-magic-enum to install the binary packge. I found that the install path is /opt/ros/humble/include/magic_enum.hpp. It does not have the prefix module. So the way #include "magic_enum.hpp" is correct. But for other packages that I used apt to install, their install path are "/opt/ros/humble/include/package/file.hpp".

So I wonder to know if I went wrong or the project itself does have problems.

Thanks!

Plumezz avatar Jul 29 '25 02:07 Plumezz

since 0.9.7 it uses "magic_enum/HEADER" instead of "HEADER" directly

ZXShady avatar Aug 11 '25 17:08 ZXShady

Ok, I got it. Thanks! But I noticed that the binary package is still v0.8.1 from http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-galactic-magic-enum/. So the binary install path might be not match with the latest source install path. Could you tell me if it is necessary to update the release binary package? Thanks!

Plumezz avatar Aug 14 '25 12:08 Plumezz

Ok, I got it. Thanks! But I noticed that the binary package is still v0.8.1 from http://packages.ros.org/ros2/ubuntu/pool/main/r/ros-galactic-magic-enum/. So the binary install path might be not match with the latest source install path. Could you tell me if it is necessary to update the release binary package? Thanks!

the website doesn't open for me, so I can't really tell. but magic enum is header only so pulling directly from github would be an easy alternative.

ZXShady avatar Aug 19 '25 05:08 ZXShady

I am not familiar with the ROS2 build process and do not maintain it, so my understanding of this issue is limited. The website also does not open for me. Are there any other problems you’re experiencing?

Neargye avatar Nov 21 '25 14:11 Neargye