windows builds using msys2 - threading issues

Hi,
Moving some long running work to discourse after discussion with @dzenanz

My question is how to enable TBB under msys2. Detailed context below.

The error I see when enabling the TBB module is about the location of TBBConfig.cmake.

The tbb libraries appear to be installed according pacman (package names is mingw-w64-x86_64-intel-tbb).

Any clues as to what else I need to install?

Context:
My long term goal is to get the SimpleITK R package working under windows. R for windows is moving to a build and configuration system based around msys2. The package that can be used to build R and addon packages is rtools40. The compiler versions in use are gcc 8.3. It is possible to get access to upstream msys2 packages via a tweak to the config file.

These tools are able to build the simpleitk R package, however the tests fail because R doesn’t exit after running any ITK filters. Further investigations show that the ITK tests intermittently timeout, but pass if I set the threadcount to 1. Unfortunately the same trick doesn’t stop R freezing.

Thus I’m playing with various thread configurations to see if any work out of the box.

PR991 and links in it might be of interest.

I am continuing to plug away with this.

On the plus side, I have got the ITK tests to pass using TBB after building with the rtools toolchain.

However, it seems that the R preference is for pthreads, as it is configured as a default to be used by the rtools compiler. To date this has lead to link issues when I get to SimpleITK, specifically with duplicate symbols from pthread libraries. I may be able to overcome these, with time.

However, I am after advice as to whether I am likely to be able to combine TBB with pthreads? While this may not happen inside SimpleITK, it looks like it is bound to occur at the R level. I have not been able to see much about this type of problem.

1 Like

I see no reason for TBB to clash with pthreads.

1 Like