caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlfind and ocaml*.opt tools
@ 2013-09-09  8:51 Matej Kosik
  2013-09-09  8:57 ` Daniel Bünzli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matej Kosik @ 2013-09-09  8:51 UTC (permalink / raw)
  To: caml-list

Hello,

Inspired by the recent `Accelerating compilation' discussion, I have installed the *.opt version of the compilers

  apt-get install ocaml-native-compilers

What is the right way to invoke, say ocamlc.opt via ocamlfind?

  ocamlfind c -c -g -o foo.cmi foo.mli

works but I guess ocamlfind invokes here ocamlc (not ocamlc.opt, even if it is installed).

Attempts like these:

  ocamlfind c.opt -c -g -o foo.cmi foo.mli
  ocamlfind ocamlc.opt -c -g -o foo.cmi foo.mli

fail because "c.opt" and "ocamlc.opt" are not recognized as ocamlfind commands.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ocamlfind and ocaml*.opt tools
  2013-09-09  8:51 [Caml-list] ocamlfind and ocaml*.opt tools Matej Kosik
@ 2013-09-09  8:57 ` Daniel Bünzli
  2013-09-09  9:15 ` Maxence Guesdon
  2013-09-09 14:23 ` Stéphane Glondu
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Bünzli @ 2013-09-09  8:57 UTC (permalink / raw)
  To: Matej Kosik; +Cc: caml-list


Le lundi, 9 septembre 2013 à 09:51, Matej Kosik a écrit :
> What is the right way to invoke, say ocamlc.opt via ocamlfind?


Don't know if it's the right way. But this should work:

Do   

> ocamlfind printconf  

This should indicate you the location of `findlib.conf` in which you can set the tools to invoke e.g.:

> cat /Users/dbuenzli/.opam/4.00.1/lib/findlib.conf  
destdir="/Users/dbuenzli/.opam/4.00.1/lib"
path="/Users/dbuenzli/.opam/4.00.1/lib"
ocamlc="ocamlc.opt"
ocamlopt="ocamlopt.opt"
ocamldep="ocamldep.opt"
ocamldoc="ocamldoc.opt">  



N.B. this happened to me automatically, so maybe if you install the opt compiler first and then ocamlfind, its install procedure is able to infer the right findlib.conf.  

Best,

Daniel



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ocamlfind and ocaml*.opt tools
  2013-09-09  8:51 [Caml-list] ocamlfind and ocaml*.opt tools Matej Kosik
  2013-09-09  8:57 ` Daniel Bünzli
@ 2013-09-09  9:15 ` Maxence Guesdon
  2013-09-09 14:23 ` Stéphane Glondu
  2 siblings, 0 replies; 4+ messages in thread
From: Maxence Guesdon @ 2013-09-09  9:15 UTC (permalink / raw)
  To: caml-list

On Mon, 09 Sep 2013 09:51:23 +0100
Matej Kosik <5764c029b688c1c0d24a2e97cd764f@gmail.com> wrote:

> Hello,
> 
> Inspired by the recent `Accelerating compilation' discussion, I have installed the *.opt version of the compilers
> 
>   apt-get install ocaml-native-compilers
> 
> What is the right way to invoke, say ocamlc.opt via ocamlfind?
> 
>   ocamlfind c -c -g -o foo.cmi foo.mli
> 
> works but I guess ocamlfind invokes here ocamlc (not ocamlc.opt, even if it is installed).
> 
> Attempts like these:
> 
>   ocamlfind c.opt -c -g -o foo.cmi foo.mli
>   ocamlfind ocamlc.opt -c -g -o foo.cmi foo.mli
> 
> fail because "c.opt" and "ocamlc.opt" are not recognized as ocamlfind commands.

You can set the OCAMLFIND_COMMANDS environment variable, for example
to use ocamloptp instead of ocamlopt and ocamldoc.opt instead of
ocamldoc:

export OCAMLFIND_COMMANDS="ocamlopt=ocamloptp,ocamldoc=ocamldoc.opt"

See "man ocamlfind".

- Maxence

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] ocamlfind and ocaml*.opt tools
  2013-09-09  8:51 [Caml-list] ocamlfind and ocaml*.opt tools Matej Kosik
  2013-09-09  8:57 ` Daniel Bünzli
  2013-09-09  9:15 ` Maxence Guesdon
@ 2013-09-09 14:23 ` Stéphane Glondu
  2 siblings, 0 replies; 4+ messages in thread
From: Stéphane Glondu @ 2013-09-09 14:23 UTC (permalink / raw)
  To: Matej Kosik; +Cc: caml-list

Le 09/09/2013 10:51, Matej Kosik a écrit :
> Inspired by the recent `Accelerating compilation' discussion, I have installed the *.opt version of the compilers
> 
>   apt-get install ocaml-native-compilers
> 
> What is the right way to invoke, say ocamlc.opt via ocamlfind?
> 
>   ocamlfind c -c -g -o foo.cmi foo.mli
> 
> works but I guess ocamlfind invokes here ocamlc (not ocamlc.opt, even if it is installed).

You can do more than guessing:

$ ocamlfind ocamlc -verbose foo.ml
Effective set of compiler predicates: autolink,byte
+ ocamlc.opt -verbose foo.ml


Cheers,

-- 
Stéphane


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-09 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-09  8:51 [Caml-list] ocamlfind and ocaml*.opt tools Matej Kosik
2013-09-09  8:57 ` Daniel Bünzli
2013-09-09  9:15 ` Maxence Guesdon
2013-09-09 14:23 ` Stéphane Glondu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).