5 Replies Latest reply on Aug 11, 2016 3:05 AM by ValeriyaSinevich

    building opencv with tbb on Edison

    valeriyasin

      Hello, I am trying to build OpenCV 3.1.0 with TBB following this IoT - OpenCV 3.0.0-beta ( IPP & TBB enabled ) on Yocto with Intel® Edison | Intel® Software  tutorial. However, .so files that I copied on Edison appeared to be just softlinks and the linker told me that he needed libtbb.so.2, libtbbmalloc.so.2 and libtbbmalloc_proxy.so.2. I found those files in the folder /usr/lib/i386-linux-gnu and copied to Edison. When I tried to build openCV I got the following errors:

       

      /usr/lib/gcc/i586-poky-linux/4.9.1/../../../libtbb.so: undefined reference to `std::range_error::range_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

      /usr/lib/gcc/i586-poky-linux/4.9.1/../../../libtbb.so: undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

      /usr/lib/gcc/i586-poky-linux/4.9.1/../../../libtbb.so: undefined reference to `std::length_error::length_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

      /usr/lib/gcc/i586-poky-linux/4.9.1/../../../libtbb.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned int&, unsigned int)@GLIBCXX_3.4.21'

      /usr/lib/gcc/i586-poky-linux/4.9.1/../../../libtbb.so: undefined reference to `std::invalid_argument::invalid_argument(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

      /usr/lib/gcc/i586-poky-linux/4.9.1/../../../libtbb.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

      collect2: error: ld returned 1 exit status

       

      For me it seems like I had to compile those files with g++.

        • 1. Re: building opencv with tbb on Edison
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi,

          What OS were you using to build this image? What image are you using with the Edison? Did you follow all previous steps on the guide before getting to this point? After running sudo apt-get install libtbb-dev:i386, what are the contents of /usr/include/tbb?

          -Sergio
           

          • 2. Re: building opencv with tbb on Edison
            valeriyasin

            I used LinuxMint 18, which, I believe, is equivalent to Ubuntu 16.04. On Edison I have my custom yocto image, but I didn't change much from the default configuration downloaded from the official site IoT - Intel® Edison Board Download | Intel® Software .
            As I explained, I tried with copying only libtbb.so, libtbbmalloc.so and libtbbmalloc_proxy.so, but this failed, because they were just the softlinks, so I had to search for libtbb.so.2 etc., which I found in /usr/lib/i386-linux-gnu directory on my host-machine.

            The contents of /usr/include/tbb are the following:

            aggregator.h                  index.html            runtime_loader.h

            aligned_space.h               internal              scalable_allocator.h

            atomic.h                      machine               spin_mutex.h

            blocked_range.h               memory_pool.h         spin_rw_mutex.h

            blocked_range2d.h             mutex.h               task.h

            blocked_range3d.h             null_mutex.h          task_arena.h

            cache_aligned_allocator.h     null_rw_mutex.h       task_group.h

            combinable.h                  parallel_do.h         task_scheduler_init.h

            compat                        parallel_for.h        task_scheduler_observer.h

            concurrent_hash_map.h         parallel_for_each.h   tbb.h

            concurrent_lru_cache.h        parallel_invoke.h     tbb_allocator.h

            concurrent_priority_queue.h   parallel_reduce.h     tbb_config.h

            concurrent_queue.h            parallel_scan.h       tbb_exception.h

            concurrent_unordered_map.h    parallel_sort.h       tbb_machine.h

            concurrent_unordered_set.h    parallel_while.h      tbb_profiling.h

            concurrent_vector.h           partitioner.h         tbb_stddef.h

            critical_section.h            pipeline.h            tbb_thread.h

            enumerable_thread_specific.h  queuing_mutex.h       tbbmalloc_proxy.h

            flow_graph.h                  queuing_rw_mutex.h    tick_count.h

            flow_graph_opencl_node.h      reader_writer_lock.h

            global_control.h              recursive_mutex.h

             

            By the way, I succeeded by downloading already built tbb from here: Download | Threading Building Blocks

            • 3. Re: building opencv with tbb on Edison
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Why are you trying to install OpenCV using this method? I haven’t tried this method yet but, as an alternative you can try installing OpenCV from AlexT’s repository. You can see instructions on how to configure the repo here http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html .

              You can see a discussion about this here https://communities.intel.com/message/394848#394848

              Let us know your results.

              -Sergio
               

              • 4. Re: building opencv with tbb on Edison
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Do you still need help with this thread, were you able to use OpenCV?

                -Sergio
                 

                • 5. Re: building opencv with tbb on Edison
                  ValeriyaSinevich

                  Thank you for the suggestion, but unfortunately opencv from AlexT's repository is just 2.4.9, and I needed 3.1.0.
                  As I said, I managed to install openCV with the pre-built TBB downloaded from offsite, so no further help needed.
                  Thank you very much for your help.