* ocamlbuild is VERY nifty
@ 2007-03-07 15:53 Joel Reymont
2007-03-07 20:55 ` [Caml-list] beta-test of OCaml 3.10.0 Jon Harrop
2007-03-13 18:38 ` [Caml-list] ocamlbuild is VERY nifty Aleksey Nogin
0 siblings, 2 replies; 5+ messages in thread
From: Joel Reymont @ 2007-03-07 15:53 UTC (permalink / raw)
To: Caml List
I asked around before settling on a build system since I'm new to
OCaml. I looked at OMake, OCamlMakefile and found them complex and
confusing. Then William Neuman pointed me to ocamlbuild and Nicolas
Pouillard helped me hook it up to external libraries via a plugin.
Deep into my first project I confirm that ocamlbuild is VERY nifty. I
can automatically rebuild when any parts of my project change and
then run my unit tests.
All I need to do is:
ocamlbuild test.byte --
*** my project ***
189 easy.mli
282 easy_lexer.mll
420 easy_parser.mly
17 myocamlbuild.ml
14 parser_util.ml
30 symtab.ml
8 test.ml
284 parser_test.ml
1355 total
*** test.ml ***
open OUnit
let suite = "Morpher" >:::
[Parser_test.suite]
let _ =
run_test_tt_main suite
*** myocamlbuild.ml ***
open Ocamlbuild_plugin;;
open Command;;
let packages = "ounit" (* "pkg1,pkg2,..." *);;
let ocamlfind cmd =
S[A"ocamlfind"; A cmd; A"-package"; A packages];;
flag ["ocaml"; "link"] (A"-linkpkg");;
dispatch begin function
| After_options ->
Options.ocamlc := ocamlfind "ocamlc";
Options.ocamlopt := ocamlfind "ocamlopt";
| _ -> ()
end
--
http://wagerlabs.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] beta-test of OCaml 3.10.0
2007-03-07 15:53 ocamlbuild is VERY nifty Joel Reymont
@ 2007-03-07 20:55 ` Jon Harrop
2007-03-13 18:38 ` [Caml-list] ocamlbuild is VERY nifty Aleksey Nogin
1 sibling, 0 replies; 5+ messages in thread
From: Jon Harrop @ 2007-03-07 20:55 UTC (permalink / raw)
To: caml-list
On Wednesday 07 March 2007 15:53, Joel Reymont wrote:
> Deep into my first project I confirm that ocamlbuild is VERY nifty.
Excellent news. Make just can't hack it when things get non-trivial and I'm
bored of recompiling everything all the time, even if ocamlopt is a million
times faster than gcc. :-)
Here are my results (timings are old vs new) for my 2.2GHz AMD64x2:
OCaml itself still doesn't parallel build but serial builds in around 4mins.
Ray tracer builds fine: 3.963s vs 4.000s run time
n-th nearest neighbour example from OFS builds and runs fine: 8.142s vs 8.320s
Smoke builds fine and runs fine: 12.39s vs 11.56s build time, 68.5fps vs
72.5fps running speed
Presenta builds fine: 39.354s vs 39.524s
I've only had one problem and I'm not sure if that is due to the new version
of ocamlopt: Presenta screws up font rendering when using the experimental
stencil buffer code instead of the usual GLU tesselator code.
So my conclusion is that 3.10 looks fine. Compile times are slightly faster in
some cases. Running times are basically indifferent.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] ocamlbuild is VERY nifty
2007-03-07 15:53 ocamlbuild is VERY nifty Joel Reymont
2007-03-07 20:55 ` [Caml-list] beta-test of OCaml 3.10.0 Jon Harrop
@ 2007-03-13 18:38 ` Aleksey Nogin
2007-03-16 13:46 ` Joel Reymont
1 sibling, 1 reply; 5+ messages in thread
From: Aleksey Nogin @ 2007-03-13 18:38 UTC (permalink / raw)
To: Joel Reymont; +Cc: Caml List
On 07.03.2007 07:53, Joel Reymont wrote:
> I asked around before settling on a build system since I'm new to OCaml.
> I looked at OMake, OCamlMakefile and found them complex and confusing.
Well, it should have been equally easy to use OMake in this case - while
it is true that OMake is complex, the complexity is only there to help
you out when you need it; you can safely ignore it until then.
If I understand what you are doing here correctly, it would have been
sufficient to just use the following OMakefile:
---------
# Optional - use bytecode compilation even when ocamlopt is available
NATIVE_ENABLED = false
BYTE_ENABLED = true
USE_OCAMLFIND = true
OCAMLPACKS[] = ounit
.DEFAULT: $(OCamlProgram test, test easy easy_lexer easy_parser
parser_util symtab parser_test)
-------
and then simply running "omake" would do what you want.
> Then William Neuman pointed me to ocamlbuild and Nicolas Pouillard
> helped me hook it up to external libraries via a plugin.
>
> Deep into my first project I confirm that ocamlbuild is VERY nifty. I
> can automatically rebuild when any parts of my project change and then
> run my unit tests.
>
> All I need to do is:
>
> ocamlbuild test.byte --
>
> *** my project ***
>
> 189 easy.mli
> 282 easy_lexer.mll
> 420 easy_parser.mly
> 17 myocamlbuild.ml
> 14 parser_util.ml
> 30 symtab.ml
> 8 test.ml
> 284 parser_test.ml
> 1355 total
>
> *** test.ml ***
>
> open OUnit
>
> let suite = "Morpher" >:::
> [Parser_test.suite]
>
> let _ =
> run_test_tt_main suite
>
> *** myocamlbuild.ml ***
>
> open Ocamlbuild_plugin;;
> open Command;;
>
> let packages = "ounit" (* "pkg1,pkg2,..." *);;
>
> let ocamlfind cmd =
> S[A"ocamlfind"; A cmd; A"-package"; A packages];;
>
> flag ["ocaml"; "link"] (A"-linkpkg");;
>
> dispatch begin function
> | After_options ->
> Options.ocamlc := ocamlfind "ocamlc";
> Options.ocamlopt := ocamlfind "ocamlopt";
> | _ -> ()
> end
>
> --
> http://wagerlabs.com/
>
>
>
>
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] ocamlbuild is VERY nifty
2007-03-13 18:38 ` [Caml-list] ocamlbuild is VERY nifty Aleksey Nogin
@ 2007-03-16 13:46 ` Joel Reymont
2007-03-16 17:01 ` Aleksey Nogin
0 siblings, 1 reply; 5+ messages in thread
From: Joel Reymont @ 2007-03-16 13:46 UTC (permalink / raw)
To: Aleksey Nogin; +Cc: Caml List
Aleksey,
I'm trying to build my project as you suggested but I get this error
*** omake error:
File /usr/local/lib/omake/build/OCaml.om: line 1027, characters 8-53
Do not know how to build "easy.cmo" required for "test.run"
I only have easy.mli and no easy.ml, should I exclude easy from the
build list below?
Thanks, Joel
On Mar 13, 2007, at 6:38 PM, Aleksey Nogin wrote:
> # Optional - use bytecode compilation even when ocamlopt is available
> NATIVE_ENABLED = false
> BYTE_ENABLED = true
>
> USE_OCAMLFIND = true
> OCAMLPACKS[] = ounit
>
> .DEFAULT: $(OCamlProgram test, test easy easy_lexer easy_parser
> parser_util symtab parser_test)
--
http://wagerlabs.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] ocamlbuild is VERY nifty
2007-03-16 13:46 ` Joel Reymont
@ 2007-03-16 17:01 ` Aleksey Nogin
0 siblings, 0 replies; 5+ messages in thread
From: Aleksey Nogin @ 2007-03-16 17:01 UTC (permalink / raw)
To: Joel Reymont; +Cc: Caml List, omake
Joel,
I think this was already brought up on the Caml list - it is the basic
OCaml assumption, I believe, that you should not have an .mli without
.ml. OMake makes the same assumption. If you do need the Easy module,
you should have easy.ml. If your easy.mli only defines new types and/or
signatures, you should be able to simply rename easy.mli into easy.ml.
Hope this helps.
Aleksey
On 16.03.2007 06:46, Joel Reymont wrote:
> Aleksey,
>
> I'm trying to build my project as you suggested but I get this error
>
> *** omake error:
> File /usr/local/lib/omake/build/OCaml.om: line 1027, characters 8-53
> Do not know how to build "easy.cmo" required for "test.run"
>
> I only have easy.mli and no easy.ml, should I exclude easy from the
> build list below?
>
> Thanks, Joel
>
> On Mar 13, 2007, at 6:38 PM, Aleksey Nogin wrote:
>
>> # Optional - use bytecode compilation even when ocamlopt is available
>> NATIVE_ENABLED = false
>> BYTE_ENABLED = true
>>
>> USE_OCAMLFIND = true
>> OCAMLPACKS[] = ounit
>>
>> .DEFAULT: $(OCamlProgram test, test easy easy_lexer easy_parser
>> parser_util symtab parser_test)
>
> --
> http://wagerlabs.com/
>
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-03-16 17:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-07 15:53 ocamlbuild is VERY nifty Joel Reymont
2007-03-07 20:55 ` [Caml-list] beta-test of OCaml 3.10.0 Jon Harrop
2007-03-13 18:38 ` [Caml-list] ocamlbuild is VERY nifty Aleksey Nogin
2007-03-16 13:46 ` Joel Reymont
2007-03-16 17:01 ` Aleksey Nogin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox