1

Is it possible to use ocamldoc for a project with Threads without using ocamlfind? More importantly, how?

-thread or -package aren't supported by ocamldoc, and -I -thread doesn't work.

Théo Winterhalter
  • 4,908
  • 2
  • 18
  • 34

1 Answers1

1

-thread or -package aren't supported by ocamldoc, and -I -thread doesn't work.

Try with -I +threads instead. This will tell ocamldoc where to look for the thread library files.

On a side note, I use ocamlbuild for generating documentation, when I am already using it for my project builds (which is most of the time). With this tool, you only need to list all the documented ml files in a single .odocl file, and ask for the corresponding .docdir/index.html with the same parameters as a compilation command to get the documentation generated. If your project compiles with ocamlbuild, it should be able to generate documentation without hiccups with it as well.

$ ls src
foo.ml bar.ml baz.zip
$ ls -1 src/*.ml | cut -f1 -d'.' > project.odocl
$ cat project.odocl
src/foo
src/bar

$ ocamlbuild project.docdir/index.html
[...]
$ ls project.docdir
Bar.html
Foo.html
index.html
[...]
Chris
  • 26,361
  • 5
  • 21
  • 42
didierc
  • 14,572
  • 3
  • 32
  • 52
  • I meant it without ocamlfind (hence ocamlbuild) because it is not meant for me. Thanks though! – Théo Winterhalter Dec 31 '14 at 00:49
  • Ocamlbuild doesn't necessarily use ocamlfind. I have a couple of projects using threads and built with ocamlbuild, and they don't require ocamlfind AFAIK (though ocamlfind is a nice tool to have). – didierc Dec 31 '14 at 01:16