Questions tagged [ocamlfind]

Findlib is a library manager for Objective Caml. It provides a convention how to store libraries, and a file format ("META") to describe the properties of libraries. There is also a tool (ocamlfind) for interpreting the META files, so that it is very easy to use libraries in programs and scripts.

Findlib is a library manager for Objective Caml. It provides a convention how to store libraries, and a file format ("META") to describe the properties of libraries. There is also a tool (ocamlfind) for interpreting the META files, so that it is very easy to use libraries in programs and scripts.

The information in META includes version string, compiler options for using the library, and dependencies on other libraries. Writing META files is straight-forward, and comes close to filling out a template.

The ocamlfind tool makes it very easy to use libraries from O'Caml programs. Basically, ocamlfind is a compiler driver that interprets some additional command-line switches for selecting libraries. It is also possible to use ocamlfind as query tool to extract data from the library base.

After years of development, Findlib is now the de-facto standard for library management in O'Caml. A lot of free software for O'Caml now requires that Findlib is available on the system. Distributions like GODI and Debian ensure that all libraries come with META files.

77 questions
1
vote
2 answers

Problems compiling ocaml project on debian bulleye: undefined reference to shm_unlink and shm_open

Trying to compile the ocaml project from https://gitlab.com/benjgregoire/maskverif/ I (having no clue about ocaml) get, after installing all the missing libraries, the error message + ocamlfind ocamlopt -rectypes -cclib -lrt -linkpkg -g -thread…
j.p.
  • 1,031
  • 1
  • 18
  • 25
1
vote
1 answer

Compiling modules in different directories

I'm trying to follow these instructions to compile a module that depends on another module which I've created: https://ocaml.org/learn/tutorials/modules.html In my case, I have a module ~/courseFiles/chapter5/moduleA.ml and another module in…
Addem
  • 3,635
  • 3
  • 35
  • 58
1
vote
1 answer

ocamlbuild with Toploop/TopLevel

I'm looking to implement an eval function like in this answer here: https://stackoverflow.com/a/33293116/ However, when I go to compile my code sample: let eval code = let as_buf = Lexing.from_string code in let parsed =…
NiallMitch14
  • 1,198
  • 1
  • 12
  • 28
1
vote
1 answer

OCamlbuild recursively build dependecies

I’m building a project that uses OCamlbuild as its build system. This project also requires a library, which also uses OCamlbuild. This library comes with .mlpack, _tags, and myocamlbuild.ml files. I have included the library into my project as a…
Antonin Décimo
  • 499
  • 3
  • 17
1
vote
1 answer

Error: Unbound module Toploop, when trying to install merlin.

I'm new to Ocaml. I'm trying to use merlin to get auto-completion in vim. System: Arch Linux Ocaml: version 4.07.0 `### stderr ### …
NoMan
  • 401
  • 1
  • 4
  • 10
1
vote
3 answers

Use ocamlfind with ocaml interpreter, without compiling

I have a file main.ml that uses some package that makes the command ocaml main.ml fail and report this error: Error: Unbound module X And the only solution I've found so far is to run: ocamlbuild main.native -use-ocamlfind -package…
user9335697
1
vote
1 answer

The compilation of ocamlfind failed at "install -m 0755 ocaml-stub

I'm new to OCaml and I'm trying to install cohttp. After a failure because I hadn't accepted the Xcode license agreement (OS X Sierra 10.12.6) I get an error while the package manager (opam) is trying to install a sub-dependency, ocamlfind. =-=-…
Gregory Bell
  • 1,861
  • 1
  • 19
  • 21
1
vote
2 answers

OCaml statically detect dependency on non-pervasives library in standard distribution

Certain modules that ship with OCaml like Unix and Bigarray have their own .cmx and .cmxa files in ocamlopt -where (which is ~/.opam/4.03.0/lib/ocaml on my system in my current opam switch). Is there a way to determine without compiling which source…
Greg Nisbet
  • 6,710
  • 3
  • 25
  • 65
1
vote
1 answer

Ocaml Error : Unbound module when compiling

I'm learning Ocaml and currently I'm building a graphical interface for a game. I used Graphics and camlimages but now I would like to add some buttons. So I searched for Gtk2 and I'm having problems to compile now. This is a part of my code: open…
Gh0stm4chine
  • 11
  • 1
  • 2
1
vote
0 answers

Opam failures on macOS Sierra

I'm having problems very similar to this question. I have a MacBook Pro on macOS Sierra. I've installed ocaml and opam via brew. (brew install ocaml, brew install opam) This installed ocaml 4.03.0, and it appears to work fine on its own. I tried to…
drautb
  • 505
  • 6
  • 12
1
vote
1 answer

Are ocamlfind package predicates implemented?

I have a package named sundialsml, in which I want to load a slightly different .cm(x)a file depending on whether a subpackage named no_sens is loaded. Promisingly enough, the findlib 1.6.2 reference manual describes a "package predicate"…
Jun Inoue
  • 544
  • 1
  • 4
  • 9
1
vote
1 answer

Is there a way to tell ocamlbuild to run my file instead of just produce an executable?

Right now, if I want to recompile and run an ml file I use ocamlbuild -pkg containers myfile.byte && ./myfile.byte Is there a shorter way to do this? In haskell you can run things just by saying runghc myfile.hs and I wonder if ocamlbuild or…
hugomg
  • 68,213
  • 24
  • 160
  • 246
1
vote
1 answer

replace camlp4 with camlp5 in utop

I'm working with OCaml code that needs camlp5; however, the toplevel (I'm using utop) automatically loads the newer, incompatible camlp4. These are the startup messages: Findlib has been successfully loaded. Additional directives: #require…
jules
  • 1,897
  • 2
  • 16
  • 19
1
vote
1 answer

different results for commands "sudo ocamlfind list" and "ocamlfind list"

I have an issue here, that really drives me nuts. I never worked with OCaml, do not know anything about it or how it works. The problem: i need to install camlidl library. I did it through opam (opam install camlidl). As i said before, i have no…
GrimSmiler
  • 561
  • 1
  • 4
  • 21
1
vote
2 answers

How can I see the result Camlp4's preprocessing?

I'm using the Sexplib syntax extension in a file called module.ml, and I would like to see the code that is fed into the compiler after the Camlp4 preprocessing. Is there an easy way to do this using ocamlfind or do I have to invoke camlp4 directly…
Jon Smark
  • 2,528
  • 24
  • 31