Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] toplevel with threads
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] toplevel with threads
From: Steve Elkins <>

> Will someone please explain what I'm doing wrong, or tell me my build
> is broken, or enlighten me somehow.  I'm having trouble using threads
> in toplevels, but not when I compile to bytecode.
>   sge:346$ ocamlmktop -custom -o strocaml str.cma                      

Which architecture (OS) are you working with?
Since ocaml 3.04, you don't need to build custom toplevels on
architectures where dynamic loading is supported.

$ ocaml
        Objective Caml version 3.04

# #load"str.cma";;
# Str.regexp;;
- : string -> Str.regexp = <fun>

This also works for threads, but not always:

$ ocaml -I +threads
        Objective Caml version 3.04

# #load"unix.cma";;
# #load"threads.cma";;

>   sge:350$ ./throcaml
>           Objective Caml version 3.04
>   # Thread.create;;
>   Unbound value Thread.create

You need to add the +threads directory to your load path:
$ ./throcaml -I +threads


Jacques Garrigue
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: