Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: introduce tbb library (for mold linker) #838

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fzakaria
Copy link
Contributor

DESCRIPTION

oneAPI Threading Building Blocks (oneTBB)

oneTBB is a flexible C++ library that simplifies the work of adding parallelism to complex applications,
even if you are not a threading expert.

SOURCE

https://github.com/oneapi-src/oneTBB

commit e813596ba3a1bee0ffa06fb66b5e30b7ea801319
Author: Alexandra [email protected]
Date: Wed Jun 21 18:46:54 2023 +0200

  Documentation for std::invoke (#1112)

@fzakaria
Copy link
Contributor Author

fzakaria commented Jun 24, 2023

The contribution is nearly ready.
I believe I solved all the include statements but something is wonky with my Makefile as it's giving:

❯ build/bootstrap/make.com o//third_party/tbb
♥cosmo
o//third_party/tbb/address_waiter.o: open failed with ENOENT

`make MODE= -j24 o//third_party/tbb/tbb.a.pkg` exited with 1:
build/bootstrap/package.com -o o//third_party/tbb/tbb.a.pkg -do//third_party/libcxx/libcxx.a.pkg @/usr/local/google/home/fmzakari/code/github.com/jart/cosmopolitan/o/tmp/o__third_party_tbb_tbb_a_pkg.uds20q/.args
consumed 710µs wall time
ballooned to 188kb in size
needed 631us cpu (0% kernel)
caused 22 page faults (100% memcpy)

make.com: *** [build/rules.mk:105: o//third_party/tbb/tbb.a.pkg] Error 1

@fzakaria
Copy link
Contributor Author

fzakaria commented Jun 24, 2023

Renamed all the cpp files to cc since I found that is the defined rule.

I am now hitting a slew of errors that are confusing. Looks like it's only compiling as C not CXX:
./third_party/libcxx/__nullptr:54:1: error: unknown type name 'namespace'

❯ MODE=dbg make o/dbg/third_party/tbb 2>&1 | head -n 20
♥cosmo
    561,794⏰     556,388⏳     9,080k   7,528iop build/bootstrap/mkdeps.com -o o/tmp/o_dbg_depend -r o/dbg/ @o/dbg/srcs.txt @o/dbg/hdrs.txt @o/dbg/incs.txt
♥cosmo
        750⏰         675⏳       184k       8iop build/bootstrap/package.com -o o/dbg/third_party/tbb/tbb.a.pkg -do/dbg/third_party/libcxx/libcxx.a.pkg @o/tmpo_dbg_third_party_tbb_tbb.a.pkg.tmp.args
In file included from ./third_party/libcxx/cstddef:45,
                 from ./third_party/libcxx/atomic:551,
                 from third_party/tbb/arena.h:21:
./third_party/libcxx/__nullptr:54:1: error: unknown type name 'namespace'
   54 | namespace std
      | ^~~~~~~~~
./third_party/libcxx/__nullptr:55:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   55 | {

Specifically make MODE= -j24 o//third_party/tbb/arena.h.ok is failing

@fzakaria
Copy link
Contributor Author

Okay renamed .h -> .hh

Current failure:

❯ make o//third_party/tbb
♥cosmo
In file included from ./third_party/tbb/scheduler_common.hh:28,
                 from third_party/tbb/arena.hh:28:
./third_party/tbb/co_context.hh: In function 'void tbb::detail::r1::create_coroutine(tbb::detail::r1::coroutine_type&, size_t, void*)':
./third_party/tbb/co_context.hh:390:5: error: 'makecontext' was not declared in this scope
  390 |     makecontext(&c.my_context, (coroutine_func_t)co_local_wait_for_all, 2, hi, lo);
      |     ^~~~~~~~~~~

Can't seem to find makecontext although I included uccontext.h
https://man7.org/linux/man-pages/man3/makecontext.3.html

@fzakaria fzakaria changed the title introduce tbb library WIP: introduce tbb library Jun 24, 2023
@fzakaria fzakaria changed the title WIP: introduce tbb library WIP: introduce tbb library (for mold linker) Jun 24, 2023
* support of span in libcxx
* added inline keywords in atomic otherwise it was giving errors
that it couldn't be inlined
@jart
Copy link
Owner

jart commented Jul 2, 2023

Looks like you need makecontext(). We used to have it. I can't remember why we don't anymore. I'll start bringing it back now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants