How to statically link to TBB?

后端 未结 7 2275
忘了有多久
忘了有多久 2020-12-05 19:00

How can I statically link the intel\'s TBB libraries to my application? I know all the caveats such as unfair load distribution of the scheduler, but I don\'t need the sched

7条回答
  •  盖世英雄少女心
    2020-12-05 19:07

    Using the opensource version:

    After running "make tbb",go to the build/linux_xxxxxxxx_release folder.

    Then run:

    ar -r libtbb.a concurrent_hash_map.o concurrent_queue.o concurrent_vector.o 
    dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o 
    queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o spin_mutex.o critical_section.o
    task.o tbb_misc.o tbb_misc_ex.o mutex.o recursive_mutex.o condition_variable.o 
    tbb_thread.o concurrent_monitor.o semaphore.o private_server.o rml_tbb.o 
    task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o 
    tbb_statistics.o tbb_main.o concurrent_vector_v2.o concurrent_queue_v2.o 
    spin_rw_mutex_v2.o task_v2.o
    

    And you should get libtbb.a as output.

    Note that your program should build both with "-ldl" and libtbb.a

提交回复
热议问题