Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
java on ppc
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 105
Location: Wenatchee, WA

PostPosted: Thu Aug 18, 2011 12:09 am    Post subject: Reply with quote

Like I said, these are specialized math tests. The Shark JIT may be optimized for multi-core systems as well; the multithreading overhead would penalize us single-core people. There are any number of similar optimization issues. We need a tool to benchmark performance of the actual JVM, rather than some math library the JVM calls, but I have yet to stumble across one. My C++ programmer background inclines me to assume Java programmers would want to suppress such benchmarks, but I recognize that as personal bias. :) It would be nice if someone would prove me wrong.

I would suggest a real-world test like watching Minecraft framerates, but Minecraft uses LWJGL, which assumes PPCs run Mac OS X. I cannot get LWJGL to compile for Linux/PPC.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Mon Oct 17, 2011 10:14 am    Post subject: Reply with quote

How did you get icedtea built with Zero and Shark VM?
I modified the ebuild and enabled the Shark stuff but it fails for llvm. I tried with sys-devel/llvm-2.8-r2 as well as 2.9-r2.

Code:
echo Linking launcher...
Linking launcher...
gcc -m32 -Xlinker -O1   -m32 -Wl,-export-dynamic  -L `pwd` -L/usr/lib/llvm -o gamma launcher/java_md.o launcher/wildcard.o launcher/jli_util.o launcher/java.o -ljvm -lm -ldl -lpthread -lLLVM-2.9
make[7]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk.build/hotspot/outputdir/linux_ppc_shark/product'
All done.
make[6]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk.build/hotspot/outputdir/linux_ppc_shark/product'
cd linux_ppc_shark/product && ./test_gamma
java full version "1.6.0_22-b22"
./gamma: error while loading shared libraries: libLLVM-2.9.so: cannot open shared object file: No such file or directory
make[5]: *** [productshark] Error 127
make[5]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk.build/hotspot/outputdir'
make[4]: *** [generic_buildshark] Error 2
make[4]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk/hotspot/make'
make[3]: *** [productshark] Error 2
make[3]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk/hotspot/make'
make[2]: *** [hotspot-build] Error 2
make[2]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk'
make[1]: *** [build_product_image] Error 2
make[1]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.3/work/icedtea6-1.10.3/openjdk'
make: *** [stamps/icedtea.stamp] Error 2
emake failed
 * ERROR: dev-java/icedtea-6.1.10.3 failed (compile phase):
 *   make failed
 *
 * Call stack:
 *     ebuild.sh, line  56:  Called src_compile
 *   environment, line 4495:  Called die
 * The specific snippet of code:
 *       emake || die "make failed"
Code:
# diff /usr/local/portage/dev-java/icedtea/icedtea-6.1.10.3.ebuild /usr/portage/dev-java/icedtea/icedtea-6.1.10.3.ebuild
43c43
< IUSE="cacao debug doc examples +hs20 jamvm javascript nio2 +nsplugin +nss pulseaudio systemtap +webstart +xrender zero shark"
---
> IUSE="cacao debug doc examples +hs20 jamvm javascript nio2 +nsplugin +nss pulseaudio systemtap +webstart +xrender zero"
117,127c117,127
<       if use shark ; then
<         if ( ! use x86 && ! use sparc && ! use ppc ) ; then
<               eerror "The Shark JIT has known issues on 64-bit platforms.  Please rebuild"
<               errror "without the shark USE flag turned on."
<               die "Rebuild without the shark USE flag on."
<         fi
<         if ( ! use zero ) ; then
<               eerror "The use of the Shark JIT is only applicable when used with the zero assembler port.";
<               die "Rebuild without the shark USE flag on or with the zero USE flag turned on."
<         fi
<       fi
---
> #     if use shark ; then
> #       if ( ! use x86 && ! use sparc && ! use ppc ) ; then
> #             eerror "The Shark JIT has known issues on 64-bit platforms.  Please rebuild"
> #             errror "without the shark USE flag turned on."
> #             die "Rebuild without the shark USE flag on."
> #       fi
> #       if ( ! use zero ) ; then
> #             eerror "The use of the Shark JIT is only applicable when used with the zero assembler port.";
> #             die "Rebuild without the shark USE flag on or with the zero USE flag turned on."
> #       fi
> #     fi
205,207d204
<       fi
<       if use shark ; then
<               config="${config} --enable-shark"

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 105
Location: Wenatchee, WA

PostPosted: Mon Oct 17, 2011 9:12 pm    Post subject: Reply with quote

Did you make the link to libLLVM-2.8.so?
Code:
ln -s /usr/lib/llvm/libLLVM-2.8.so /usr/lib/

It's possible the .so is somewhere else on your system. Find it with:
Code:
locate libLLVM- | grep .so$
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Wed Oct 19, 2011 1:50 pm    Post subject: Icedtea Zero/Shark working on PPC Reply with quote

Thank you very much, I missed that hint about linking libLLVM in one of your first posts.

Zero-Shark VM is working now and incredible fast, at least with my application Hibiscus. Felt speed is about 3 times faster as with Zero-only without the JIT compiler. For example synchronizing all my 15 accounts via HBCI took about 15 minutes before and now about 3 minutes.
Switching tabs in the GUI was quite unacceptable before and quite ok now. I can't compare to IBM's JDK because this application doesn't even work because of some SUN classes.
Other applications also feel faster on Icedtea with Zero/Shark.
The Cacao VM would be also interesting as another JIT-enabled VM option, but the application did not work with the Cacao built.

Is there any bugreport about icedtea and Shark I can vote for? The one you mentioned is from 2009 and only about Shark on amd64.

I would definitely say icedtea with Zero/Shark is the JDK for ppc absolutely, and I'd like to vote for stabilizing or at least adding the ~ppc keyword and adding to our PPC FAQ. Maybe some applications don't work with Icedtea, though I haven't seen one.
Let's get rid of the annoying manual download binary IBM JDK ebuild.
_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Sat Oct 22, 2011 10:24 am    Post subject: Reply with quote

New version 6.1.10.4 fails to build with Shark:
Code:
[ebuild     U ~] dev-java/icedtea-6.1.10.4 [6.1.10.3] USE="hs20 javascript nsplugin nss shark webstart xrender zero -cacao -debug -doc -examples -jamvm -nio2 -pulseaudio (-systemtap)" 0 kB [1]

Code:
Using java runtime at: /var/tmp/portage/dev-java/icedtea-6.1.10.4/work/icedtea6-1.10.4/bootstrap/jdk1.6.0/jre
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.3) (Gentoo build 1.6.0_22-b22)
OpenJDK Shark VM (build 20.0-b11, mixed mode)

Stack dump:
0.      Running pass 'Loop Pass Manager' on function '@"java.lang.String::indexOf"'
1.      Running pass 'Loop Strength Reduction' on basic block '%bci_55'
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (os_linux_zero.cpp:270), pid=32006, tid=1873278080
#  fatal error: caught unhandled signal 11
#
# JRE version: 6.0_22-b22
# Java VM: OpenJDK Shark VM (20.0-b11 mixed mode linux-ppc )
# Derivative: IcedTea6 1.10.4
# Distribution: Built on Gentoo Base System release 2.0.3 (Sat Oct 22 10:37:33 CEST 2011)
# An error report file with more information is saved as:
# /var/tmp/portage/dev-java/icedtea-6.1.10.4/work/icedtea6-1.10.4/openjdk.build/hotspot/outputdir/linux_ppc_shark/product/hs_err_pid32006.log

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 105
Location: Wenatchee, WA

PostPosted: Mon Oct 24, 2011 8:47 am    Post subject: Re: Icedtea Zero/Shark working on PPC Reply with quote

Massimo B. wrote:
Thank you very much, I missed that hint about linking libLLVM in one of your first posts.

Glad someone found my random tinkering helpful. :)

Quote:
The Cacao VM would be also interesting as another JIT-enabled VM option, but the application did not work with the Cacao built.

Yeah, it definitely sounds interesting. The CACAO Wiki has instructions for a couple of linux flavors. That could be useful as a starting point, but it's much too early in the morning for me to make sense of it.

Quote:
Is there any bugreport about icedtea and Shark I can vote for? The one you mentioned is from 2009 and only about Shark on amd64.

That amd64 one is the only shark bug I could find, and actually the bug says it applies to all platforms -- amd64 just happens to be in the title. The devs need to know there's interest, so I suggest adding a simple comment to that one to let people know it works the same on PPC. However, the libLLVM-*.so issue needs fixing before shark can be enabled. There's a bug report on THAT problem for Gentoo/OSX. Maybe a LLVM version bump will fix it?

When my laptop finishes its world update, I'll look into it more.
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Thu Dec 15, 2011 12:21 pm    Post subject: Reply with quote

The java-overlay has now icedtea ebuilds for building Shark as an additional VM.

The symlink trick is no longer needed. So personally I didn't had much luck with Shark. "Hello world" runs just fine but not much more than that. Zero, CACAO and JamVM all work well here on amd64 with what I tested them with, so are considerably slower than HotSpot. CACAO is much faster than Zero judging by the scimark bench but is icedtea:6 only for the time being.

About Shark, the llvm-3.0 support didn't make it into openjdk6 nor openjdk7 so far. There is an experimental patchset which the ebuild applies to allow building against 3.0. There is an additional patch to use llvm's new mcjit. So on most hardware that can't be expected to work. If you want to play with that - uncomment the respective patch in the ebuild. If you have no luck with llvm-3.0 you might have better luck with llvm-2.9.

Using an alternative VM is done by using the command:
java -shark <args as usual>
replace shark with zero, cacao or jamvm respectively. It the same mechanism as -server / -client on x86.
Back to top
View user's profile Send private message
dobbs
Tux's lil' helper
Tux's lil' helper


Joined: 20 Aug 2005
Posts: 105
Location: Wenatchee, WA

PostPosted: Thu Dec 15, 2011 1:04 pm    Post subject: Reply with quote

Thanks for the update, sera!

sera wrote:
The symlink trick is no longer needed.

Can you elaborate on what changed? Was it just the version bump to llvm 2.9?
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Thu Dec 15, 2011 1:15 pm    Post subject: Reply with quote

dobbs wrote:
Thanks for the update, sera!

sera wrote:
The symlink trick is no longer needed.

Can you elaborate on what changed? Was it just the version bump to llvm 2.9?


It's a patch which makes it work.
https://overlays.gentoo.org/proj/java/browser/java-overlay/dev-java/icedtea/files/icedtea-7.2.0_shark_jvm_rpath.patch?rev=8922
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Fri Dec 16, 2011 11:38 am    Post subject: Reply with quote

I tried with the version from java-overlay but it fails with USE="zero shark cacao":
Code:
if ! /var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/work/vpath_top_build_dir/sharkvm/bootstrap/jdk1.6.0/bin/java -version ; \
         then \
           echo "/var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/work/vpath_top_build_dir/sharkvm/bootstrap/jdk1.6.0/bin/java" \
               "cannot be found or is corrupted." ; \
           exit 1; \
        fi
/bin/sh: line 1: /var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/work/vpath_top_build_dir/sharkvm/bootstrap/jdk1.6.0/bin/java: No such file or directory
/var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/work/vpath_top_build_dir/sharkvm/bootstrap/jdk1.6.0/bin/java cannot be found or is corrupted.
make[1]: *** [stamps/bootstrap-directory-symlink.stamp] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/work/vpath_top_build_dir/sharkvm'
make: *** [stamps/add-shark.stamp] Error 2
* ERROR: dev-java/icedtea-6.1.10.4-r4 failed (compile phase):
*   emake failed
*
* If you need support, post the output of 'emerge --info =dev-java/icedtea-6.1.10.4-r4',
* the complete build log and the output of 'emerge -pqv =dev-java/icedtea-6.1.10.4-r4'.
* This ebuild is from an overlay named 'java-overlay': '/usr/local/portage/layman/java-overlay/'
* The complete build log is located at '/var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/temp/environment'.
* S: '/var/tmp/portage/dev-java/icedtea-6.1.10.4-r4/work/vpath_top_build_dir'

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sat Dec 17, 2011 6:51 am    Post subject: Reply with quote

I can reproduce it, looks like building Shark requires -jbootstrap to be set with icedtea:6 or the jdk overlay won't be created correctly.

Will look into fixing that as it prevents having Shark and CACAO at the same time.
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sat Dec 17, 2011 8:44 am    Post subject: Reply with quote

Fixed, re-sync the java-overlay.

The issue was that I missed that filtering bootstrap on re-configure is only done in icedtea:7. Well, one more of many subtle differences between the two.

@Massimo, thanks for notifying.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum