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
4
votes
1 answer

mark_tag_used warning with OCaml 4.02.0

I'm just trying my code with OCaml 4.02 (using opam) and I get lots of warnings like this: File "_tags", line 14, characters 121-134: Warning: the tag "link(utils.o)" is not used in any flag declaration, so it will have no effect; it may be a…
Thomas Leonard
  • 7,068
  • 2
  • 36
  • 40
4
votes
1 answer

Building C++ code with ocamlbuild

I have found many guides on how to build .o files from C sources using ocamlbuild. These do not apply to C++ files, however, which ocamlbuild cannot build out of the box. I have tried writing a myocamlbuild.ml file (shown below after request)…
Nikos
  • 219
  • 1
  • 8
4
votes
3 answers

Weird thing of Array.create in OCaml

I'm a newbie at OCaml. And when I do some coding using array in Ocaml I come to a problem I can't understand. Here is the code: let a = Array.create 5 (Array.create 5 0); a.(0).(1) <- 1 I just want to assign 1 to a[0][1] but then things happened:…
KUN
  • 527
  • 4
  • 18
4
votes
1 answer

ocamlbuild: build plugin with options

I'm trying to write an ocamlbuild plugin (myocamlbuild.ml) that will use definitions from another file. I have a lot of definitions that I'd like to be used across several build plugins and I wanted put them in their own file. I tried running…
Gregory
  • 1,205
  • 10
  • 17
4
votes
3 answers

Using "ocamlfind" to make the OCaml compiler and toplevel find (project specific) libraries

I'm trying to use ocamlfind with both the OCaml compiler and toplevel. From what I understood, I need to place the required libraries in the _tags file at the root of my project, so that the ocamlfind tool will take care of loading them - allowing…
CharlieP
  • 993
  • 7
  • 19
4
votes
2 answers

Using Batteries in .mly file with ocamlbuild

I have a project with OCaml .ml files and a Menhir .mly file. I use ocamlbuild to compile the project. My _tags file contains this single line: true: use_menhir, package(batteries) Everything works well, except when I want to use Batteries in the…
p4bl0
  • 3,846
  • 1
  • 22
  • 21
4
votes
1 answer

Setting up an Ocaml library using 'ocamlfind install' and then using the library in ocamlbuild

I followed the instructions here for setting installing a library in site-lib using ocamlfind install. I had two libraries: one called logic and another called boolean. In each case I installed the .cmo, .cmx, .cmi and .mli files in the library,…
aneccodeal
  • 8,531
  • 7
  • 45
  • 74
3
votes
2 answers

I've got hardcoded paths in my Makefile - how to use ocamlfind to eliminate those? (or how to use ocamlbuild or omake instead)

I'm trying to build an ocaml project which requires a camlp4 extension (pa_deriving in this case). Here's my Makefile: include ./Makefile.config OCAMLC := ${OCAMLFIND} ocamlc OCAMLOPT := ${OCAMLFIND} ocamlopt OCAMLDEP := ${OCAMLFIND}…
aneccodeal
  • 8,531
  • 7
  • 45
  • 74
3
votes
1 answer

OCamlbuild and Building Native Dynamic Linked Library

I posted a question on the ocaml listserv that nobody responded to, I'm hoping someone here can either call me an idiot, confirm the situation, or offer up a creative solution. When building a dynamic library through ocamlbuild I get stuck on the…
nlucaroni
  • 47,556
  • 6
  • 64
  • 86
3
votes
1 answer

ocamlbuild links libraries in wrong order

I'm somehow trying to use _CoqProject parser from coq's library in OCaml (I'd welcome better alternatives to grab the .v files of a coq project if that library is not meant for external use, is it?), but ocamlbuild seems to be linking libraries in…
Li-yao Xia
  • 31,896
  • 2
  • 33
  • 56
3
votes
2 answers

Don't Link all Standard Library Modules when Compiling OCaml

I'm putting together an intro OCaml project for a CS class and part of it involves implementing list operations. I want them to be able to use Pervasives, but not List or any other standard library modules. Is there a way to set up ocamlbuild so it…
SaxSalute
  • 349
  • 2
  • 8
3
votes
1 answer

Is there such thing as incremental build for OCaml?

Is there any tool that I can use to get the kind of incremental build like those from Eclipse/IntelliJ/Visual Studio?
Chris
  • 953
  • 11
  • 16
3
votes
1 answer

Ignore OCaml interfaces with OCamlbuild

I have a large library and I would like to create a target that packs all of the modules but ignores the .mli files that are present in the source directory. Is there a simple way of using ocamlbuild via a plugin or special set of _tags that could…
LeonidR
  • 117
  • 8
3
votes
1 answer

Building library with ocamlbuild, installing it with ocamlfind - what's the best practice?

I'm using ocamlbuild to compile an OCaml library via a mylib.mllib file that lists the modules comprising the library. Afterwards I want to install the library files using ocamlfind. Unlike binary files built with ocamlbuild, all the library files…
Christian Lindig
  • 1,216
  • 1
  • 9
  • 24
3
votes
1 answer

OCaml to Java translation

I have nice OCaml code (30000 lines apox). I want to port it to Java. So Is there any free OCaml to Java translator? I need it as my own project is in Java and i'm also comfortable with java, but in project I've to use the OCaml code, i don't want…
Imran
  • 5,376
  • 2
  • 26
  • 45
1 2
3
10 11