How to statically link to TBB?

后端 未结 7 2276
忘了有多久
忘了有多久 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:10

    Build static libraries from source

    After acquiring the source code from https://www.threadingbuildingblocks.org/, build TBB like this:

    make extra_inc=big_iron.inc

    If you need extra options, then instead build like this:

    make extra_inc=big_iron.inc

    Running multiple TBB programs per node

    If you run a multiprocessing application, e.g. using MPI, you may need to explicitly initialize the TBB scheduler with the appropriate number of threads to avoid oversubscription.

    An example of this in a large application can be found in https://github.com/m-a-d-n-e-s-s/madness/blob/master/src/madness/world/thread.cc.

    Comment on documentation

    This feature has been available for many years (since at least 2013), although it is not documented for the reasons described in other answers.

    Historical note

    This feature was originally developed because IBM Blue Gene and Cray supercomputers either did not support shared libraries or did not perform well when using them, due to the lack of a locally mounted filesystem.

提交回复
热议问题