AcademySoftwareFoundation / openvdb

OpenVDB - Sparse volume data structure and tools
http://www.openvdb.org/
Apache License 2.0
2.75k stars 665 forks source link

Could NOT find TBB (missing: Tbb_LIB_COMPONENTS tbb) (found suitable version "2019.9", minimum required is "4.4") #549

Closed malaterre closed 4 years ago

malaterre commented 5 years ago

I am struggling to compile openvdb on non-amd64 Debian system. Here is a possible local patch for i386 Debian system:

Local patch:

diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
index bdf9c81e132e..6286319d184e 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -216,6 +216,7 @@ set(TBB_PATH_SUFFIXES

 if(UNIX)
   list(INSERT TBB_PATH_SUFFIXES 0 lib/x86_64-linux-gnu)
+  list(INSERT TBB_PATH_SUFFIXES 0 lib/i386-linux-gnu)
 endif()

 if(APPLE)

Is there a way to make it portable (eg. ppc64el, mips64el, ... ).

Ref:

malaterre commented 5 years ago

@mfvescovi I cannot upgrade openvdb package for now.

malaterre commented 5 years ago

FYI:

Idclip commented 5 years ago

Hi @malaterre,

Thanks for reporting, we can definitely look at making this more portable. dpkg-architecture will only work for debian distros but calling something like uname might work - though I'm not too familiar with all the possible permutations of tbb's installation directories.

Have you also tried using the TBB_LIBRARYDIR variable to manually point our CMake to the location of your tbb lib? Or was this more a request for portability in general?

Cheers

danrbailey commented 5 years ago

@Idclip - if we accept https://github.com/AcademySoftwareFoundation/openvdb/pull/498, I think we can just use LIBDIR (https://github.com/Kitware/CMake/blob/master/Modules/GNUInstallDirs.cmake#L50)? (note that I just approved that PR).

We'll need to make this change for the find modules for Jemalloc, IlmBase and OpenEXR as well where we do the same hard-coding.

Failing that, I don't mind adding the i386 path as well or using CMAKE_SIZEOF_VOID_P to choose which one to add.

malaterre commented 5 years ago

@ldclip I did not realize there was a trick to hint cmake for the location of that library. Currently here is the debian/rules I am using:

I'll check if there is something to do that is "smarter".

the previous debian package for openvdb was using the Makefile system which seem a bit more natural (or at least more flexible) for me. I'll continue digging into openvdb/cmake for possible simplification. thanks for your time.

malaterre commented 5 years ago

@danrbailey

Failing that, I don't mind adding the i386 path as well or using CMAKE_SIZEOF_VOID_P to choose which one to add.

Pay attention that the size of pointer may not be enough information as Debian support quite some "exotic" system:

danrbailey commented 4 years ago

I've opened #611 which I believe will address this issue. I'll close this for now, but we can re-open if not.