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
1
vote
1 answer

Module packs with ocamlbuild

I have the following file hierarchy: foo.mlpack Foo/ bar.ml baz.ml foo.ml and I want to be able to do the following: let () = Foo.Bar.some_func1 (); Foo.Baz.some_func2 (); Foo.some_func3 () How can I tell ocamlbuild to take foo.ml into…
Antoine
  • 1,782
  • 1
  • 14
  • 32
1
vote
2 answers

ocamlbuild and OUnit

I have a project structured like this: Makefile src/ main.ml tests/ tests.ml and the Makefile is something like this: tests: ocamlbuild -Is src,tests tests.byte -build-dir $(BUILDDIR) $(TESTFLAGS) -lflags -I,/usr/lib/ocaml/oUnit -cflags…
snim2
  • 4,004
  • 27
  • 44
1
vote
1 answer

OCaml how to build statically project

I've to prepare my OCaml project to compile/link/run on system where some libraries are not availible (yojson, curl, cryptokit but it's probably not so important) how may I do it? So far I was using: $ ocamlbuild -use-ocamlfind -pkgs…
1
vote
2 answers

ocamlbuild include extra packages

I am working through the LLVM ocaml tutorial, and using the following command line to compile: ocamlbuild -cflags -g,-I,+llvm-3.4 -lflags -I,+llvm-3.4 toy.byte Is there any way to move those extra cflags and lflags into the _tags or myocamlbuild.ml…
brooks94
  • 3,836
  • 4
  • 30
  • 57
1
vote
2 answers

Module case name confusion

I made the mistake of updating software and now I can't run any OUnit tests. I think I've managed to boil the problem down to a simple REPL session. $ ocaml -I /opt/local/lib/ocaml/site-lib/oUnit OCaml version 4.01.0 #…
Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
1
vote
1 answer

How does the OCaml compiler deal with this code?

I read a project written in OCaml and can't figure out some source code here: type 'a node = {mutable parent: 'a node; mutable rank: int; label: 'a} let singleton x = let rec n = {parent=n; rank=0; label=x} in n This code is part of the…
KUN
  • 527
  • 4
  • 18
1
vote
1 answer

integer range error in OCaml

Recently I have to read some source code written in OCaml. And I start to read the source code after reading materials about OCaml. When I compile the source code, there's something wrong. The part which the compiler says wrong is below: let b = [|…
KUN
  • 527
  • 4
  • 18
1
vote
1 answer

Make OcaIDE work in Eclipse on Mac

After days of trying to get this to work on my own, I had to stop wasting time and finally ask for help. I run Mavericks on my iMac. I have installed Eclipse[Version: Kepler Service Release 1] and the OcaIDE plugin. All my paths are filled in by…
emi
  • 2,830
  • 5
  • 31
  • 53
1
vote
3 answers

How can I write a library in OCaml?

I am writing a bson encoder/decoder library in ocaml. I have the source file now (actually just one file). My question is that how should I make it as a library, such as ocaml-batteries-included, camomile, etc? I mean, people can use opam install…
Jackson Tale
  • 25,428
  • 34
  • 149
  • 271
1
vote
1 answer

Error: Dynamic link not supported when linking ocaml project under Lion 10.7

I hope that's the right place to my question. Actually I'm coq user and I'm trying to implement a new tactic using ocaml under "Mac OS X Lion 10.7.4 ". I have installed all the libraries that I may need it. After compiling my ocaml file and when I…
0
votes
1 answer

Ocamlfind cannot find package 'zmq'

I was trying to compile Ocaml tools as part of the Quantum Package 2. The error prompts me [2/3] Compiling OCaml tools make: Entering directory '/home/parallels/qp2/ocaml' ocamlbuild -j 0 -cflags "-g" -lflags "-g" -ocamlopt "opt -O3…
chikako
  • 1
  • 1
0
votes
1 answer

How to use go-to-definition with ocamlbuild on VS code?

I am trying to explore the project: https://github.com/kupl/VeriSmart-public. I am trying to use the go-to-definition feature of VS code but it is not working even with the offical Ocaml extension installed. I've installed opam and used switch ocaml…
0
votes
1 answer

Why is there this dune build error? 'cannot find -lz'

I am trying to build a project with this dune file: src/lib/precomputed_values/gen_values/dune: (executable (name gen_values) (flags -w -32) (libraries ;; opam libraries stdio async_kernel compiler-libs core_kernel ppxlib …
0
votes
1 answer

debugging code with menhir and ocamlbuild

I am implementing a small programming language. Here is the codebase. The program is built with ocamlbuild. I added a parser using menhir. When I compile and run the program, I got the following message. ❱ ./main.byte Fatal error: exception…
Kabocha Porter
  • 301
  • 3
  • 8
0
votes
1 answer

Logistic Regression in OCaml

I was trying to use Logistic regression in OCaml. I need to use it as a blackbox for another problem I'm solving. I found the following site: http://math.umons.ac.be/anum/en/software/OCaml/Logistic_Regression/ I pasted the following code (with a few…
Anon
  • 381
  • 1
  • 2
  • 13