Closed mudrz closed 3 years ago
It looks like you're building the examples with the version of the bonsai library on Opam. If you're downloading the examples off of github, then you need to use the github version of the Bonsai libray.
And if you're using the version of Bonsai off of github, you need to do the same with all of its transitive dependencies. You can find the instructions on how to do that here:
thanks @TyOverby , I added the janestreet repository, but core
does not build (ocaml 4.11.1)
[ERROR] The compilation of core failed at "/.opam/opam-init/hooks/sandbox.sh build dune build -p
core -j 7".
-> installed async_js.v0.15~preview.124.16+217
-> installed incr_dom.v0.15~preview.124.16+217
#=== ERROR while compiling core.v0.15~preview.124.16+217 ======================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.11.1 | https://ocaml.janestreet.com/opam-repository
# path ~/projects/bonsai_test/_opam/.opam-switch/build/core.v0.15~preview.124.16+217
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p core -j 7
# exit-code 1
# env-file ~/.opam/log/core-8944-1fefce.env
# output-file ~/.opam/log/core-8944-1fefce.out
### output ###
# #warning "_POSIX_PRIORITY_SCHEDULING not present; sched_setscheduler undefined"
# [...]
# 4 warnings generated.
# cc src/unix_time_stubs.o (exit 1)
# (cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O2 -fno-strict-aliasing -fwrapv -D_LARGEFILE64_SOURCE -g -I /projects/bonsai_test/_opam/lib/ocaml -I /projects/bonsai_test/_opam/lib/base -I /projects/bonsai_test/_opam/lib/base/base_internalhash_types -I /projects/bonsai_test/_opam/lib/base/caml -I /User[...]
# unix_time_stubs.c:57:13: error: implicit declaration of function 'clock_getcpuclockid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
# int ret = clock_getcpuclockid(pid, &clock);
# ^
# unix_time_stubs.c:57:13: note: did you mean 'caml_clock_getcpuclockid'?
# unix_time_stubs.c:52:16: note: 'caml_clock_getcpuclockid' declared here
# CAMLprim value caml_clock_getcpuclockid(value v_pid) {
# ^
# 1 error generated.
do I need a particular version of ocaml? and are there any example links/tutorials for the stable/released bonsai version?
do I need a particular version of ocaml?
I don't believe that there should be an problem with 4.11.1, but maybe the fact that you're building on OSX is an issue? Maybe you could re-open over in the https://github.com/janestreet/core repo.
and are there any example links/tutorials for the stable/released bonsai version?
No, but honestly, there aren't really many tutorials for the unreleased bonsai versions either.
thanks TyOverby, created an issue in the core repository https://github.com/janestreet/core/issues/144
there aren't really many tutorials for the unreleased bonsai versions either.
I think the examples would suffice as a starting point; (PS: if getting a wider adoption is a goal for the library - covering simple common scenarios is really helpful, I've used comparatively worse libraries, just because of better docs)
If you're interested in using the older, stable release, you can find the examples bundled into the tarball on the opam page
https://opam.ocaml.org/packages/bonsai/
However, if you aren't in a rush, the next stable-release of Bonsai should be out within the next few months.
hey, what is the simplest way to try out bonsai? it seems that the examples are using an unreleased version and do not work
I finally tried to rename
bonsai_web
tobonsai.web
, but the very first line results in a type errorthanks