From: Daniel Berger Date: 2007-10-19T06:59:29+09:00 Subject: Re: rocaml 0.6.0: fast, easy Ruby extensions in Objective Caml On Oct 18, 3:36 pm, Mauricio Fernandez wrote: > Congrats, it seems you got it to work :) > > This is what you missed in a previous message: > > Note that the extension you're building ("foo") isn't complete. It includes > the wrappers but not the OCaml implementations of the corresponding functions; > in fact, it is only meant to serve as the extconf.rb template for new > extensions. > > You can find the actual examples under examples/: > * marshal: 3-line specialized marshallers that can be over 3 times faster than > Ruby's Marshal (the largest speedup is achieved with float arrays) > * tree: a 30-line RB tree with 3X faster lookup than RBTree > (you'll need rbtree if you want to run the benchmarks in test_tree.rb) > * oo, records, variants: show how abstract types, records and variants are > converted between Ruby and OCaml. Abstract types become objects, records > turn into hashes with symbol keys and variants are mapped to symbols or > arrays. Oh, heh, whoops. :) > BTW, is the /opt/csw/gcc4/lib (de facto) "standard" in any way? > I'd like to have as much as possible work out of the box (trying to detect > common cases) and offer a convenient way to specify the things that cannot be > inferred. No, I'm afraid not. The "/opt/csw" prefix is the standard blastwave package directory (as in, Solaris packages installed from blastwave.org). I think you'll have to setup a "--with-gcc-dir" option or something. > Could you give me the output of > $ ruby -v -rrbconfig -rpp -e "pp Config::CONFIG" Sure, here it is: >ruby -v -rrbconfig -rpp -e "pp Config::CONFIG" ruby 1.8.6 (2007-09-23 patchlevel 110) [sparc-solaris2.10] {"sitedir"=>"/usr/local/lib/ruby/site_ruby", "MAKEFILES"=>"Makefile", "LIBRUBY"=>"libruby-static.a", "MAKEDIRS"=>"mkdir -p", "PACKAGE_VERSION"=>"", "GREP"=>"/usr/sfw/bin/ggrep", "prefix"=>"/usr/local", "COMMON_LIBS"=>"", "rubylibdir"=>"/usr/local/lib/ruby/1.8", "target"=>"sparc-sun-solaris2.10", "DLLWRAP"=>"", "AR"=>"ar", "target_alias"=>"", "MANTYPE"=>"man", "docdir"=>"/usr/local/share/doc/$(PACKAGE)", "RDOCTARGET"=>"", "dvidir"=>"/usr/local/share/doc/$(PACKAGE)", "AS"=>"as", "GNU_LD"=>"no", "MAINLIBS"=>"", "WINDRES"=>"", "XCFLAGS"=>" -DRUBY_EXPORT", "datarootdir"=>"/usr/local/share", "RUBY_INSTALL_NAME"=>"ruby", "LN_S"=>"ln -s", "archdir"=>"/usr/local/lib/ruby/1.8/sparc-solaris2.10", "LINK_SO"=>"", "MINIRUBY"=>"./miniruby", "DLDLIBS"=>" -lc", "EXEEXT"=>"", "target_vendor"=>"sun", "RUNRUBY"=>"./miniruby $(srcdir)/runruby.rb --extout=.ext --", "DESTDIR"=>"", "sbindir"=>"/usr/local/sbin", "LIBPATHENV"=>"LD_LIBRARY_PATH", "sitearch"=>"sparc-solaris2.10", "psdir"=>"/usr/local/share/doc/$(PACKAGE)", "host_cpu"=>"sparc", "DLEXT2"=>"", "LIBS"=>"-lrt -lpthread -ldl -lcrypt -lm ", "localedir"=>"/usr/local/share/locale", "rubyw_install_name"=>"", "EXTOUT"=>".ext", "ECHO_C"=>"", "OBJDUMP"=>"", "arch"=>"sparc-solaris2.10", "MAJOR"=>"1", "ruby_version"=>"1.8", "CC"=>"cc", "EGREP"=>"/usr/sfw/bin/ggrep -E", "COMMON_HEADERS"=>"", "COMMON_MACROS"=>"", "PACKAGE_TARNAME"=>"", "build_cpu"=>"sparc", "build_vendor"=>"sun", "host_alias"=>"", "RANLIB"=>"ranlib", "LDSHARED"=>"ld -G", "LIBRUBYARG_SHARED"=>"-R /usr/local/lib -L/usr/local/lib ", "YFLAGS"=>"", "htmldir"=>"/usr/local/share/doc/$(PACKAGE)", "MINOR"=>"8", "INSTALL_SCRIPT"=>"/opt/csw/bin/ginstall -c", "EXPORT_PREFIX"=>"", "LIBRUBY_ALIASES"=>"libruby.so", "LDFLAGS"=>"-L. ", "datadir"=>"/usr/local/share", "NM"=>"", "includedir"=>"/usr/local/include", "infodir"=>"/usr/local/share/info", "host_os"=>"solaris2.10", "build"=>"sparc-sun-solaris2.10", "host"=>"sparc-sun-solaris2.10", "INSTALL_DATA"=>"/opt/csw/bin/ginstall -c -m 644", "build_os"=>"solaris2.10", "DLDFLAGS"=>"", "ruby_install_name"=>"ruby", "DLEXT"=>"so", "LIBRUBY_SO"=>"libruby.so.1.8.6", "TEENY"=>"6", "CPP"=>"cc -E", "ALLOCA"=>"", "sysconfdir"=>"/usr/local/etc", "exec_prefix"=>"/usr/local", "PATH_SEPARATOR"=>":", "LIBEXT"=>"a", "mandir"=>"/usr/local/share/man", "libdir"=>"/usr/local/lib", "build_alias"=>"", "target_cpu"=>"sparc", "ECHO_N"=>"-n", "sharedstatedir"=>"/usr/local/com", "YACC"=>"bison -y", "configure_args"=>" '--enable-pthread' 'CC=cc'", "SOLIBS"=>"", "host_vendor"=>"sun", "TRY_LINK"=>"", "PACKAGE_STRING"=>"", "target_os"=>"solaris2.10", "oldincludedir"=>"/usr/include", "CP"=>"cp", "SET_MAKE"=>"", "LIBRUBYARG_STATIC"=>"-lruby-static", "LIBRUBYARG"=>"-lruby-static", "RUBYW_INSTALL_NAME"=>"", "PACKAGE_NAME"=>"", "pdfdir"=>"/usr/local/share/doc/$(PACKAGE)", "EXTSTATIC"=>"", "ECHO_T"=>"", "RPATHFLAG"=>" -R'%1$-s'", "SHELL"=>"/bin/bash", "STATIC"=>"", "ASFLAGS"=>"", "INSTALL"=>"/opt/csw/bin/ginstall -c", "sitearchdir"=>"/usr/local/lib/ruby/site_ruby/1.8/sparc-solaris2.10", "STRIP"=>"strip", "ARCHFILE"=>"", "LIBRUBY_DLDFLAGS"=>"", "OBJEXT"=>"o", "XLDFLAGS"=>"", "LIBRUBY_LDSHARED"=>"ld -G", "ENABLE_SHARED"=>"no", "RM"=>"rm -f", "CCDLFLAGS"=>" -KPIC", "setup"=>"Setup", "CPPOUTFILE"=>"-o conftest.i", "topdir"=>"/usr/local/lib/ruby/1.8/sparc-solaris2.10", "RUBY_SO_NAME"=>"ruby", "CFLAGS"=>"-g", "localstatedir"=>"/usr/local/var", "LIBPATHFLAG"=>" -L'%1$-s'", "bindir"=>"/usr/local/bin", "sitelibdir"=>"/usr/local/lib/ruby/site_ruby/1.8", "NROFF"=>"/usr/bin/nroff", "CPPFLAGS"=>"", "INSTALL_PROGRAM"=>"/opt/csw/bin/ginstall -c", "PACKAGE_BUGREPORT"=>"", "libexecdir"=>"/usr/local/libexec", "OUTFLAG"=>"-o ", "LIBRUBY_A"=>"libruby-static.a", "PREP"=>"miniruby", "ARCH_FLAG"=>""} BTW, I guess MS Windows is out of the question then, unless I want to install Cygwin, correct? Many thanks, Dan