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

Make ocamlbuild ignore dirs

Is there a way to tell ocamlbuild to not go into some dirs? I have the _tags with the following inside: or : include But ocamlbuild is saying that there are some .dlls in dir3 (refusing to build until I clean them), which should not be…
k4cho
  • 65
  • 3
2
votes
1 answer

OCamlbuild and camlp4.macro

I have a project where several of the OCaml source files use IFDEF. Is there a simple way to tell OCamlbuild that all .ml files for this project should be preprocessed by camlp4.macro?
Jon Smark
  • 2,528
  • 24
  • 31
1
vote
2 answers

Makefile with coqtop -R coqdir

I have a makefile: Add the command: coqtop -R coqdir I have to give a physical path in my computer, but this directory depends on user directory. (~/color/trunk/color/devel/gwen Devel and ~/color/trunk/color CoLoR). Is there another way to call and…
Quyen
  • 1,363
  • 1
  • 11
  • 21
1
vote
0 answers

build failing on Mac M1 for open ssl ( with killed: 9 error )

I am building an application written in OCaml using yarn and esy. The build process fails trying to build open ssl source code, each time at a random library ( like dsa etc ). For my colleagues using Intel chips, the app builds fine. I am using a…
1
vote
1 answer

How to force ocamlbuild using already built obj-files if two different targets compiled serially

I have two different ml-targets, which should be compiled to native code. Both targets are sharing some modules. The problem is, if I run "ocamlbuild targetA" the modules C, D and E are compiled to object code. But when I run than "ocamlbuild…
Andreas Romeyke
  • 333
  • 2
  • 8
1
vote
1 answer

Dealing with C code dependencies inside OCaml projects

I'm using ocamlbuild to build my OCaml project that uses an external C library "cstub". I found a very solution online to include the C library in the compilation process using ocamlbuild in…
user2347300
  • 39
  • 1
  • 1
  • 6
1
vote
2 answers

Unbound Module Stdlib

I am trying to build code using ocamlc however, I got error Error: Unbound module Stdlib The /usr/lib/ocaml/ directory includes the following stdlib.a stdlib.cma stdlib.cxma stdlib.p.a stdlib.p.cxma OCaml version : 4.05.0
Hazem Abaza
  • 331
  • 4
  • 21
1
vote
1 answer

How to include dependencies from another directory with ocamlbuild?

I'm writing an OCaml program that I want to be organized, so I have this directory structure: src |- folder1 | |- a.ml |- folder2 | |- b.ml Note: b.ml uses open A to reference a.ml. I want to test my code to see if it works. I have…
1
vote
2 answers

OCaml call to Dynlink causes seg fault

I have an OCaml program that writes another OCaml program, compiles it and then tries to dynamically load it. Unfortunately this causes a segmentation fault on my OSX 10.14 machine, OCaml 4.07.1. In particular my program is structured as…
Nick
  • 27
  • 3
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
0 answers

Fatal error: unknown C primitive `Base_am_testing'

After building Flow with make like make build-flow-debug and running it with ocamlrun like ocamlrun bin/flow check local-test/test.js I'm getting following error Fatal error: unknown C primitive `Base_am_testing' I think the error has something to…
Ville
  • 464
  • 4
  • 14
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

ocamlc - compiling ocaml-wasm - Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file

I'm trying to make install ocaml-wasm 1. Unfortunately the build is failing with the error-message: Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file Here's a Dockerfile so you may reproduce the error: FROM base/archlinux RUN pacman…
ambiso
  • 559
  • 3
  • 10
1
vote
1 answer

Tell ocamlbuild where to find module

I have an OCaml project, for which I use ocamlbuild. In this project, I have two subprojects, subproject1 and subproject2. subproject2 needs to use a module called Module from subproject1. To sum up, I have the following structure: project/ | |--…
Right leg
  • 16,080
  • 7
  • 48
  • 81
1
vote
1 answer

how can I use ocamlopt instead of ocamldep when using pflag in myocamlbuild?

I have written a myocamlbuild.ml after this manual containing the following code in order to not to have to enter in command line some flags each time compiling a test written with alcotest like ocamlbuild -use-ocamlfind -package alcotest…
Morin
  • 93
  • 7