You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am pretty sure I don't need this option for ocaml builds and can find workarounds, but just to let you know
ftr from man gcc:
-pthread
Define additional macros required for using the POSIX threads library. You should use this option consistently for both compilation and
linking. This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86 Cygwin and MinGW targets.
Note that for OCaml 5.x this flag should be unnecessary on all builds, as the runtime requires pthreads (in fact, I think adding -pthread might even cause problems for the mingw-w64 build, because it links pthreads statically).
For mingw-w64 on OCaml 4.x - but the key thing is that it should be being added as -link -pthread (i.e. it should be being passed from OCaml as -ccopt -link -ccopt -pthread)
This is fixed for gcc-based toolchains (i.e. for mingw-w64) by passing the option on directly - note that if compiling for the MSVC port of OCaml, there'll still need to be handling on the caller's side to avoid passing -pthread at all.
Activity
dra27 commentedon Nov 22, 2024
Note that for OCaml 5.x this flag should be unnecessary on all builds, as the runtime requires pthreads (in fact, I think adding
-pthreadmight even cause problems for the mingw-w64 build, because it links pthreads statically).For mingw-w64 on OCaml 4.x - but the key thing is that it should be being added as
-link -pthread(i.e. it should be being passed from OCaml as-ccopt -link -ccopt -pthread)dra27 commentedon Dec 16, 2024
This is fixed for gcc-based toolchains (i.e. for mingw-w64) by passing the option on directly - note that if compiling for the MSVC port of OCaml, there'll still need to be handling on the caller's side to avoid passing
-pthreadat all.