I want to link Core libraries in Facebook Reason

Asked 1 years ago, Updated 1 years ago, 104 views

OCaml 4.02.3, Reason 0.0.5, and OS X 10.11.5.

Reason codes are as follows:

open Core.Std;
printf "test%f" (Float.of_int3);

Compile.

$rebuild-pkgs core a.native

No binaries are generated with errors.
If you add an option flag, you may be able to generate a.native, but
Please let me know if anyone understands.

Error: No implementations provided for the following modules:
Thread referenced from >/Users/ow/.opam/4.02.3/lib/core/core.cmca(Core)
Mutex referenced from /Users/ow/.opam/4.02.3/lib/core/core.cmca(Core)
Condition referenced from /Users/ow/.opam/4.02.3/lib/core/core.cmca(Core)
Event referenced from /Users/ow/.opam/4.02.3/lib/core/core.cmca(Core)
Command expired with code 2.
Hint—Recursive traversal of subdirectories was not enabled for this build,
as the working directory does not look like an ocamlbuild project (no
) '_tags' or 'myocamlbuild.ml' file).If you have modules in subdirectories,
You should add the option "-r " or create an empty '_tags' file.

To enable recursive traversal for some subdirectories only, you can use the
following '_tags' file:

true:-traverse
  <dir1>or<dir2> —traverse

Compilation unsuccessful after building 4 targets (3 cached) in 00:00:00.

On the other hand, if you rewrite the same program with OCaml, it will probably look like this.

open Core.Std;
let() = printf "test%f" (Float.of_int3);

Compile.

$corebuild-verbose1 a.native

The build was successful and a viable a.native.

Therefore, it seems that the rebuild command can be used to make a.cmx, so

$rebuild-pkgs core a.native

After the failed, you were able to create a.native by manually entering the following command, imitating the corebuild command:

$ocamlfindocamlopt-linkpkg-g-thread-package core_build/a.cmx-oa.native

So I was wondering if it would work if I added some flags to the following commands. Do you have any ideas?

$rebuild-pkgs core a.native

facebook ocaml reason

2022-09-29 22:40

1 Answers

Reason's github has questions and answers.

https://github.com/facebook/reason/issues/556

With that in mind, I was able to create a native binary with one command without any errors as follows:

$ocamlfindocamlc-g-thread-package core-pp refmt-linkpkg-oa.native-impl a.re


2022-09-29 22:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.