<olegfink>
those guys at Houston had to deal with something like that
struktured has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Yoric[DT] has joined #ocaml
munga has quit [Read error: 110 (Connection timed out)]
munga has joined #ocaml
GustNG has joined #ocaml
GustNG3 has quit [Read error: 110 (Connection timed out)]
tomh has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
Submarine has joined #ocaml
struktured_ has quit [Read error: 110 (Connection timed out)]
struktured_ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
guillem has quit [Remote closed the connection]
struktured__ has joined #ocaml
Snark has quit ["Ex-Chat"]
GustNG1 has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
struktured_ has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
Palace_Chan has joined #ocaml
jeremiah has joined #ocaml
DRMacIver has joined #ocaml
Submarine has quit [Read error: 110 (Connection timed out)]
<DRMacIver>
Is there something in the way of "Here's everything you need to know about building ocaml projects?" introduction. I'm trying to extract a library from an existing OCaml application and *cough* use it as a Ruby module, but my knowledge of OCaml is limited to mucking around in the REPL years ago
<DRMacIver>
I've more or less grasped the "use it as a Ruby module" part, but I'm a little confused by the plethora of file extensions and how to take an existing pile of source files and package it as a binary library.
<DRMacIver>
I seem to understand how to take a single source file and turn it into a Ruby module (I'm sure I'll fall on some of the details, but I'll figure those out), but I'm totally unfamiliar with the OCaml build ecosystem.
<DRMacIver>
So something like a "Here's how to create an OCaml project and package it as a library" tutorial or whatever would be fantastic. :) Failing that I'll try to just read the OCamlbuild documentation until things make sense.
<hcarty>
DRMacIver: Do you want to install the OCaml library for use from OCaml? I don't have any experience with rocaml
<DRMacIver>
hcarty: Yes
<hcarty>
DRMacIver: For installing, ocamlfind is probably the easiest way to go
<DRMacIver>
hcarty: My aim here is to have the main library compiled as some sort of binary which I can package and then write a small OCaml frontend which deals with the export to ruby
<hcarty>
ocamlfind install mymodule mymodule.cma mymodule.cmxa META ...
<DRMacIver>
hcarty: This seems to generate an arbitrarily large number of module files though (well, ok, not that large. But more than one. :) ). Am I able to bundle these together in some way?
<DRMacIver>
Sorry for the stupid questions. :)
<hcarty>
If the module is pure OCaml (no C or other languages) then ocamlbuild + ocamlfind is probably easiest
<hcarty>
They definitely are not stupid questions :-) A "holy crap where did all of these files come from" reaction is understandable.
<DRMacIver>
The module is pure OCaml. Hm. I suppose I could get the extconf.rb (script which handles the configuration of the external project) to manage compiling and installing it.
<DRMacIver>
I'm trying to think in terms of how to make this work for bundling the OCaml code in either source or compiled form, so just installing it on my local system isn't enough
<hcarty>
ocamlbuild could just as easily be used to handle the compilation. But the "install:" section of the Makefile should give help get an idea of which files to install
<DRMacIver>
There's actually already an ocamlbuild setup for the project.
<DRMacIver>
(For what it's worth, the project is hunpos. I'd like to be able to use its parts of speech tagging as a library)
<hcarty>
Generally, the .cmi, .cma, cmxa, .so and .a files are, I think, enough. The .cmo and .cmx files can also be useful for the compiler.
<DRMacIver>
Is there an explanation somewhere of what the different extensions do?
<DRMacIver>
I mean, some of them are standard, but I'm a little perplexed by cmi, cma, and cmxa. (the mli is an interface description for the module, right?)
<hcarty>
DRMacIver: That mailing list post has some explanation
seafood has joined #ocaml
<DRMacIver>
Oh, so it does. Sorry
<hcarty>
DRMacIver: .mli is the interface to a module; .cmi is (I think) a compiled .mli; .cma is a byte code library package; .cmxa is a native code library package
<DRMacIver>
ok
<hcarty>
Richard Jones' post has more detail
<hcarty>
DRMacIver: Sorry, here is a wiki page with (hopefully) more readable information from the above mailing list thread - http://ocaml-tutorial.org/filenames
<DRMacIver>
Ah, excellent. Thanks
<hcarty>
The object and library files should generally be installed, and the .mli files can be useful to provide for reference purposes
<DRMacIver>
ok
sporkmonger has quit []
marmotine has quit ["mv marmotine Laurie"]
<hcarty>
DRMacIver: I apologize for the convoluted explanation .. I hope it has helped
<DRMacIver>
I think so. And thanks very much for it. :) I'm playing around with ocamlfind and ocamlbuild now and will probably have more questions in a bit
<DRMacIver>
Hm. I think I might have communicated my problem not brilliantly. The issue isn't just that I have a single module and need to know how to package that. i.e. it's not just mymodule.{cmx, cmi, ...} I need to package. It's a multi-module project and I'm not sure how to package all the different ones together.
<hcarty>
DRMacIver: Will they all be packed in to one large module?
<DRMacIver>
Um. I think I only need the definitions in one module whcih uses all the rest
<DRMacIver>
Does that answer your question? I'm not sure what it means to pack multiple modules into one.
<hcarty>
Would the individual modules be used separately, or will they all be treated as pieces of a whole, never used on their own?
<DRMacIver>
Never used on their own
<DRMacIver>
There's basically one module I actually care about and all the rest are there to support it
<DRMacIver>
As far as I know they need never be referred to in source
Linktim_ has quit ["Quitte"]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
<hcarty>
DRMacIver: Then /I think/ only the resulting library needs to be installed
<DRMacIver>
Ok. I'm not entirely clear ony how to package it all as one library though.
<DRMacIver>
Some experimentation suggests that just distributing the output files for the final module doesn't do the job
<DRMacIver>
At least for the bytecode form it complains about missing references
<hcarty>
DRMacIver: If you are using ocamlbuild, you may need to create a mylib.mlpack and a _tags file. This may depend on how you are putting the modules together
itewsh has quit ["KTHXBYE"]
<DRMacIver>
Ah, ok. Thanks.
<Yoric[DT]>
Yep, you'll need that.
<Yoric[DT]>
Don't forget packing, unpacked modules are evil (and cause collisions).