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
CMake fails to find debug TBB libraries on Windows. #38
Comments
I can't reproduce this issue, the build succeeds. Could you please share the exact error message, compiler, CMake, and TBB versions? |
My apologies, I didn't expect you'd try to reproduce it: CMake version: 3.14.3 The key difference here is that I'm building OIDN against TBB that comes with a binary build of Pixar's USD -- it doesn't follow the same layout as the binary release of TBB, it simply puts the .dll in the
And here's an example of changes I've made to make it work on my machine: diff --git a/TBB.cmake b/TBB.cmake
index c3be583..0327964 100644
--- a/TBB.cmake
+++ b/TBB.cmake
@@ -82,7 +82,18 @@ if(WIN32)
set(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
set(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
- find_path(TBB_BIN_DIR tbb.dll
+
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(TBB_DLL_NAME tbb_debug.dll)
+ set(TBB_NAME tbb_debug)
+ set(TBB_MALLOC_NAME tbbmalloc_debug)
+ else()
+ set(TBB_DLL_NAME tbb.dll)
+ set(TBB_NAME tbb)
+ set(TBB_MALLOC_NAME tbbmalloc)
+ endif()
+
+ find_path(TBB_BIN_DIR ${TBB_DLL_NAME}
HINTS
${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}
${TBB_ROOT}/bin
@@ -91,8 +102,8 @@ if(WIN32)
NO_DEFAULT_PATH
)
set(TBB_LIB_DIR ${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
- find_library(TBB_LIBRARY tbb PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY ${TBB_NAME} PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY_MALLOC ${TBB_MALLOC_NAME} PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
endif()
else() If I use the binary release package (or use vcpkg + cmake toolchain file) it all works perfectly. |
This is how we fixed the issue on NixOS Linux: NixOS/nixpkgs#216844 |
I hit this when trying to build a debug version of OIDN on Windows: debug versions of TBB use the
_debug
suffix, which seemingly confuses the TBB.cmake script in your fork of MKL-DNN.The text was updated successfully, but these errors were encountered: