From: Mauricio Fernandez Date: 2007-10-18T05:21:14+09:00 Subject: Re: rocaml 0.6.0: fast, easy Ruby extensions in Objective Caml On Thu, Oct 18, 2007 at 04:48:13AM +0900, Daniel Berger wrote: > On Oct 17, 1:10 pm, Daniel Berger wrote: > > On Oct 17, 9:31 am, Mauricio Fernandez wrote: > > > > > rocaml allows you to write Ruby extensions in Objective Caml. [...] > > I grabbed the latest and greatest Ocaml tarball and installed it. > > However, when I try to install rocaml I get this: > > > > sh: camlp5: not found > > *** extconf.rb failed *** > > > > I have no camlp5 in /usr/local/bin. I have camlp4, however, and the > > comments in rocaml_extconf.rb suggest that either should suffice. [...] > I decided to grab camlp5 (http://pauillac.inria.fr/~ddr/camlp5/) and > try again. The extconf.rb script succeeds now. However, now the make > fails: > > ocamldep.opt rubyOCamlUtil.ml > .depend > sh: ocamldep.opt: not found > *** Error code 1 > make: Fatal error: Command failed for target `.depend' > > I have ocamldep, but no ocamldep.opt. Where do I go from here? You didn't make opt.opt (or make world.opt) when you built ocaml-3.10.0, did you? (BTW, on Debian the .opt binaries are in ocaml-native-compilers, in case somebody is reading this) For the time being, you can just install the native-code compilers or hand-edit the generated Makefile; scroll down to ... ############################################################################# # # # Objective Caml # # # ############################################################################# OCAMLC = ocamlc.opt OCAMLOPT = ocamlopt.opt OCAMLDEP = ocamldep.opt OFLAGS = -pp 'camlp5o -I . pa_rocaml.cmo' OCAML_INCLUDES = OCAML_LIBS = nums.cmxa ... and remove the .opt extensions. I will add some code to detect whether the .opt binaries are available. One last thing; what's your platform? rocaml extensions might or might not work on AMD64 and OSX because their linkers aren't very smart (they can't handle non-PIC code, it seems). According to OCaml's 3.10.0 changelog, - Intel/AMD 64 bits: generate position-independent code by default. but I don't know if that's enough or something special must be done at compile time. The next Objective Caml release will feature dynamic loading of native code, so this won't remain a problem for long. Meanwhile, static extensions can be used. -- Mauricio Fernandez - http://eigenclass.org