oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Preliminary version of EMSCRIPTEN port

Open anton-potapov opened this issue 3 years ago • 1 comments

Description

This patch adds preliminary support of Emscripten compiler

Fixes #460

  • [x] - git commit message contains appropriate signed-off-by string (see CONTRIBUTING.md for details)

Type of change

  • [ ] bug fix - change which fixes an issue
  • [x] new feature - change which adds functionality
  • [ ] tests - change in tests
  • [ ] infrastructure - change in infrastructure and CI
  • [ ] documentation - documentation update

Tests

  • [ ] added - required for new features and for some bug fixes
  • [x] not needed

Documentation

  • [ ] updated in # - add PR number
  • [x] needs to be updated
  • [ ] not needed

Breaks backward compatibility

  • [ ] Yes
  • [x] No
  • [ ] Unknown

Notify the following users

Other information

  • this is preliminary version, and most likely it's content will change
  • some tests do not build due to compile/link errors, and therefor disabled for now
  • some tests fail at runtime

built with Emscripten SDK and the following cmake command parameters:

-DCMAKE_CXX_COMPILER=em++ -DCMAKE_C_COMPILER=emcc   -DTBB_STRICT=OFF -DCMAKE_CXX_FLAGS=-Wno-unused-command-line-argument -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=ON 

following (19) tests were disabled due to build errors:

- all malloc tests
- test_dynamic_link
- test_resumable_tasks
- conformance_resumable_tasks
- test_concurrent_queue_whitebox
- test_concurrent_monitor

results of ctest run:

62% tests passed, 43 tests failed out of 113

Total Test time (real) = 941.68 sec

The following tests FAILED:
	  2 - test_allocators (Failed)
	  4 - test_collaborative_call_once (Failed)
	  6 - test_concurrent_unordered_map (Failed)
	  8 - test_concurrent_map (Failed)
	  9 - test_concurrent_set (Failed)
	 10 - test_concurrent_priority_queue (Failed)
	 16 - test_parallel_invoke (Failed)
	 18 - test_parallel_pipeline (Failed)
	 19 - test_eh_algorithms (Failed)
	 21 - test_concurrent_vector (Failed)
	 22 - test_task_group (Failed)
	 23 - test_concurrent_hash_map (Failed)
	 24 - test_task_arena (Failed)
	 26 - test_concurrent_queue (Failed)
	 28 - test_function_node (Failed)
	 29 - test_multifunction_node (Failed)
	 34 - test_eh_flow_graph (Failed)
	 36 - test_flow_graph_priorities (Failed)
	 47 - test_tagged_msg (Failed)
	 48 - test_overwrite_node (Failed)
	 49 - test_write_once_node (Failed)
	 50 - test_async_node (Failed)
	 58 - test_global_control (Failed)
	 59 - test_task (Failed)
	 60 - test_scheduler_mix (Failed)
	 61 - test_handle_perror (Failed)
	 62 - test_arena_constraints (Failed)
	 63 - test_tbb_fork (Failed)
	 64 - test_tbb_header (Failed)
	 66 - conformance_allocators (Failed)
	 67 - conformance_mutex (Failed)
	 70 - conformance_collaborative_call_once (Failed)
	 72 - conformance_concurrent_unordered_map (Failed)
	 73 - conformance_concurrent_unordered_set (Failed)
	 74 - conformance_concurrent_map (Failed)
	 75 - conformance_concurrent_set (Failed)
	 83 - conformance_parallel_invoke (Failed)
	 88 - conformance_concurrent_vector (Failed)
	 89 - conformance_global_control (Failed)
	 90 - conformance_concurrent_hash_map (Failed)
	 91 - conformance_enumerable_thread_specific (Failed)
	 93 - conformance_concurrent_queue (Failed)
	113 - conformance_arena_constraints (Failed)

anton-potapov avatar Dec 22 '21 08:12 anton-potapov

I'd just like to express support for this contribution on behalf of the Universal Scene Description (USD) project at Pixar, as lack of emscripten support for OneTBB has become a blocking point for USD to move forward to OneTBB, and USD in turn cascades as a blocking point for the majority of the DCC's in the VFX industry (Maya, Houdini, Katana, Nuke, etc) because they depend deeply on USD, and we all rely on TBB to arbitrate resources between host and subsystem.

Thank you, and thanks @anton-potapov for this work!

spiffmon avatar Apr 01 '22 18:04 spiffmon