Questions tagged [ocaml-dune]

Use for questions relating to dune, previously jbuilder, a build system for [ocaml] and [reason]

Dune is a build system for and .

Resources

96 questions
1
vote
1 answer

How to require a module in jane street Ocaml

I'm working through http://dev.realworldocaml.org/records.html and am having a problem with require #require "re.posix";; (* open Base ;; open Core ;; *) (* type = { : ; : ; } *) type…
LeftN
  • 37
  • 1
  • 5
1
vote
2 answers

Unable to build a program using lablgtk2 with jbuilder

I would like to use jbuilder when compiling with lablgtk2 but I am having problems getting these error messages: File "_none_", line 1: Error: No implementations provided for the following modules: Thread referenced from…
1
vote
1 answer

jbuilder install fails: no opam-installer tool

I am trying to run jbuilder install to install opam packages that I just built using jbuilder build @install (which generated a bunch of *.install files for me). However, I get the following error: $ jbuilder install Sorry, you need the…
plafer
  • 185
  • 12
0
votes
1 answer

Static linking of library into a dynamically-linked binding with OCaml's dune

I have an OCaml library that has a C binding. The C binding has a dependency on a native component that I would like to also build with dune. At the moment, the dune file looks like: (rule (deps (source_tree vendor)) (targets libexample.a) …
namesis
  • 157
  • 10
0
votes
1 answer

Unbound Module when using Dream eml pre-processor

I'm trying to learn OCaml by way of building a website with this lovely library I found called Dream (https://aantron.github.io/dream/), but I've run into an issue when trying to work with the template preprocessor! My code is copied straight from…
0
votes
1 answer

How to structure project for testing in dune

I've created an OCaml project using dune with the intent of running through these exercises: dune init project ocaml_exercises I've then created two lib files, last.ml and last_two.ml which contain one function a piece: let rec last list = match…
ScottishTapWater
  • 3,656
  • 4
  • 38
  • 81
0
votes
0 answers

Using dune to copy files from one directory to another

I know about the copy_files stanza, but I'm stuck trying to copy files from one subdirectory to another (e.g. the root). Specifically, I'm trying to copy %{workspace_root}/static/ to _build/default/ instead of _build/default/static. Doing so from…
s1gtrap
  • 162
  • 2
  • 10
0
votes
1 answer

What does (depends ...) in dune-project do?

I wanted to specify the versions of my dependencies in my dune-project file explicitly, to avoid any breakages due to newer versions (in the same way I might list Java dependencies in a Gradle build file, if that means anything to you). The…
ndc85430
  • 1,395
  • 3
  • 11
  • 17
0
votes
1 answer

Can't compile an OCaml program that uses sqlite3 module using dune

I wanted to test the Sqlite3 bindings in OCaml. I have downloaded the appropriate package with opam, it works fine using utop. I have tested it like this: #use "topfind";; #require "sqlite3";; #show Sqlite3;; open Sqlite3 let db = db_open…
zajer
  • 649
  • 6
  • 17
0
votes
2 answers

How to include contents of a directory in Ocaml?

How do you include a file's content / module from a directory in Ocaml ? └── bin ├── file_1.ml └── directory └── file_2.ml In this example, how do you access file_2 contents in file_1. I can't figure it out, even though it seems…
Dav
  • 17
  • 4
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

foreign non-C library

I want to use a library built as a .a file in my dune project (exposing some needed functions...), but the dune documentation specifies only how to use foreign C code. How can one use a non-C built library with dune? What I am currently trying to do…
0
votes
1 answer

OCaml v5.0, "Module `Str' is unavailable"

Im trying to use the Ocaml Str library in Ocaml v5.0 (for regexp) by importing using "open Str" but I keep getting this error "Module `Str' is unavailable" followed by this alert " OCaml's lib directory layout changed in 5.0. The str subdirectory…
0
votes
1 answer

Calculating height of a logical expression

I have a task of calculating the height of a logical expression (like a∧(b∨c)). I have an algorithm, however there is a mistake that causes 2 errors this function application is partial This expression has type int * int -> int * int but an…
PRO grmr
  • 1
  • 1
0
votes
0 answers

Does this github action workflow contain redundant steps?

Writing github workflow files is for me a tedious, error prone, exhausting and time consuming task. For that reason, I have a lot of github workflow files that are monstruosities born from random copy paste, or that were modified from some random…
Danielo515
  • 5,996
  • 4
  • 32
  • 66