Questions tagged [ocamlbuild]

OCamlbuild is a generic build tool, that has built-in rules for building OCaml library and programs.

OCamlbuild is a generic build tool, that has built-in rules for building library and programs.

Useful resources

160 questions
2
votes
2 answers

ocamlopt and ocamlbuild give an Unbound module error despite ocamlfind seeing the required module

I'm attempting to build the xencat tool from this project. When I try to use ocamlopt to build it, I get $ ocamlopt -o xencat xencat.ml File "xencat.ml", line 1, characters 5-13: Error: Unbound module Cmdliner Following guidance here, I verified…
T.D. Smith
  • 984
  • 2
  • 7
  • 22
2
votes
1 answer

Bizare errors and I'm unable to build OCaml programs on Windows

I've recently been trying to get OCaml to work, and the interpreter works fine, I just can't build native executable's with it. Here is my program: let () = print_endline "Hello, World!" Now if I run ocaml program.ml I get the expected output of…
Matthew
  • 160
  • 9
2
votes
1 answer

Ocamlbuild copy over dependencies to _build

I'm trying to use ocamlbuild to automatically invoke piqi to generate ocaml modules from protobuf definitions. This is a 2 step process where I have to go from a %.protobuf file to a %.proto.piqi and finally to %_piqi.ml. My rule for the first step…
rgrinberg
  • 9,638
  • 7
  • 27
  • 44
2
votes
1 answer

Using ocamlbuild to build SDL and OpenGL application

I am trying to create an OCaml program utilizing both ocamlsdl and lablgl, but I can not figure out how to compile it. The relevant information is below: Note: ocamlsdl is not found by ocamlfind. When I go to the lib directory of .opam, I find an…
Nezo
  • 567
  • 4
  • 18
2
votes
2 answers

Calling functions in other files in OCaml

I have hello.ml that has a length function: let rec length l = match l with [] -> 0 | h::t -> 1 + length t ;; call.ml that uses the function: #use "hello.ml" ;; print_int (length [1;2;4;5;6;7]) ;; In interpreter mode (ocaml), I…
prosseek
  • 182,215
  • 215
  • 566
  • 871
2
votes
1 answer

ocamlbuild; building toplevel

Having successfully reorganized my project for ocamlbuild with subdirectories and using ocamlfind, I've found it difficult to build the top-level. I've constructed a .mltop file containing all the modules that would be included and added the…
nlucaroni
  • 47,556
  • 6
  • 64
  • 86
2
votes
0 answers

Building OCaml project with Ocamlnet

I'm doing a project in OCaml and I'm trying to use Ocamlnet. I'm using ocamlbuild for the build. Here's my build command line: ocamlbuild -use-ocamlfind -pkgs threads,yojson,str,postgresql,netcgi2 \ -cflags -g,-thread -lflags -g,-thread…
Nate C-K
  • 5,744
  • 2
  • 29
  • 45
2
votes
2 answers

Creating .cma file OCaml

I am new to OCaml and i am trying to use its HANSEI library. For that, i need to include few .ml and .mli files as mentioned here along with caml-shift.tar.gz as mentioned here. Initial line of contents in my MakeFile is as follows: # HANSEI: OCaml…
Ankit
  • 201
  • 4
  • 12
2
votes
2 answers

Add build tool to ocamlbuild project (Ragel)

I am looking to add the ability to compile Ragel source files into Ocaml source files in the context of the LLVM Ocaml tutorial. Specifically, for source files with a ".rl" extension I would want it to execute: ragel -O source.rl The build system…
brooks94
  • 3,836
  • 4
  • 30
  • 57
2
votes
1 answer

How to create a GTK plugin (cmxs) for my OCaml program

I'd like to make a GTK plugin for my OCaml application, loaded using Dynlink. How can I get ocamlbuild to include the lablgtk2 library in the generated plugin? As a test, I have main.ml: let () = try Dynlink.loadfile "_build/gtk_plugin.cmxs" …
Thomas Leonard
  • 7,068
  • 2
  • 36
  • 40
2
votes
1 answer

(OCamlfind) build library with dependencies to Core

I'm trying to build a small library that has dependencies to Core and Core_extended. I followed the instructions under Where to place a shared utility module in OCaml? and installed the library in ocamlfind (declaring a dependency to Core_extended…
2
votes
1 answer

How do i compile something with Pgocaml

I'm trying to use Pgocaml for database interactions within my application. This is the file I'm trying to compile: let () = let dbh = PGOCaml.connect () in let insert name salary email = PGSQL(dbh) "insert into employees (name, salary,…
Lilluda 5
  • 1,111
  • 3
  • 18
  • 38
2
votes
1 answer

Using OCaml syntax extension in Camlp4 with ocamlbuild

I am having an issue with using the deriving-ocsigen syntax extension in my camlp4 parser. My parser is called pa_debug.ml Here's the tags file: : pp(camlp4orf.opt), package(deriving-ocsigen.syntax), syntax(camlp4o) When compiled…
Jason Yeo
  • 3,602
  • 3
  • 30
  • 38
2
votes
1 answer

How to use ocamlbuild with OPAM in ocaml?

I wrote two libraries (Bson.ml and Mongo.ml) in ocaml. I wish to enable it for opam. In the instruction of opam, it says it needs make build and make install. I am always using ocamlbuild and ocamlfind to build and install my library locally. How…
Jackson Tale
  • 25,428
  • 34
  • 149
  • 271
2
votes
1 answer

Is it possible to generate inferred mli files with oasis?

I realize you can generate the inferred mli files one by one using ocamlbuild xxx.inferred.mli but I would prefer this to be done automatically for me (too see which types ocaml infers and to use these mli's as a basis for my own). Of course I would…
rgrinberg
  • 9,638
  • 7
  • 27
  • 44