推薦軟硬體、網站

Google Adsense

aNobii網路書櫃

顯示具有 64-bit 標籤的文章。 顯示所有文章
顯示具有 64-bit 標籤的文章。 顯示所有文章

2009年9月26日 星期六

MATLAB R2009b for Mac: A Simple Performance Test

中文標題:MATLAB R2009b for Mac: 簡單測試文

前陣子的文章才提到一些關於MATLAB R2009b的消息,對MacOSX Snow Leopard來說,最好的消息就是R2009b for Mac終於是64-bit啦!安裝的時候有個"Select Architecture",可以選擇"Intel"(3630MB)或"Intel 64"(3802MB),或者是都選(4927MB)。

如果都選的話,安裝結束可以在 /Applications/MATLAB_R2009b -> 顯示套件內容 -> bin 裡分別看到maci和maci64這兩個資料夾。

裝完以後以預設64-bit執行,可以看到令人感動的初始畫面:


要以32-bit執行,在MATLAB_R2009b的 右鍵->簡介 中可以選擇「在32位元模式中開啟」:

甚至在工具程式->活動監視器(Activity Monitor)裡,MATLAB的「種類」也被標示成「Intel (64位元)」呢!這是我第一次看到non-Apple software被標示成64-bit XD。

至於大家最關心的速度,我先前已經用過R2009a跑了我影像處理簡介的期末Project,並記下數據了。這次我分別用R2009b(32-bit)和R2009b(64-bit)跑了一次,產生以下的結果(in seconds):


可以看出R2009b(32-bit)除了encode_img1進步12.69%以外,其他幾乎沒進步甚至還變慢Orz。
不過R2009b(64-bit)數據可就威了,幾乎都能減少10%甚至是20%的時間
而且加速原因是64-bit,而不是版本從a變b喔XD。

夠不夠厲害可能是自由心證啦,不過我是已經覺得很滿意了!

2009年9月2日 星期三

[Mac] MATLAB R2009a on Snow Leopard : An Installation Solution

If you previously installed MATLAB R2009a on OSX 10.5 Leopard, and then upgraded your OS to OSX 10.6 Snow Leopard, the MATLAB program would work fine.

But if you try to install MATLAB R2009a on Snow Leopard, you will get the following Java exception: (For those who just want to know the solution, go directly to the second image)
So I went check the log, saying:

(Sep 03, 2009 01:35:52)Starting activation process.
(Sep 03, 2009 01:35:52)Performing interactive activation.
(Sep 03, 2009 01:35:52)MATHWORKS ACTIVATION IS STARTING UP.
(Sep 03, 2009 01:35:54)com.mathworks.instutil.JNIException: java.lang.UnsatisfiedLinkError: Cant load library: /Applications/MATLAB_R2009a.app/bin/maci64/libinstutil.jnilib
java.lang.UnsatisfiedLinkError: Cant load library: /Applications/MATLAB_R2009a.app/bin/maci64/libinstutil.jnilib
com.mathworks.instutil.NativeUtility.(NativeUtility.java:30)
com.mathworks.instutil.MachineInfo.(MachineInfo.java:41)
com.mathworks.activationclient.model.ActivationModelImpl.loadNativeLib(ActivationModelImpl.java:228)
com.mathworks.activationclient.model.ActivationModelImpl.getMachineInfo(ActivationModelImpl.java:211)
com.mathworks.activationclient.view.ApplicationViewImpl.getMachineInfo(ApplicationViewImpl.java:260)
com.mathworks.activationclient.view.ApplicationViewImpl.showGUI(ApplicationViewImpl.java:116)
com.mathworks.activationclient.controller.ApplicationControllerImpl.start(ApplicationControllerImpl.java:118)
com.mathworks.activationclient.ActivationClientImpl.start(ActivationClientImpl.java:210)
com.mathworks.activationclient.ActivationApplication.goInteractive(ActivationApplication.java:186)
com.mathworks.activationclient.ActivationApplication.go(ActivationApplication.java:172)
com.mathworks.activationclient.ActivationApplication.main(ActivationApplication.java:135)

(Sep 03, 2009 01:35:54)java.lang.NullPointerException
com.mathworks.activationclient.view.ApplicationViewImpl.showGUI(ApplicationViewImpl.java:116)
com.mathworks.activationclient.controller.ApplicationControllerImpl.start(ApplicationControllerImpl.java:118)
com.mathworks.activationclient.ActivationClientImpl.start(ActivationClientImpl.java:210)
com.mathworks.activationclient.ActivationApplication.goInteractive(ActivationApplication.java:186)
com.mathworks.activationclient.ActivationApplication.go(ActivationApplication.java:172)
com.mathworks.activationclient.ActivationApplication.main(ActivationApplication.java:135)

(Sep 03, 2009 01:36:10)There was an unexpected exception:
null

Then I checked the MATLAB_R2009a.app (right click => Show Package Content), and found that
there was no such directory "bin/maci64", but only "bin/maci".
So I copied and renamed it to "maci", ran the installation again. This time I got another exception:


(Sep 03, 2009 12:26:51)com.mathworks.instutil.JNIException: java.lang.UnsatisfiedLinkError: /Applications/MATLAB_R2009a.app/bin/maci64/libinstutil.jnilib: no suitable image found. Did find: /Applications/MATLAB_R2009a.app/bin/maci/libinstutil.jnilib: mach-o, but wrong architecture /Applications/MATLAB_R2009a.app/bin/maci64/libinstutil.jnilib: mach-o, but wrong architecture
java.lang.UnsatisfiedLinkError: /Applications/MATLAB_R2009a.app/bin/maci64/libinstutil.jnilib: no suitable image found. Did find: /Applications/MATLAB_R2009a.app/bin/maci/libinstutil.jnilib: mach-o, but wrong architecture /Applications/MATLAB_R2009a.app/bin/maci64/libinstutil.jnilib: mach-o, but wrong architecture
...

This "wrong architecture" message reminded me to turn to Java settings for the final trial.
(After all, the activation program was written in Java :p)
And it worked!!

Here's the solution:
1. Use Finder to go to /Applications/Utilities/Java Preferences.
2. In the Java Application section, set 32-bit as the first priority over the 64-bit by dragging it upward.
3. Run the MATLAB R2009a installation again.

As I remember, Java in Leopard had the Java SE 5 (32-bit) as the first priority, but Snow Leopard does not! (all Java SE 6, and 64-bit first)

Hopefully you will finally see this activation window. I believe everyone knows what to do next :DD
Upon success, you can see that MATLAB R2009a runs in 32-bit mode.


I also saw some good news about the coming R2009b release from MATLAB Central blog.
The R2009b will be a 64-bit version, and will move one step closer to being entirely independent of X11. However the latter is going to take another couple of releases to accomplish...

I really look forward to the day when 64-bit + native MATLAB application become possible :)

Powered By Blogger

Google Analytics