Thread: [Java-gnome-developer] cairo-java / getMatrix() problem
Brought to you by:
afcowie
From: David G. <dav...@ob...> - 2005-12-01 13:12:48
|
Hi, I'm going a little outside my comfort zone and trying out cairo-java. So far, it is going pretty well, and I've got some nice things working. But, I'm having some trouble when I try out transformations, specifically the following code: ImageSurface surface = new ImageSurface(Format.ARGB32, 300, 200); Context context = new Context(surface); Matrix m = context.getMatrix(); ...generates this error message: # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0xab1b9a73, pid=10577, tid=16384 # # Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode) # Problematic frame: # C [libcairo.so.2+0xca73] I'm running Eclipse on JDK 1.4.2_09 on Gentoo Linux, and I installed the cairo-java-1.0.1.ebuild. I can provide additional information if required. I have no experience using "native" libraries, so I don't know what's relevant information and what's not. Any help will be greatly appreciated. Regards, Dave Gilbert |
From: Ismael J. <ml...@ju...> - 2005-12-01 16:10:31
|
On Thu, 2005-12-01 at 13:12 +0000, David Gilbert wrote: [...] > # > # An unexpected error has been detected by HotSpot Virtual Machine: > # > # SIGSEGV (0xb) at pc=0xab1b9a73, pid=10577, tid=16384 > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode) > # Problematic frame: > # C [libcairo.so.2+0xca73] > [...] Hi, It seems like a bug in the library. It would be useful if you could post a bug report[1], so that this doesn't get lost. Regarding relevant information to put in the bug report, the ideal is a runnable test case. This is obviously not always possible, and the information you provided in your email message is generally good enough, but you may probably want to attach the file generated by the Sun JVM when it crashes. It's usually in the directory where the app was launched from or the home directory. Thanks. Regards, Ismael [1] https://bugs.freedesktop.org/enter_bug.cgi?product=cairo-java |
From: David G. <dav...@ob...> - 2005-12-01 19:46:54
|
Ismael Juma wrote: >On Thu, 2005-12-01 at 13:12 +0000, David Gilbert wrote: >[...] > > >># >># An unexpected error has been detected by HotSpot Virtual Machine: >># >># SIGSEGV (0xb) at pc=0xab1b9a73, pid=10577, tid=16384 >># >># Java VM: Java HotSpot(TM) Client VM (1.4.2_09-b05 mixed mode) >># Problematic frame: >># C [libcairo.so.2+0xca73] >> >> >> >[...] > >Hi, > >It seems like a bug in the library. It would be useful if you could post >a bug report[1], so that this doesn't get lost. Regarding relevant >information to put in the bug report, the ideal is a runnable test case. >This is obviously not always possible, and the information you provided >in your email message is generally good enough, but you may probably >want to attach the file generated by the Sun JVM when it crashes. It's >usually in the directory where the app was launched from or the home >directory. Thanks. > >Regards, >Ismael > >[1] https://bugs.freedesktop.org/enter_bug.cgi?product=cairo-java > > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >_______________________________________________ >java-gnome-developer mailing list >jav...@li... >https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > > > > Thanks for the quick response. I'd like to try your patch, but so far I have not succeeded in building cairo-java from CVS. I get this error when I execute 'make': /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lglibjava collect2: ld returned 1 exit status make[1]: *** [libcairojava.la] Error 1 make[1]: Leaving directory `/home/dgilbert/cairo-java-cvs/cairo-java' make: *** [all] Error 2 I know nothing about this stuff, I only got cairo-java working via the Gentoo ebuild. Any hints? Regards, Dave Gilbert P.S. By the way, my interest in cairo-java is to create a CairoGraphics2D class that can be used with JFreeChart (and any other applications that use the Graphics2D API). I started that and got some promising results before running into the getMatrix() problem. Here are some PNG images I created with a very basic Graphics2D implementation (I'm sure it can be improved a lot): http://www.object-refinery.com/jfreechart/cairo/PieChartTest.png http://www.object-refinery.com/jfreechart/cairo/BarChartTest.png http://www.object-refinery.com/jfreechart/cairo/TimeChartTest.png This is running on Sun's JDK but I'm hopeful of getting the same thing running on JamVM and GNU Classpath. |
From: Joao V. <jvi...@ya...> - 2005-12-01 21:02:34
|
--- David Gilbert <dav...@ob...> escreveu: > http://www.object-refinery.com/jfreechart/cairo/PieChartTest.png > > http://www.object-refinery.com/jfreechart/cairo/BarChartTest.png > > http://www.object-refinery.com/jfreechart/cairo/TimeChartTest.png > > This is running on Sun's JDK but I'm hopeful of getting the same thing > running on JamVM and GNU Classpath. Oh, that's awesome! I had thought about doing exactly that a while back, but the Cairo bindings were too in-the-beginning, so i didn't go further. But this is really great. Cheers, J.V. _______________________________________________________ Yahoo! doce lar. Faça do Yahoo! sua homepage. http://br.yahoo.com/homepageset.html |
From: Andrew C. <an...@op...> - 2005-12-02 05:15:52
|
On Thu, 2005-01-12 at 19:47 +0000, David Gilbert wrote: > I'd like to try your patch, but so far I=20 > have not succeeded in building cairo-java from CVS. I get this error=20 > when I execute 'make': >=20 > /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bi= n/ld:=20 > cannot find -lglibjava ... > I know nothing about this stuff, I only got cairo-java working via the=20 > Gentoo ebuild. Any hints? So we just talked this over in #java-gnome, and I have a hypothesis for you. -lglibjava is the library that we generate when you compile to native in using GCJ that is effectively the equivalent of glib.jar. In the Gentoo ebuilds, it only gets built if you have USE=3Dgcj set in your USE flags (either /etc/make.conf, /etc/portage/packages.use or on emerge command line) So, my speculation is that you're not finding /usr/lib/libglibjava.so because the glib-java package was built USE=3D-gcj (either explicitly by you, or as a default by not setting the gcj use flag). If that is so, then when you are trying to build cairo-java from CVS, you have configured as --with-gcj-compile which is the default. As a workaround, you can probably do $ ./configure --without-gcj-compile --prefix=3D/opt/blah... Then it won't try and build the gcj native libraries libcairojava.so that is the equivalents of cairo.jar, which means you won't need libglibjava.so. Give it a try and let us know? [Or, you could re emerge glib-java with USE=3Dgcj active - all assuming that this hypothesis is correct] Be aware that in general, if you're building something from CVS, you end up needing to build the dependencies from CVS. That is (probably) not necessary in this case, but there are one or two few bug fixes in glib-java since we released 0.2.1. FYI. AfC Bangalore --=20 Andrew Frederick Cowie Operational Dynamics Website: http://www.operationaldynamics.com/ Blog: http://research.operationaldynamics.com/blogs/andrew/ GPG key: 0945 9282 449C 0058 1FF5 2852 2D51 130C 57F6 E7BD Sydney +61 2 9977 6866 New York +1 646 472 5054 Toronto +1 416 848 6072 London +44 207 1019201 |
From: David G. <dav...@ob...> - 2005-12-06 21:47:17
|
Andrew Cowie wrote: >On Thu, 2005-01-12 at 19:47 +0000, David Gilbert wrote: > > > >>I'd like to try your patch, but so far I >>have not succeeded in building cairo-java from CVS. I get this error >>when I execute 'make': >> >>/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: >>cannot find -lglibjava >> >> >... > > >>I know nothing about this stuff, I only got cairo-java working via the >>Gentoo ebuild. Any hints? >> >> > >So we just talked this over in #java-gnome, and I have a hypothesis for >you. > >-lglibjava is the library that we generate when you compile to native in >using GCJ that is effectively the equivalent of glib.jar. In the Gentoo >ebuilds, it only gets built if you have USE=gcj set in your USE flags >(either /etc/make.conf, /etc/portage/packages.use or on emerge command >line) > >So, my speculation is that you're not finding /usr/lib/libglibjava.so >because the glib-java package was built USE=-gcj (either explicitly by >you, or as a default by not setting the gcj use flag). > >If that is so, then when you are trying to build cairo-java from CVS, >you have configured as --with-gcj-compile which is the default. As a >workaround, you can probably do > > $ ./configure --without-gcj-compile --prefix=/opt/blah... > >Then it won't try and build the gcj native libraries libcairojava.so >that is the equivalents of cairo.jar, which means you won't need >libglibjava.so. Give it a try and let us know? > >[Or, you could re emerge glib-java with USE=gcj active - all assuming >that this hypothesis is correct] > >Be aware that in general, if you're building something from CVS, you end >up needing to build the dependencies from CVS. That is (probably) not >necessary in this case, but there are one or two few bug fixes in >glib-java since we released 0.2.1. FYI. > >AfC >Bangalore > > Thanks Andrew, this fixed the problem for me and allowed me to make more progress with my CairoGraphics2D class. I'll post a new thread to show you what I mean... Regards, Dave |
From: Ismael J. <ml...@ju...> - 2005-12-01 21:35:10
|
On Thu, 2005-12-01 at 19:47 +0000, David Gilbert wrote: [...] > Thanks for the quick response. I'd like to try your patch, but so far I > have not succeeded in building cairo-java from CVS. I get this error > when I execute 'make': > > /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: > cannot find -lglibjava > collect2: ld returned 1 exit status > make[1]: *** [libcairojava.la] Error 1 > make[1]: Leaving directory `/home/dgilbert/cairo-java-cvs/cairo-java' > make: *** [all] Error 2 > > I know nothing about this stuff, I only got cairo-java working via the > Gentoo ebuild. Any hints? I don't know much about the gentoo ebuilds myself, and from the error snippet, it's not apparent what's going wrong. The problem is occurring in the native compilation step, however, so you can skip that step while we're trying to figure out why the problem is happening if you so wish. This can be done by passing --without-gcj-compile to autogen.sh or configure. To help us figure out why the problem is happening, it would be useful if you could post the whole output instead of just that small fragment. > P.S. By the way, my interest in cairo-java is to create a > CairoGraphics2D class that can be used with JFreeChart (and any other > applications that use the Graphics2D API). I started that and got some > promising results before running into the getMatrix() problem. Here are > some PNG images I created with a very basic Graphics2D implementation > (I'm sure it can be improved a lot): > > http://www.object-refinery.com/jfreechart/cairo/PieChartTest.png > > http://www.object-refinery.com/jfreechart/cairo/BarChartTest.png > > http://www.object-refinery.com/jfreechart/cairo/TimeChartTest.png > > This is running on Sun's JDK but I'm hopeful of getting the same thing > running on JamVM and GNU Classpath. Very cool! :) Regards, Ismael |
From: Ismael J. <ml...@ju...> - 2005-12-01 21:41:56
|
One thing I forgot to mention, if you'd like a more real-time interaction, the people involved with the project are often in the #java-gnome channel at irc.gimp.net. Ismael |