From owner-freebsd-java@FreeBSD.ORG Sun Feb 3 18:52:54 2008 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E77116A469 for ; Sun, 3 Feb 2008 18:52:54 +0000 (UTC) (envelope-from drgerlists@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.freebsd.org (Postfix) with ESMTP id C71D213C44B for ; Sun, 3 Feb 2008 18:52:53 +0000 (UTC) (envelope-from drgerlists@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so2822387pyb.10 for ; Sun, 03 Feb 2008 10:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:organization:reply-to:to:subject:message-id:user-agent:mime-version:content-type:content-transfer-encoding; bh=MkO3i4mOw4bzEdeGKJGo+8SwOKH0Fsl67QlDvZVGac8=; b=aW0VoUlzqlOG27Rs57vH/oCskLrIwWtlJTaZwKFxi5x0u3VoIrahFqbi1lSBHHcUZE4xYtOl89ed7LF2uCkl1Q42iPTJhtwnMzBieOWXvaiC53OIRETtIYQJAdBQZGruvHCBJu6csWBX4jl+xkw0nxj/2Z/MLA/Kvq8/Q8UfHic= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:organization:reply-to:to:subject:message-id:user-agent:mime-version:content-type:content-transfer-encoding; b=FEcBK8RCIxlJxLHmwY5007sni8oRr8hgSulsRVJClmftOugqqh8jQF6u0yEpwyisRbZehYMl+vsirubgLVt7fEIxHBKe3T8urBq4yhKbefWs8SNFsX6gfxa6xPa4udyxeQBv6Ns2aIextIw9CNkBUCPzk7VakbpODUYQaOlzibU= Received: by 10.35.99.5 with SMTP id b5mr6851605pym.25.1202064772444; Sun, 03 Feb 2008 10:52:52 -0800 (PST) Received: from lmrmac.uhw.utoledo.edu ( [131.183.86.111]) by mx.google.com with ESMTPS id f45sm16381065pyh.6.2008.02.03.10.52.51 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Feb 2008 10:52:51 -0800 (PST) Date: Sun, 03 Feb 2008 13:52:50 -0500 From: drgerlists@gmail.com (Dr. Gary E. RAFE) Organization: Dr. Gary E. RAFE To: freebsd-java@freebsd.org Message-ID: <47a60d82.0OKq/4a7ZBRRW7zg4LprbyTa@lmrmac.uhw.utoledo.edu> User-Agent: Heirloom mailx 12.3 7/15/07 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Building Java3D-1.5.1 on FreeBSD 6.2-R/i386 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: drgerlists@gmail.com List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2008 18:52:54 -0000 In case anyone else might be interested in this, building and installing a native Java 3D is not difficult. This procedure was developed and tested on a Toshiba Satellite Pro 6100 running FreeBSD 6.2-R, XFree86-4.7.0, NVIDIA-96.43.01 OpenGL 1.3, JDK-1.5.0_13p7, Ant-1.6.5, and GCC-3.4.6 0. Fetch the source code from CVS at java.net (registration/login required): $ mkdir J3D_WRKDIR $ cd J3D_WRKDIR $ cvs -d :pserver:MYLOGIN@cvs.dev.java.net:/cvs login $ cvs -d :pserver:MYLOGIN@cvs.dev.java.net:/cvs checkout -r rel-1_5_1-fcs \ j3d-core j3d-core-utils vecmath 1. Build and install vecmath package: $ cd vecmath $ ant jar-opt # mkdir -p /PATH_TO/java3d/lib/ext # cd build/opt/lib/ext # install -m 0644 -o root -g wheel vecmath.jar /PATH_TO/java3d/lib/ext # cd /PATH_TO/j2se/jre/lib/ext # ln -s ../../../../java3d/lib/ext/vecmath.jar vecmath.jar 2. Patch, build, and install j3d-core/j3d-utils packages and native OpenGL connection shared library: $ cd J3D_WRKDIR/j3d-core $ fetch http://drgerlists.googlepages.com/patches-j3dcore-151-fbsd-i386.tbz $ tar xjf patches-j3dcore-151-fbsd-i386.tbz $ patch -p0 < patches-j3d-core-1.5.1 $ ant -Dbuild.type=fcs jar-opt # cd build/freebsd-i386/opt/lib/ext # install -m 0644 -o root -g wheel j3dcore.jar /PATH_TO/java3d/lib/ext # install -m 0644 -o root -g wheel j3dutils.jar /PATH_TO/java3d/lib/ext # cd ../i386 # mkdir -p /PATH_TO/java3d/lib/i386 # install -m 0755 -o root -g wheel libj3dcore-ogl.so /PATH_TO/java3d/lib/i386 # cd /PATH_TO/j2se/jre/lib/ext # ln -s ../../../../java3d/lib/ext/j3dcore.jar j3dcore.jar # ln -s ../../../../java3d/lib/ext/j3dutils.jar j3dutils.jar # cd ../i386 # ln -s ../../../../java3d/lib/ext/libj3dcore-ogl.so libj3dcore-ogl.so Some additional observations: Additional optimizations to the native shared library may be included in the ANT build file J3D_WRKDIR/j3d-core/src/native/build.xml. Check out the "value" for the property "bldFlag" under the target "nativeSetup-opt-freebsd". Currently, only "-O" is specified here, though my build uses "-O2 -march=pentium4m". The shared object libj3dcore-ogl.so is linked dynamically to libjawt.so, which lives in JDK_HOME/jre/lib/i386/. The shared object libjawt.so, in turn, requires libmawt.so, which, on my system, resides in either JDK_HOME/jre/lib/i386/headless/, .../i386/motif21/, or .../i386/xawt/. Perhaps a method is available to configure this in the JRE directly -- if so, this would be useful information. For initial testing of the j3d-example applications, I used LD_LIBRARY_PATH=JDK_HOME/jre/lib/i386/motif21 to pick the appropriate shared library. Once Java 3D looked like it was working OK, I put a symbolic link in JDK_HOME/jre/lib/i386/ to this library: # ln -s ./motif21/libmawt.so libmawt.so which allows it to get picked up when testing Java 3D applets from Firefox. I couldn't test the Shading Language (Cg or GLSL) examples in j3d-example, as the video device in this (old) notebook doesn't have these capabilities. Further research into this in NVIDIA documents related to their FreeBSD/Linux drivers suggest that more recent devices can do GLSL. I'd be interested to hear about successes in this area, when it comes time to replace this old Toshiba. I didn't add any capability to build a distribution here (see J3D_WRKDIR/j3d-core/build-tools/). I expect to follow-up on this with the Java 3D project itself to see whether they would entertain an "official" FreeBSD-x86 port/distribution. Comments, corrections, and improvements to any of this are encouraged and welcome. -- Dr Gary E RAFE: drgerlists at gmail dot com