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

Conan recipe with the basic example doesn't work #620

Closed
sun-mir opened this issue Sep 11, 2024 · 3 comments
Closed

Conan recipe with the basic example doesn't work #620

sun-mir opened this issue Sep 11, 2024 · 3 comments

Comments

@sun-mir
Copy link

sun-mir commented Sep 11, 2024

Greetings 👋

My team is experimenting with the hpp-fcl and I'd like to help facilitate the build process with custom options for the dependency libraries... Hence - Conan package manager for C and C++ developers to the rescue!

The initial version of the Conan recipe is here: conan-io/conan-center-index#25219
After building the package successfully and checking it for the project, I encountered a problem that my internal library with dependency on the hpp-fcl has these compilation errors on #include statements:

/home/usr/src/proj/CollisionObject.hpp:6:10: fatal error: hpp/fcl/collision_object.h: No such file or directory
    6 | #include <hpp/fcl/collision_object.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

I also replicated the same problem by adding the Conan-style test for the recipe with the example from the hpp-fcl/README.md:

Error details
$ conan create conan-center-index/recipes/hpp-fcl/all/conanfile.py --version 2.4.4

...

hpp-fcl/2.4.4: Created package revision 1050ab6cb69c04bc31b6cb232baa91b2
hpp-fcl/2.4.4: Package 'f49dd144a8e4c3491e09c7ce69467537fd0d32b8' created
hpp-fcl/2.4.4: Full package reference: hpp-fcl/2.4.4#1ed99c6ee85aa8d11495b140860dfb35:f49dd144a8e4c3491e09c7ce69467537fd0d32b8#1050ab6cb69c04bc31b6cb232baa91b2
hpp-fcl/2.4.4: Package folder /root/.conan2/p/b/hpp-f2eaeb82160379/p

...

======== Launching test_package ========

...

======== Testing the package: Building ========
hpp-fcl/2.4.4 (test package): Calling build()
hpp-fcl/2.4.4 (test package): Running CMake.configure()
hpp-fcl/2.4.4 (test package): RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/conan-center-index/recipes/hpp-fcl/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/conan-center-index/recipes/hpp-fcl/all/test_package"
-- Using Conan toolchain: /conan-center-index/recipes/hpp-fcl/all/test_package/build/gcc-11-x86_64-gnu17-release/generators/conan_toolchain.cmake
-- Conan toolchain: C++ Standard 17 with extensions ON
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Target declared 'hpp-fcl::hpp-fcl'
-- Configuring done
-- Generating done
-- Build files have been written to: /conan-center-index/recipes/hpp-fcl/all/test_package/build/gcc-11-x86_64-gnu17-release

hpp-fcl/2.4.4 (test package): Running CMake.build()
hpp-fcl/2.4.4 (test package): RUN: cmake --build "/conan-center-index/recipes/hpp-fcl/all/test_package/build/gcc-11-x86_64-gnu17-release" -- -j8
[ 50%] Building CXX object CMakeFiles/test_package.dir/test_package.cpp.o
/conan-center-index/recipes/hpp-fcl/all/test_package/test_package.cpp:1:10: fatal error: hpp/fcl/math/transform.h: No such file or directory
    1 | #include "hpp/fcl/math/transform.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/test_package.dir/build.make:76: CMakeFiles/test_package.dir/test_package.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/test_package.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

ERROR: hpp-fcl/2.4.4 (test package): Error in build() method, line 21
        cmake.build()
        ConanException: Error 2 while executing
Build environment: Dockerfile
FROM ubuntu:22.04

RUN apt-get -qq update \
    && apt-get -qq install -y --no-install-recommends --no-install-suggests -o=Dpkg::Use-Pty=0 \
       g++-multilib \
       gcc-11 \
       g++-11 \
       make \
       cmake \
       build-essential \
       clang-format \
       autoconf-archive \
       binutils \
       pkg-config \
       curl \
       wget \
       ca-certificates \
       git

RUN wget https://github.com/conan-io/conan/releases/download/2.7.0/conan-2.7.0-amd64.deb -O /tmp/conan-2.7.0-amd64.deb \
    && dpkg -i /tmp/conan-2.7.0-amd64.deb

RUN  rm -rf /var/cache/apt/* \
    && rm -rf /tmp/*


It's not my 1st custom Conan recipe, and others seem to be working fine...
So I suspect that something could be missing in the hpp-fcl/CMakeLists.txt to make the hpp-fcl recipe working with standard instructions. There's a way to patch the library's source code from the Conan recipe side (for example: octomap), but my lack of CMake and C/C++ knowledge is rather annoying 😬

I'd greatly appreciate your ideas on what I might be missing
🙏

@jcarpent
Copy link
Member

I'm not an expert at all of conan, but does conan install the library or just build it?

@sun-mir
Copy link
Author

sun-mir commented Sep 11, 2024

... does conan install the library or just build it?

@jcarpent, it can do many things!
The CLI supports distinct commands to build, test, and install the package. For example, after installing the CLI, you can try downloading one of the recipe's dependencies from Conan.io into a folder:

conan install --requires assimp/5.4.1 --build=missing --output-folder test-me

Depending on your system profile (combination of OS, architecture, compiler, etc), Conan will download corresponding existing packages (assimp + its dependencies) and/or build from the recipe the packages that are missing for your environment.


While developing a new recipe, - the workflow usually involves conan create ... which builds and tests the package. The latter part installs it. You can see the CI pipeline output from the PR in the description here:
https://c3i.jfrog.io/c3i/misc-v2/summary.html?json=https://c3i.jfrog.io/c3i/misc-v2/logs/pr/25219/1-linux-gcc/hpp-fcl/2.4.4//summary.json

The last 2 columns on the right have links to the stdout, here's the direct link to the test part, that installs the package and attempts to execute the code snippet from the example in hpp-fcl/README.md:
https://c3i.jfrog.io/c3i/misc-v2/logs/pr/25219/1-linux-gcc/hpp-fcl/2.4.4//253d61a3cb59e5b2f932c72a3063465e23c4d088-test.txt

@nim65s
Copy link
Contributor

nim65s commented Sep 11, 2024

Hi,

This is a conan issue, not a hpp-fcl issue.
So I'm closing this to continue discussion on conan-io/conan-center-index#25219 instead.

@nim65s nim65s closed this as completed Sep 11, 2024
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