conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
957 stars 1.75k forks source link

[package] glu/system: "Package opengl was not found in the pkg-config search path" on Ubuntu #17131

Open SpaceIm opened 1 year ago

SpaceIm commented 1 year ago

Description

On WSL2 Ubuntu 22.04, glu/system fails in package_info() while calling pkg_config.fill_cpp_info.

It can't find pc file of its dependency: opengl.pc. And indeed this file is missing in /usr/lib/x86_64-linux-gnu/pkgconfig unless I install libopengl-dev with apt. Here is the problem:

There is an issue here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009731

But I think that libopengl-dev should be added to apt in opengl recipe. libgl-dev is the legacy package actually:

$ more /usr/lib/x86_64-linux-gnu/pkgconfig/gl.pc
prefix=/usr
libdir=${prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include

Name: GL
Description: Legacy OpenGL and GLX library and headers.
Version: 1.2
Libs: -L${libdir} -lGL
Cflags: -I${includedir}
$ more /usr/lib/x86_64-linux-gnu/pkgconfig/opengl.pc
prefix=/usr
libdir=${prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include

Name: OpenGL
Description: OpenGL (without GLX) library and headers.
Version: 4.5
Libs: -L${libdir} -lOpenGL
Cflags: -I${includedir}

Package and Environment Details

Conan profile

{% set cc = "/usr/bin/gcc-12" %}
{% set cxx = "/usr/bin/g++-12" %}

[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=12
compiler.libcxx=libstdc++11
build_type=Release
[options]
[tool_requires]
[conf]
tools.build:compiler_executables={"c": "{{ cc }}", "cpp": "{{ cxx }}"}
[buildenv]
CMAKE_EXPORT_COMPILE_COMMANDS=ON
CC={{ cc }}
CXX={{ cxx }}

Steps to reproduce

conan install --requires=glu/system

Logs

Click to expand log ``` ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++11 compiler.version=12 os=Linux [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.info.package_id:confs=['tools.build:cflags', 'tools.build:cxxflags', 'tools.build:defines', 'tools.build:exelinkflags', 'tools.build:sharedlinkflags'] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True tools.system.package_manager:tool=apt-get tools.build:compiler_executables={'c': '/usr/bin/gcc-12', 'cpp': '/usr/bin/g++-12'} [buildenv] CMAKE_EXPORT_COMPILE_COMMANDS=ON CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++11 compiler.version=12 os=Linux [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.info.package_id:confs=['tools.build:cflags', 'tools.build:cxxflags', 'tools.build:defines', 'tools.build:exelinkflags', 'tools.build:sharedlinkflags'] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True tools.system.package_manager:tool=apt-get tools.build:compiler_executables={'c': '/usr/bin/gcc-12', 'cpp': '/usr/bin/g++-12'} [buildenv] CMAKE_EXPORT_COMPILE_COMMANDS=ON CC=/usr/bin/gcc-12 CXX=/usr/bin/g++-12 ======== Computing dependency graph ======== Graph root cli Requirements glu/system#ee50fc2ade0e1c0c8ebb3be3ea60e0f5 - Cache opengl/system#b29589c04d6df84c110d6acb066ab653 - Cache ======== Computing necessary packages ======== Requirements glu/system#ee50fc2ade0e1c0c8ebb3be3ea60e0f5:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache opengl/system#b29589c04d6df84c110d6acb066ab653:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache opengl/system: RUN: dpkg-query -W -f='${Status}' libgl-dev | grep -q "ok installed" opengl/system: System requirements: already installed glu/system: RUN: dpkg-query -W -f='${Status}' libglu1-mesa-dev | grep -q "ok installed" glu/system: System requirements: already installed ======== Installing packages ======== opengl/system: Already installed! (1 of 2) glu/system: Already installed! (2 of 2) ERROR: glu/system: Error in package_info() method, line 59 pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") ConanException: Command 'pkg-config --cflags-only-other glu --print-errors' failed with errorcode '1' b"Package opengl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `opengl.pc'\nto the PKG_CONFIG_PATH environment variable\nPackage 'opengl', required by 'glu', not found\n" ```
irieger commented 7 months ago

As I spent some hours debugging the same build problem yesterday/today, I'd really like to see that fixed in some way, at least having a proper warning.