esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
823 stars 161 forks source link

[BUG] Please support oneTBB #463

Closed yurivict closed 3 years ago

yurivict commented 3 years ago

Describe the bug oneTBB is a new generation of TBB.

Pagmo2 fails to build with oneTBB: http://box.martymac.org/FreeBSD-Packages/data/FBSD122amd64-tbb-migr/2021-01-17_09h08m36s/logs/errors/pagmo2-2.15.0.102_1.log

Could you please make it compatible with oneTBB?

Thank you, Yuri

bluescarni commented 3 years ago

@yurivict thanks for the heads up!

As far as I can see, the new version of TBB does not seem to be widely available yet from the package managers we target/use (e.g., conda). Thus, I think we need to wait a bit more before porting over, given how this is a major new incompatible release.

The error you are seeing from the build comes from the fact for the old TBB version (which does not use CMake as build system) we have a CMake script that detects the location of TBB's libraries/headers. This script can be most likely removed once we move over to oneTBB, which has builtin CMake support (as far as I understood).

yurivict commented 3 years ago

Yes, oneTBB provides its own cmake scripts, but there can also be some header and API incompatibility.

bluescarni commented 3 years ago

Yes, oneTBB provides its own cmake scripts, but there can also be some header and API incompatibility.

Right, I was reading about them here (just posting for reference):

https://software.intel.com/content/www/us/en/develop/articles/tbb-revamp.html

We make a basic usage of TBB in pagmo, so I don't think the incompatibilities will hit us hard. As soon as the new TBB version starts to be available in the package managers we use/target, I'll do the porting.

(Of course PRs welcome if someone else wants to do it :) )

erwincoumans commented 3 years ago

After removing all cmake/pagmo 'find' logic, pointing directly to the include and lib dirs (for TBB, Eigen, BOOST), it compile/links/runs out-of-the-box with latest 'oneTBB', so it is mainly a build script issue.

erwincoumans commented 3 years ago

Here is a repro with a build script to build pagmo2_example.cpp, including Boost, Eigen, oneTBB and pagmo2: https://github.com/erwincoumans/pagmo2_example

bluescarni commented 3 years ago

@erwincoumans thanks!

I am following the PR on conda to update the TBB package to oneTBB:

https://github.com/conda-forge/tbb-feedstock/pull/78

As soon as this is done, we can fix pagmo's build system to work with the new version.

erwincoumans commented 3 years ago

Sure, in the meanwhile my example works already with latest oneTBB on Windows, Mac and Linux.

bluescarni commented 3 years ago

This should now be fixed with the release of pagmo 2.17.0.