Opened 4 years ago
Closed 2 years ago
#16965 closed bug (fixed)
__STDC_NO_THREADS__ is not defined in Haiku
Reported by: | Begasus | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta4 |
Component: | - General | Version: | R1/beta2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
When trying to build scipy I getting an error that the script wants to include "threads.h".
This however isn't availabe in Haiku and the check for that is due to __STDC_NO_THREADS__
not being defined.
The source of the issue is with numpy. See a PR at https://github.com/numpy/numpy/pull/18180
__STDC_VERSION__ = 201710 __STDC_NO_THREADS__ not defined __GLIBC__ not defined
Attachments (1)
Change History (19)
comment:2 by , 4 years ago
Yeah, came across that also earlier, looked for that header but we don't include it in Haiku atm
comment:3 by , 4 years ago
I added a stdc-prereqs.h with https://review.haiku-os.org/c/haiku/+/4097 When it's accepted, GCC and Clang can be adjusted.
comment:4 by , 3 years ago
This has been accepted, I should check if it has been resolved, but I'm not sure if it also applied to R1B2?
comment:6 by , 3 years ago
I think this could be closed, header is included in R1B3, building scipy without the patch for numpy seems to work (checked on x86_gcc2)
comment:7 by , 3 years ago
Ok, no problem reported by numpy, but scipy still fails to find it, so I'm guessing that clang/gcc aren't adjusted to use it, so best to leave it open until then
comment:8 by , 3 years ago
Description: | modified (diff) |
---|
comment:9 by , 2 years ago
Ran a check with the script mentioned at the issue at numpy, seems __STDC_NO_THREADS__
is still not defined, maybe we could use a simular work-around like OpenBSD?
https://github.com/numpy/numpy/commit/5ffe257a19c5125ad981a5de018e5d492797d2e4
EDIT created a upstream PR until this is settled on Haiku side: https://github.com/numpy/numpy/pull/22272
follow-up: 11 comment:10 by , 2 years ago
We don't define __STDC_NO_THREADS__
because we do actually support STDC threads now.
comment:11 by , 2 years ago
Replying to waddlesplash:
We don't define
__STDC_NO_THREADS__
because we do actually support STDC threads now.
Building scipy without patching still errors out, this is one of the errors I encountered:
build/src.haiku-1-BePC-3.8/scipy/integrate/vodemodule.c:98:32: error: unknown type name 'thread_local
comment:12 by , 2 years ago
Are you using GCC8? You can't use gcc2 for the new-style thread-local storage.
comment:13 by , 2 years ago
scipy is using secondary architecture, so yes using gcc11 for it Added Terminal output from the errors in RDQY.txt
by , 2 years ago
comment:14 by , 2 years ago
Support for C11 thread isn't complete: only the Threads section is implemented.
comment:15 by , 2 years ago
proposed the missing support in https://review.haiku-os.org/c/haiku/+/5675
comment:17 by , 2 years ago
Build for numpy without patching works to get scipy build now, thanks korli!
comment:18 by , 2 years ago
Milestone: | Unscheduled → R1/beta4 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Thanks for the feedback, begasus.
STDC_NO_THREADS is theorically set by the compiler, based on its knowledge of the C library. Practically gcc seems to include the header stdc-prereqs.h, which would eventually define such a macro.