Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: bouyssou@gate.didac-mip.fr (Olivier Bouyssou)
Cc: caml-list@inria.fr
Subject: Re: Native thread in O'Caml 1.06
Date: Wed, 19 Nov 1997 16:46:26 +0100 (MET)	[thread overview]
Message-ID: <199711191546.QAA19508@pauillac.inria.fr> (raw)
In-Reply-To: <199711191247.NAA29159@gate.didac-mip.fr> from Olivier Bouyssou at "Nov 19, 97 01:47:57 pm"

> I've a problem using threads with ocamlopt v 1.06.
> ocamlopt doesn't know -thread option.
> There is no native lib in $(LIBDIR)/threads

Your're right, the installation of otherlibs/systhreads is broken in
release 1.06.  The patch below (against the 1.06 distribution) fixes
the problem.  Just apply it, do "make clean" in otherlibs/systhreads,
and "make all opt install" in the toplevel directory.

Note also that you'll need to add "-cclib -lunix" on the command-line
when linking with that version of the threads library.

Sorry for the inconvenience,

- Xavier Leroy

Index: ocaml/driver/optcompile.ml
diff -c ocaml/driver/optcompile.ml:1.22 ocaml/driver/optcompile.ml:1.23
*** ocaml/driver/optcompile.ml:1.22	Fri Aug 22 10:55:38 1997
--- ocaml/driver/optcompile.ml	Tue Nov 18 18:14:53 1997
***************
*** 9,15 ****
  (*                                                                     *)
  (***********************************************************************)
  
! (* $Id: optcompile.ml,v 1.22 1997/08/22 08:55:38 xleroy Exp $ *)
  
  (* The batch compiler *)
  
--- 9,15 ----
  (*                                                                     *)
  (***********************************************************************)
  
! (* $Id: optcompile.ml,v 1.23 1997/11/18 17:14:53 xleroy Exp $ *)
  
  (* The batch compiler *)
  
***************
*** 24,31 ****
     then the standard library directory. *)
  
  let init_path () =
!   load_path :=
!     "" :: List.rev (Config.standard_library :: !Clflags.include_dirs);
    Env.reset_cache()
  
  (* Return the initial environment in which compilation proceeds. *)
--- 24,35 ----
     then the standard library directory. *)
  
  let init_path () =
!   let dirs =
!     if !Clflags.thread_safe then
!      Filename.concat Config.standard_library "threads" :: !Clflags.include_dirs
!     else
!      !Clflags.include_dirs in
!   load_path := "" :: List.rev (Config.standard_library :: dirs);
    Env.reset_cache()
  
  (* Return the initial environment in which compilation proceeds. *)
Index: ocaml/driver/optmain.ml
diff -c ocaml/driver/optmain.ml:1.29 ocaml/driver/optmain.ml:1.30
*** ocaml/driver/optmain.ml:1.29	Thu May 15 15:26:34 1997
--- ocaml/driver/optmain.ml	Tue Nov 18 18:14:54 1997
***************
*** 9,15 ****
  (*                                                                     *)
  (***********************************************************************)
  
! (* $Id: optmain.ml,v 1.29 1997/05/15 13:26:34 xleroy Exp $ *)
  
  open Config
  open Clflags
--- 9,15 ----
  (*                                                                     *)
  (***********************************************************************)
  
! (* $Id: optmain.ml,v 1.30 1997/11/18 17:14:54 xleroy Exp $ *)
  
  open Config
  open Clflags
***************
*** 84,89 ****
--- 84,90 ----
         "-pp", Arg.String(fun s -> preprocessor := Some s),
               "<command>  Pipe sources through preprocessor <command>";
         "-S", Arg.Set keep_asm_file, " Keep intermediate assembly file";
+        "-thread", Arg.Set thread_safe, " Use thread-safe standard library";
         "-unsafe", Arg.Set fast,
               " No bounds checking on array and string access";
         "-v", Arg.Unit print_version_number, " Print compiler version number";
Index: ocaml/otherlibs/systhreads/Makefile
diff -c ocaml/otherlibs/systhreads/Makefile:1.5 ocaml/otherlibs/systhreads/Makefile:1.7
*** ocaml/otherlibs/systhreads/Makefile:1.5	Mon Nov 17 14:04:15 1997
--- ocaml/otherlibs/systhreads/Makefile	Wed Nov 19 11:00:26 1997
***************
*** 6,12 ****
  BYTECODE_C_OBJS=posix_b.o
  NATIVECODE_C_OBJS=posix_n.o
  
! THREAD_OBJS=thread.cmo condition.cmo event.cmo threadUnix.cmo
  
  GENFILES=thread.ml
  
--- 6,12 ----
  BYTECODE_C_OBJS=posix_b.o
  NATIVECODE_C_OBJS=posix_n.o
  
! THREAD_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
  
  GENFILES=thread.ml
  
***************
*** 49,57 ****
  install:
  	cp libthreads.a $(LIBDIR)/libthreads.a
  	if test -d $(LIBDIR)/threads; then :; else mkdir $(LIBDIR)/threads; fi
! 	cp thread.cmi mutex.cmi condition.cmi event.cmi threadUnix.cmi threads.cma stdlib.cma $(LIBDIR)/threads
  
  installopt:
  
  .SUFFIXES: .ml .mli .cmo .cmi .cmx
  
--- 49,60 ----
  install:
  	cp libthreads.a $(LIBDIR)/libthreads.a
  	if test -d $(LIBDIR)/threads; then :; else mkdir $(LIBDIR)/threads; fi
! 	cp $(THREAD_OBJS:.cmo=.cmi) threads.cma $(LIBDIR)/threads
! 	rm -f $(LIBDIR)/threads/stdlib.cma
  
  installopt:
+ 	cp libthreadsnat.a $(LIBDIR)/libthreadsnat.a
+ 	cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.a $(LIBDIR)/threads
  
  .SUFFIXES: .ml .mli .cmo .cmi .cmx
  
Index: ocaml/otherlibs/systhreads/Makefile.nt
diff -c ocaml/otherlibs/systhreads/Makefile.nt:1.14 ocaml/otherlibs/systhreads/Makefile.nt:1.16
*** ocaml/otherlibs/systhreads/Makefile.nt:1.14	Mon Nov 17 14:04:15 1997
--- ocaml/otherlibs/systhreads/Makefile.nt	Wed Nov 19 11:00:47 1997
***************
*** 7,13 ****
  BYTECODE_C_OBJS=win32_b.obj
  NATIVECODE_C_OBJS=win32_n.obj
  
! THREAD_OBJS=thread.cmo condition.cmo event.cmo threadUnix.cmo
  
  GENFILES=thread.ml
  
--- 7,13 ----
  BYTECODE_C_OBJS=win32_b.obj
  NATIVECODE_C_OBJS=win32_n.obj
  
! THREAD_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
  
  GENFILES=thread.ml
  
***************
*** 50,58 ****
  install:
  	cp libthreads.lib $(LIBDIR)/libthreads.lib
  	if not exist $(LIBDIR)\threads mkdir $(LIBDIR)\threads
! 	cp thread.cmi mutex.cmi condition.cmi event.cmi threadUnix.cmi threads.cma $(LIBDIR)/threads
  
  installopt:
  
  .SUFFIXES: .ml .mli .cmo .cmi .cmx
  
--- 50,61 ----
  install:
  	cp libthreads.lib $(LIBDIR)/libthreads.lib
  	if not exist $(LIBDIR)\threads mkdir $(LIBDIR)\threads
! 	cp $(THREAD_OBJS:.cmo=.cmi) threads.cma $(LIBDIR)/threads
! 	rm -f $(LIBDIR)/threads/stdlib.cma
  
  installopt:
+ 	cp libthreadsnat.a $(LIBDIR)/libthreadsnat.a
+ 	cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.a $(LIBDIR)/threads
  
  .SUFFIXES: .ml .mli .cmo .cmi .cmx
  





      reply	other threads:[~1997-11-20  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-19 12:47 Olivier Bouyssou
1997-11-19 15:46 ` Xavier Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199711191546.QAA19508@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=bouyssou@gate.didac-mip.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox