Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telling ocamlbuild to use Core

In my project I have a file that uses Core.Std stuff, so I have run

opam install core

and added

open Core.Std

in my file.

When I run

ocamlbuild myprogram.native

it says:

Error: Unbound module Core

pointing to line with the open statement above.

So, I try this:

ocamlbuild -use-ocamlfind -pkgs core.std myprogram.native

and get the following message:

ocamlfind: Package `core.std' not found

So I thought that maybe I needed to run opam install core.std as well, but apparently there is no such thing according to opam. I also tried "open Core.Std;;" in the ocaml repl, but that did not work either. Any ideas?

like image 917
Calle Avatar asked Nov 19 '14 21:11

Calle


2 Answers

You can either use corebuild which is usually shipped with this library or, you can try this:

 ocamlbuild -use-ocamlfind -pkg core

P.S. use ocamlfind list command to view the list of available packages.

P.P.S. In addition to corebuild they usually ship coretop, a script that allows you to run core-enabled top-level. It uses utop underneath the hood, so make sure that you have installed it with opam install utop (if you're using opam), before your experiments.

like image 128
ivg Avatar answered Nov 10 '22 17:11

ivg


Remove .std from your ocamlbuild cmd?

like image 21
Jackson Tale Avatar answered Nov 10 '22 16:11

Jackson Tale