RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.74k stars 160 forks source link

FindTBB.cmake no longer finds tbb v2021.1.1 #94

Closed Mic92 closed 3 years ago

Mic92 commented 3 years ago

It tries to parse the header tbb/version.h:

$ cmake 
-- Looking for TBB components tbb;tbbmalloc; ()
CMake Error at cmake/FindTBB.cmake:80 (message):
  Requested minimum TBB version 2017.0,; but found .
Call Stack (most recent call first):
  cmake/FindTBB.cmake:178 (rk_tbb_error)
  cmake/FindTBB.cmake:468 (rk_tbb_check_version)
  CMakeLists.txt:77 (find_package)

and applies a regex on it. However this file only contains an include now

$ cat tbb/version.h
/*
    Copyright (c) 2005-2020 Intel Corporation

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

#include "../oneapi/tbb/version.h"

When installed with cmake it however also contains a couple of cmake files that could be imported instead:

/nix/store/7favnqcnyys88bxgxmdw86mpf9j1dxqs-tbb-2021.1.1/lib/cmake/TBB
/nix/store/7favnqcnyys88bxgxmdw86mpf9j1dxqs-tbb-2021.1.1/lib/cmake/TBB/TBBConfigVersion.cmake
/nix/store/7favnqcnyys88bxgxmdw86mpf9j1dxqs-tbb-2021.1.1/lib/cmake/TBB/TBBTargets.cmake
/nix/store/7favnqcnyys88bxgxmdw86mpf9j1dxqs-tbb-2021.1.1/lib/cmake/TBB/TBBTargets-release.cmake
/nix/store/7favnqcnyys88bxgxmdw86mpf9j1dxqs-tbb-2021.1.1/lib/cmake/TBB/TBBConfig.cmake
atafra commented 3 years ago

Thanks for the bug report! This will be fixed in the next release. Unfortunately this version of TBB breaks backward compatibility.

Mic92 commented 3 years ago

Are you sure the last change ended up in the release? https://github.com/OpenImageDenoise/oidn/blob/master/cmake/FindTBB.cmake

After the fix I applied it compiles again.

atafra commented 3 years ago

TBB broke compatibility again after that change you mentioned. The current version of TBB was released after that fix.

atafra commented 3 years ago

However, I just noticed that this has been already fixed in the devel branch. Anyway, thanks for the fix!

atafra commented 3 years ago

The fix in devel: https://github.com/OpenImageDenoise/oidn/commit/2651f56ea60cc72c533fcd090679200899c2f54f