Sunny Chan blogs
Can you see the Logic in my Madness?
Can you see the Logic in my Madness?
I have upgraded this website to:
schan in Java 10:34PM Dec 13, 2011 Comments[0]
If you have following the OpenJDK build Readme and try to compile OpenJDK on Ubuntu 11.10, you may see this error:
/home/schan/openjdk7/build/linux-amd64/tmp/sun/javax.sound/jsoundalsa/obj64/PLATFORM_API_LinuxOS_ALSA_PCM.o: In function `DAUDIO_GetFormats':
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x1fd): undefined reference to `snd_pcm_format_mask_malloc'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x20a): undefined reference to `snd_pcm_close'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x225): undefined reference to `snd_pcm_hw_params_malloc'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x236): undefined reference to `snd_pcm_hw_params_get_format_mask'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x246): undefined reference to `snd_pcm_format_mask_free'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x259): undefined reference to `snd_pcm_hw_params_any'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x26a): undefined reference to `snd_pcm_hw_params_get_format_mask'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x277): undefined reference to `snd_pcm_hw_params_get_channels_min'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x288): undefined reference to `snd_pcm_hw_params_get_channels_max'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x2cf): undefined reference to `snd_pcm_format_mask_test'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x45d): undefined reference to `snd_pcm_hw_params_free'
/home/schan/openjdk7/build/linux-amd64/tmp/sun/javax.sound/jsoundalsa/obj64/PLATFORM_API_LinuxOS_ALSA_PCM.o: In function `setStartThresholdNoCommit':
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x48c): undefined reference to `snd_pcm_sw_params_set_start_threshold'
/home/schan/openjdk7/build/linux-amd64/tmp/sun/javax.sound/jsoundalsa/obj64/PLATFORM_API_LinuxOS_ALSA_PCM.o: In function `setStartThreshold':
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x4bf): undefined reference to `snd_pcm_sw_params'
/home/schan/openjdk7/build/linux-amd64/tmp/sun/javax.sound/jsoundalsa/obj64/PLATFORM_API_LinuxOS_ALSA_PCM.o: In function `setHWParams':
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x518): undefined reference to `snd_pcm_hw_params_any'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x531): undefined reference to `snd_pcm_hw_params_set_access'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x544): undefined reference to `snd_pcm_hw_params_set_format'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x557): undefined reference to `snd_pcm_hw_params_set_channels'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x58a): undefined reference to `snd_pcm_hw_params_set_rate_near'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x5dc): undefined reference to `snd_pcm_hw_params_set_buffer_size_near'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x60b): undefined reference to `snd_pcm_hw_params_set_period_time_near'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x61b): undefined reference to `snd_pcm_hw_params'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x647): undefined reference to `snd_pcm_hw_params_set_periods_near'
/home/schan/openjdk7/build/linux-amd64/tmp/sun/javax.sound/jsoundalsa/obj64/PLATFORM_API_LinuxOS_ALSA_PCM.o: In function `setSWParams':
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x67e): undefined reference to `snd_pcm_sw_params_current'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x6b4): undefined reference to `snd_pcm_sw_params_set_avail_min'
PLATFORM_API_LinuxOS_ALSA_PCM.c:(.text+0x6c4): undefined reference to `snd_pcm_sw_params'
Don't panic - it looks like the Java's linking sequence for ALSA sound library is wrong. Just use this patch:
--- old/make/javax/sound/jsoundalsa/Makefile 2011-10-28 02:28:00.000000000 -0400
+++ new/make/javax/sound/jsoundalsa/Makefile 2011-10-28 02:28:00.000000000 -0400
@@ -65,7 +65,7 @@
$(MIDIFILES_export) \
$(PORTFILES_export)
-LDFLAGS += -lasound
+EXTRA_LIBS += -lasound
CPPFLAGS += \
-DUSE_DAUDIO=TRUE \
schan in Java 09:45AM Oct 28, 2011 Comments[0]
These are the steps that I have made OpenJDK to compile on Windows platform:
Important: In order to build a 32bit JDK you must use a 32bit System - ie. you cannot cross compile (ie. 64bit Windows and compile a 32bit JDK)
Let me know whether it works for you. if it doesn't tell me what's wrong and I will fix the instructions!
schan in Java 07:42PM Jul 24, 2011 Comments[1]
This is the abstract for my COSCUP talk on August 18th, 2011:
OpenJDK 7: The universal language runtime
Sunny Chan
Hong Kong Java User Group Leader
OpenJDK 7 is the latest release of the Java Platform. In this release, there are a number of major innovations in the OpenJDK's Java Virtual Machine to enable other scripting languages like Ruby, Python and PHP to run on the platform efficiently.
In this talk, I will give you 5 reasons why you should run your applications written in alternative languages like Ruby on the OpenJDK Runtime. I will also explore some of the common myths about running your application with the Java Runtime.
schan in Java 09:18PM Jul 15, 2011 Comments[0]
Tags: coscup
That's a little bit of fun for you today: You can write a 3D apps using javascript while using javascript agent!
Don't think you can do that with c# :-)
schan in Java 05:08PM Jan 10, 2007
Well, the tomcat server that runs this roller weblog died last night - seems like it has running out of memory....
I am running thi weblog on a Xen VM with 128M memory - seems like it is not enough! I can't really afford a proper hosted machine at the moment - otherwise I definitely would try to get more memory! Anyway, I have restarted the server now and it is all fine - maybe I need to switch JVM, and my old colleagues will bark!
schan in Java 09:39PM Mar 09, 2006