Attempting to build Eio code

Hi,

Is this the way to use ‘eio’ in ‘dune’ ? (executable (public_name vsr) (name main) (libraries eio_main)) I created a switch and installed eio.

File "bin/dune", line 4, characters 13-21:
4 |  (libraries  eio_main))
                 ^^^^^^^^
Error: Library "eio_main" not found.
-> required by _build/default/bin/main.exe
-> required by alias bin/all
-> required by alias default

Thanks.

You’ll need to opam install eio_main; it isn’t included in the eio package.

Yes. I ignored these errors.

-> retrieved eio_main.0.12  (cached)
-> retrieved eio_posix.0.12  (cached)
[ERROR] The compilation of eio_posix.0.12 failed at "dune build -p eio_posix -j
        15 @install".

#=== ERROR while compiling eio_posix.0.12 =====================================#
# context     2.1.5 | macos/x86_64 | ocaml-base-compiler.5.0.0 | https://opam.ocaml.org#316bd0cc
# path        ~/Documents/vsr/_opam/.opam-switch/build/eio_posix.0.12
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p eio_posix -j 15 @install
# exit-code   1
# env-file    ~/.opam/log/eio_posix-1984-530377.env
# output-file ~/.opam/log/eio_posix-1984-530377.out
### output ###
# File "lib_eio_posix/dune", line 9, characters 9-24:
# 9 |   (names eio_posix_stubs))
#              ^^^^^^^^^^^^^^^
# (cd _build/default/lib_eio_posix && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -pthread -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -g -I /Users/anu/Documents/vsr/_opam/lib/ocaml -I /Users/anu/Documents/vsr/_opam/lib/bigstringaf -I /Users/anu/Documents/vsr/_opam/lib/cstruct -I /Users/anu/Documents/vsr/_opam/lib/domain-local-await -I /Users/anu/Documents/vsr/_opam/lib/eio -I /Users/anu/Docu[...]
# eio_posix_stubs.c:113:7: error: implicit declaration of function 'preadv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
#   r = preadv(Int_val(v_fd), iov, n_bufs, Int63_val(v_offset));
#       ^
# eio_posix_stubs.c:127:7: error: implicit declaration of function 'pwritev' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
#   r = pwritev(Int_val(v_fd), iov, n_bufs, Int63_val(v_offset));
#       ^
# 2 errors generated.