Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

Cannot build tiny-dnn on platform , missing tbb.h

0 votes

Trying to build for platform but tiny-dnn cannot build because it is missing tbb.h


#ifdef CNN_USE_TBB
#ifndef NOMINMAX
#define NOMINMAX  // tbb includes windows.h in tbb/machine/windows_api.h
#include <tbb/task_group.h>
#include <tbb/tbb.h>


Looking at the source , it is not there either:


asked Apr 14 in Programmer Questions by patrickpoirier (360 points)
edited Apr 14 by patrickpoirier

1 Answer

0 votes
Are you trying to build your own version, using the latest tiny-dnn code from GitHub?

tbb is installed on platform as part of OpenCV. There are indeed various issues with compiling this. But jevoisbase should provide the correct combination of libraries to make it compile. Have a look at CMakeLists.txt in jevoisbase, and you can take the section related to tiny-dnn and add it to your own module's CMakeLists.txt. You should also look at jevoisbase/Contrib/reinstall.sh which will pull a specific tiny-dnn version that works.

In the CMakeLists.txt of JeVois, we have:

# Use TBB and kernel includes for platform from the buildroot installation.  On the host, we may have local packages,
# eg, latest opencv compiled from source:
set(JEVOIS_KERNEL_INCLUDE "-I${JEVOIS_BUILDROOT_BASE}/build/linux-headers-3.4.113/usr/include")
set(JEVOIS_TBB_INCLUDE "-I${JEVOIS_BUILDROOT_BASE}/build/opencv3-${JEVOIS_OPENCV_VERSION}/buildroot-build/3rdparty/tbb/tbb-2018_U1/include")

and then TBB_INCLUDE gets integrated into JEVOIS_PLATFORM_INCLUDE which get pushed to modules via jevois_config.cmake.
answered Apr 16 by JeVois (38,460 points)

It is compiling OK on HOST but cannot make on Platform.
We need to get from source in order to cross compile, but  the current https://github.com/tiny-dnn/tiny-dnn/tree/master/tiny_dnn/util   does not contain the tbb.h anymore.

Do you have a complete tiny_dnn with the missing  library somewhere on your servers ?  That would make thing much easier.

In the meantime , I removed it from the source, but I have to remove 2 modules that are using it , including JeVois Demo....
yes, if you want our version of tiny-dnn, see the reinstall.sh script mentioned above.

Also, JEVOIS_TBB_INCLUDE currently resolves to this:


this is where tbb/tbb.h is for platform.
OK it is fixed :-)
Thanks to your pointer I added this conditional include in  ~/jevoisbase/CMakeLists.txt

# tiny-dnn support:


target_sources(jevoisbase PRIVATE Contrib/pthreadpool/src/threadpool-pthreads.c)

please note that i have opencv3-4.0.0 and I had to change info into ~/jevois/CMakeLists.txt as well:

# OpenCV version to use with JeVois: