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

Pinning specific Embree version, while using TBB, causes CMake Error #38770

Open
crgnam opened this issue May 16, 2024 · 1 comment
Open

Pinning specific Embree version, while using TBB, causes CMake Error #38770

crgnam opened this issue May 16, 2024 · 1 comment
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@crgnam
Copy link

crgnam commented May 16, 2024

Bug Description:

When attempting to use Embree 3.13.5 with TBB, CMake throws the following error:

CMake Error at /home/crgnam/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
  _find_package called with invalid argument "tbb"
Call Stack (most recent call first):
  /usr/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  build/vcpkg_installed/x64-linux/share/embree/embree-config.cmake:54 (find_dependency)
  /home/crgnam/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
  CMakeLists.txt:6 (find_package)

This only occurs when I use an override to explicitly set "version": "3.13.5". But this is the most recent version of embree available via vcpkg so I am confused how (currently) setting the override to 3.13.5 would be any different than setting a minimum of 3.13.5. (My rationale for doing this is to simply avoid any breaking changes to the embree API in the future)

Environment

  • OS: Windows 10 and Ubuntu 20.04
  • Compiler: Visual Studio 2019

To Reproduce
I've put together a minimal working example to use with Ubuntu 20.04

File structure:

project/
    | - build/
    | - CMakeLists.txt
    | - main.cpp
    | - vcpkg.json

vcpkg.json:

{
  "name": "example",
  "version-string": "1.0",
  "dependencies": [
    "tbb",
    {
      "name": "embree3",
      "version>=": "3.13.5"
    }
  ],
  "overrides": [
    {
        "name": "embree3",
        "version": "3.13.5"
    }
  ],
  "builtin-baseline": "352c108a6b6d698c09a8272d8e95fdce550ae408"
}

CMakeLists.txt:

cmake_minimum_required (VERSION 3.8)
project(Example LANGUAGES CXX VERSION 1.0)
set(CXX_STANDARD 17)

find_package(TBB CONFIG REQUIRED)
find_package(embree 3 CONFIG REQUIRED)

add_executable(example main.cpp)
target_link_libraries(example embree TBB:tbb TBB::tbbmalloc)

main.cpp:

int main() {
    return 0;
};

Then from the build/ directory, run:

cmake ../ -DCMAKE_TOOLCHAIN_FILE=<path/to/vcpkg>/scripts/buildsystems/vcpkg.cmake

Expected behavior
I expect the CMake configuration to complete without issue, as I can use TBB and embree independently without a problem.

Failure logs

CMake Error at /home/crgnam/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
  _find_package called with invalid argument "tbb"
Call Stack (most recent call first):
  /usr/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  build/vcpkg_installed/x64-linux/share/embree/embree-config.cmake:54 (find_dependency)
  /home/crgnam/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
  CMakeLists.txt:6 (find_package)

Additional context
If I remove the explicit version pinning by removing the override (that is, changing my vcpkg.json to the following)

{
  "name": "example",
  "version-string": "1.0",
  "dependencies": [
    "tbb",
    {
      "name": "embree3",
      "version>=": "3.13.5"
    }
  ],
  "builtin-baseline": "352c108a6b6d698c09a8272d8e95fdce550ae408"
}

The CMake configuration completes without issue, and everything works as expected.

@jimwang118 jimwang118 added the category:port-bug The issue is with a library, which is something the port should already support label May 17, 2024
@jimwang118
Copy link
Contributor

I reproduced the issue locally and will try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

2 participants