From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id CC1B6BC37; Tue, 24 Nov 2009 15:00:39 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHN1C0tDz4He/2dsb2JhbADJXwiOaoJHCIFqBIFw X-IronPort-AV: E=Sophos;i="4.47,279,1257116400"; d="scan'208";a="50900544" Received: from fettunta.fettunta.org ([67.207.129.222]) by mail4-smtp-sop.national.inria.fr with ESMTP; 24 Nov 2009 15:00:38 +0100 Received: from usha.takhisis.invalid (unknown [10.17.0.10]) by fettunta.fettunta.org (Postfix) with ESMTPS id 356CE184A7; Tue, 24 Nov 2009 14:00:37 +0000 (UTC) Received: by usha.takhisis.invalid (Postfix, from userid 1000) id C425C6E2B; Tue, 24 Nov 2009 15:00:35 +0100 (CET) Date: Tue, 24 Nov 2009 15:00:35 +0100 From: Stefano Zacchiroli To: OCaml Mailing List Cc: Xavier Leroy Subject: Re: [Caml-list] CamlJava - patch to *build* w/ recent JDK Message-ID: <20091124140035.GA18201@usha.takhisis.invalid> Mail-Followup-To: OCaml Mailing List , Xavier Leroy References: <20091123155537.GA10062@usha.takhisis.invalid> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20091123155537.GA10062@usha.takhisis.invalid> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: no; 0.00; zacchiroli:01 zack:01 camljava:01 0100,:01 zacchiroli:01 camljava:01 ocaml:01 dirs:01 lib:01 symlink:01 initializing:01 cheers:01 author's:01 afaik:01 postdoc:01 X-Attachments: type="text/x-diff" name="camljava-java6.patch" --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Nov 23, 2009 at 04:55:37PM +0100, Stefano Zacchiroli wrote: > Has anyone successfully built/used CamlJava [1] with recent OCaml and > the open sourced Sun's JVM (OpenJDK)? I've tried for a while, but I'm > stuck at the basics, i.e. making the example shipped with CamlJava work. > > First of all there is some needed gymnastic to build: apparently there > is no longer _a_ legacy libjvm.so, but several one depending on which > JRE you choose (at least: "Cacao" and "headless"). Of course they're in > different dirs and I'm not sure about which is the right way (or even > criteria) to choose one. About this, here is a patch for the build system which makes CamlJava build against both last Sun's JDK 6 (closed source) and last Open JDK. It mainly account for libjvm.so having been moved around and some upstream lib/ directory reorganization. > After having passed through that (with a dirty symlink to one of the two > libjvm.so), the shipped example fails with an exception while > initializing the JVM: This, unfortunately, is still standing :-( Cheers. PS I hope I'm not bothering with list + author's Cc, AFAIK there is no BTS for CamlJava, so this is my best attempt for both being sure the author gets the patch and that the patch is public for consumptions by others -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime --GvXjxJ+pjyke8COw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="camljava-java6.patch" diff -Naur camljava-0.3.orig/lib/Makefile camljava-0.3/lib/Makefile --- camljava-0.3.orig/lib/Makefile 2009-11-24 14:43:18.555035491 +0100 +++ camljava-0.3/lib/Makefile 2009-11-24 14:42:07.943485242 +0100 @@ -46,7 +46,7 @@ rm -f fr/inria/caml/camljava/*.class clean:: - rm -f *.cm? *.[oa] + rm -f *.cm? *.[oa] *.cmxa .SUFFIXES: .ml .mli .cmo .cmi .cmx diff -Naur camljava-0.3.orig/Makefile.config camljava-0.3/Makefile.config --- camljava-0.3.orig/Makefile.config 2004-07-08 16:02:53.000000000 +0200 +++ camljava-0.3/Makefile.config 2009-11-24 14:52:27.474829525 +0100 @@ -17,7 +17,7 @@ ## For other platforms, adjust as required and tell us about it. # Home location for the JDK. Only used for setting other variables below. -JDKHOME=/usr/local/java_1.4.2 +JDKHOME=/usr/lib/jvm/java-6-sun # Where to find the JNI include files (for compiling the OCaml-JNI C stubs) JNIINCLUDES=-I$(JDKHOME)/include -I$(JDKHOME)/include/linux @@ -25,11 +25,18 @@ # The library to link with to get the JNI JNILIBS=-ljava +# Current architecture identification string, as intended by the JDK. +# Common values for x86 architectures are "i386" or "amd64". You can find it +# out by looking for the "*" patch component in the following pattern: +# $(JDKHOME)/jre/lib/*/libjava.so +ARCH=amd64 + # Additional link-time options to pass to $(CC) when linking with $(JNILIBS) -JNILIBOPTS=-L$(JDKHOME)/jre/lib/i386/ \ - -Wl,-rpath,$(JDKHOME)/jre/lib/i386/ \ - -Wl,-rpath,$(JDKHOME)/jre/lib/i386/client \ - -Wl,-rpath,$(JDKHOME)/jre/lib/i386/native_threads +JNILIBOPTS=-L$(JDKHOME)/jre/lib/$(ARCH)/ \ + -L$(JDKHOME)/jre/lib/$(ARCH)/server \ + -Wl,-rpath,$(JDKHOME)/jre/lib/$(ARCH)/ \ + -Wl,-rpath,$(JDKHOME)/jre/lib/$(ARCH)/server \ + -Wl,-rpath,$(JDKHOME)/jre/lib/$(ARCH)/native_threads # Additional options when compiling the OCaml-JNI C stubs. # -DJDK122_LINUX_HACK works around a nasty thread-related bug of diff -Naur camljava-0.3.orig/test/jnitest.ml camljava-0.3/test/jnitest.ml --- camljava-0.3.orig/test/jnitest.ml 2001-06-05 16:01:23.000000000 +0200 +++ camljava-0.3/test/jnitest.ml 2009-11-24 14:37:41.602405336 +0100 @@ -68,4 +68,6 @@ print_newline() let _ = - test() + try + test() + with exn -> prerr_endline (Printexc.to_string exn) diff -Naur camljava-0.3.orig/test/Makefile camljava-0.3/test/Makefile --- camljava-0.3.orig/test/Makefile 2001-06-05 16:01:15.000000000 +0200 +++ camljava-0.3/test/Makefile 2009-11-24 14:44:01.335369289 +0100 @@ -18,3 +18,4 @@ clean:: rm -f *.cm? + rm -f *.class --GvXjxJ+pjyke8COw--