<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>unitstep.net &#187; matlab</title>
	<atom:link href="http://unitstep.net/blog/category/matlab/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitstep.net</link>
	<description>the home of peter chng</description>
	<pubDate>Sun, 30 Nov 2008 23:12:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Getting Matlab to run on a newer Athlon 64 (X2) CPU</title>
		<link>http://unitstep.net/blog/2006/08/21/getting-matlab-to-run-on-a-newer-athlon-64-x2-cpu/</link>
		<comments>http://unitstep.net/blog/2006/08/21/getting-matlab-to-run-on-a-newer-athlon-64-x2-cpu/#comments</comments>
		<pubDate>Tue, 22 Aug 2006 00:46:20 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
		
		<category><![CDATA[fix]]></category>

		<category><![CDATA[matlab]]></category>

		<guid isPermaLink="false">http://unitstep.net/blog/2006/08/21/getting-matlab-to-run-on-a-newer-athlon-64-x2-cpu/</guid>
		<description><![CDATA[I recently installed Matlab v7.0 (R14) on my new computer and ran into some troubles.  After starting Matlab, the program window would open as normal, but then it would shutdown almost immediately, usually after about a second or so delay, allowing me to tantalizingly see that it almost working.  I did a search [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed Matlab v7.0 (R14) on my <a href="http://unitstep.net/blog/2006/05/28/new-computer/">new computer</a> and ran into some troubles.  After starting Matlab, the program window would open as normal, but then it would shutdown almost immediately, usually after about a second or so delay, allowing me to tantalizingly see that it almost working.  I did a search and found <a href="http://asadasif.com/index.php?itemid=2">this helpful article</a> on how to fix the problem.</p>
<p>The issue (Matlab closing right after start-up) stems from Matlab (at least this version, the newer versions might not be affected) not &#8220;recognizing&#8221; the processor string for newer AMD Athlon 64-based processors; in my case, I had an Athlon 64 X2 3800+.  Matlab relies on different Basic Linear Algebra Subprograms (or <abbr title="Basic Linear Algebra Subprograms">BLAS</abbr>) routines for different types of CPUs, and these are stored in different <abbr title="Dynamic Link Library">DLL</abbr> files.</p>
<p>The <abbr title="Basic Linear Algebra Subprograms">BLAS</abbr> file responsible for telling Matlab which <abbr title="Dynamic Link Library">DLL</abbr> file to use for what type of CPU is located at: </p>
<p><code>%MATLAB7%\bin\win32\blas.spec</code><br />
<span class="note">(where <code>%MATLAB7%</code> is the path to your Matlab installation)</span></p>
<p>To fix the problem, open up the file in a text-editor, and add the following two lines to the bottom:</p>
<pre>
<code>AuthenticAMD Family 15 Model 12 atlas_Athlon.dll # Athlon 64 (Newcastle)
AuthenticAMD Family 15 Model * atlas_Athlon.dll # AMD64</code></pre>
<p>This will tell Matlab to use the <strong>proper</strong> <abbr title="Dynamic Link Library">DLL</abbr> file with your newer AMD-64-based CPU, instead of apparently defaulting to using a Pentium <abbr title="Dynamic Link Library">DLL</abbr> file when an unrecognized CPU is detected.</p>
<h3>More on the problem</h3>
<p>As mentioned, the problem stems from the CPU being unrecognized by Matlab&#8217;s configuration file.  All CPUs have some sort of identifier string, and Matlab uses this to determine what <abbr title="Dynamic Link Library">DLL</abbr> file to use.  When an unrecognized CPU string is detected, it apparently defaults to using a Pentium <abbr title="Dynamic Link Library">DLL</abbr> file; this results in Matlab crashing when it&#8217;s run on an AMD-64-based CPU, and results in the crash-on-start behaviour.</p>
<p>Why the different <abbr title="Dynamic Link Library">DLL</abbr> files for different CPUs? My guess is that the <abbr title="Basic Linear Algebra Subprograms">BLAS</abbr>, upon which Matlab is based, are optimized or made to work better with select CPUs.  It should be noted that these problems may not be experienced if you&#8217;re running a more current version of Matlab.</p>
<p>I did a little more searching and found <a href="http://newsreader.mathworks.com/WebX?14@338.nV1cb9iHImm@.ef28925">this forum thread</a> over at the Matlab website, where a different fix for the same problem is presented.  It involves setting a Windows environment variable instead of editing the <code>blas.spec</code> file, but should do the same thing; I haven&#8217;t tried it.  This <a href="http://www.codecomments.com/archive381-2005-5-505181.html">other forum thread</a> also details a similar procedure. </p>
<p>Hope this helps in fixing any Matlab ailments you might have had, because running into a problem like this can be frustrating as heck when you need to have an assignment done for tomorrow!</p>
<h3>Update</h3>
<p>I&#8217;d just like to say that a dual-core setup <em>totally rocks</em>.  It&#8217;s awesome to be able to still play <abbr title="Counter-Strike: Source">CS:S</abbr> while running a Matlab simulation.</p>
<hr/>Copyright &copy; 2008 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2006/08/21/getting-matlab-to-run-on-a-newer-athlon-64-x2-cpu/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
