4 ms·
This is a very specific question but I thought I'd ask it here on the chance someone might have a good answer. I've been slowly working my way through this cou
by tgflynn 4y ago
This is a very specific question but I thought I'd ask it here on the chance someone might have a good answer.
I've been slowly working my way through this course and I ran into an issue recently when I upgraded my OCaml installation to the latest version (4.13.1). With this version I find that the simple instructions for building an executable with dune (especially one that uses OUnit) given here https://cs3110.github.io/textbook/chapters/data/ounit.html https://cs3110.github.io/textbook/chapters/data/ounit.html no longer work.
It seems dune now requires you to initialize a project. Does anyone know how to translate the instructions in the course to the current version of dune ?
I realize I could install an opam switch for the previous version but I'd rather be working with the latest one.
Just hoping someone might be able to save me an hour or so figuring this out on my own.
- shikoba 4y agoThe latest version is 4.14.0. Personally I write my Makefile myself and use them to build my projects. It works perfectly.
- octachron 4y agoYou can add a dune-project file at the root of your project with just `(lang dune 3.2)` (or your dune version rather than 3.2). The file can also be generated by "dune init project project_name" for fresh projects.
- tgflynn 4y agoThanks. It looks like all I needed was the project file. I was confused because when I followed the instructions to run dune init it created an entire directory structure and then I was confused about where my code should go (I haven't gotten to the chapter on modules yet).
- mc10 4y agoFYI: If you have more questions, the OCaml forum is very friendly and helpful: https://discuss.ocaml.org/ https://discuss.ocaml.org/