<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shocksolution.com</title>
	<atom:link href="http://www.shocksolution.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shocksolution.com</link>
	<description>computational science and engineering</description>
	<lastBuildDate>Tue, 24 Apr 2012 18:13:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Building NumPy on a 64-bit Red Hat Cluster with Intel MKL</title>
		<link>http://www.shocksolution.com/2012/04/building-numpy-on-a-red-hat-cluster-with-intel-mkl/</link>
		<comments>http://www.shocksolution.com/2012/04/building-numpy-on-a-red-hat-cluster-with-intel-mkl/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 16:40:40 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scientific computing]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=794</guid>
		<description><![CDATA[In a previous post I described how to build an optimized version of NumPy using the Intel compilers and Math Kernel Library (MKL).  This post will update those instructions, since it has been a few years and I am now using NumPy 1.6.1, MKL 10.0.1.014 and Red Hat 4.1.1 (kernel 2.6.18-8.el5). First, copy the file [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post I described <a title="Build NumPy with Intel Compilers and MKL" href="http://www.shocksolution.com/2008/12/update-2-building-64-bit-numpy-with-intel-compilers-and-mkl/" target="_blank">how to build an optimized version of NumPy using the Intel compilers and Math Kernel Library (MKL)</a>.  This post will update those instructions, since it has been a few years and I am now using NumPy 1.6.1, MKL 10.0.1.014 and Red Hat 4.1.1 (kernel 2.6.18-8.el5).</p>
<p>First, copy the file <strong>site.cfg.example</strong> to <strong>site.cfg</strong> and open it in an editor like vim. The commented lines in the file give some explanation of how it works. You only need to add the following lines:</p>
<pre>[mkl]
mkl_libs =  mkl_intel_lp64, mkl_intel_thread, mkl_core, guide
lapack_libs = mkl_lapack
include_dirs = /opt/intel/mkl/10.0.1.014/include
library_dirs = /opt/intel/mkl/10.0.1.014/lib/em64t</pre>
<p><strong>Notes:</strong></p>
<ul>
<li><strong>mkl_intel_thread</strong> and <strong>guide</strong> are only required if you want NumPy to use multi-threaded numerical libraries using OpenMP. If you use these two options, you must also pass the <strong>-openmp</strong> option to the Fortran compiler (see below).</li>
<li>The [fftw] section appears to be obsolete. <a title="SciPy wiki about building NumPy and SciPy" href="http://www.scipy.org/Installing_SciPy/Linux" target="_blank">According to the SciPy wiki, support for FFTW was dropped for NumPy &gt;= 1.2</a>. If you need a faster FFT than the fftpack that is now included with NumPy, you may want to check out this <a title="FFTW wrappers for Python" href="http://developer.berlios.de/projects/pyfftw/" target="_blank">project to build FFTW wrappers for Python</a>.</li>
</ul>
<p><span id="more-794"></span></p>
<p>Once you have fixed the config file, the following commands can be used to build NumPy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #007800;">FFLAGS</span>=<span style="color: #ff0000;">&quot;-openmp&quot;</span> python2.7 setup.py build <span style="color: #660033;">--fcompiler</span>=intelem <span style="color: #000000; font-weight: bold;">&gt;</span> stdout.txt <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> stderr.txt
python2.7 setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>Python<span style="color: #000000; font-weight: bold;">/</span>Python-2.7.3<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p><strong>Notes:</strong></p>
<ul>
<li>I set LDFLAGS=&#8221;" to make sure that the LDFLAGS set in my .bashrc weren&#8217;t used in this build.</li>
<li>Set FFLAGS=&#8221;-openmp&#8221; if you specify the libraries <strong>mkl_intel_thread</strong> and <strong>guide</strong> in site.cfg</li>
<li>I like to redirect the standard error and standard output to files that I can view later.</li>
</ul>
<p>Your configuration is successful if the first few lines of stdout look like this:</p>
<pre>F2PY Version 2
blas_opt_info:
blas_mkl_info:
  FOUND:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'guide', 'pthread']
    library_dirs = ['/opt/intel/mkl/10.0.1.014/lib/em64t']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/opt/intel/mkl/10.0.1.014/include']

  FOUND:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'guide', 'pthread']
    library_dirs = ['/opt/intel/mkl/10.0.1.014/lib/em64t']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/opt/intel/mkl/10.0.1.014/include']

lapack_opt_info:
lapack_mkl_info:
mkl_info:
  FOUND:
    libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'guide', 'pthread']
    library_dirs = ['/opt/intel/mkl/10.0.1.014/lib/em64t']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/opt/intel/mkl/10.0.1.014/include']

  FOUND:
    libraries = ['mkl_lapack', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'guide'
, 'pthread']
    library_dirs = ['/opt/intel/mkl/10.0.1.014/lib/em64t']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/opt/intel/mkl/10.0.1.014/include']

  FOUND:
    libraries = ['mkl_lapack', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'guide'
, 'pthread']
    library_dirs = ['/opt/intel/mkl/10.0.1.014/lib/em64t']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/opt/intel/mkl/10.0.1.014/include']</pre>
<p>Next step: run some benchmarks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2012/04/building-numpy-on-a-red-hat-cluster-with-intel-mkl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We won Startup Weekend Orlando!</title>
		<link>http://www.shocksolution.com/2012/04/we-won-startup-weekend-orlando/</link>
		<comments>http://www.shocksolution.com/2012/04/we-won-startup-weekend-orlando/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 17:27:16 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Entrepreneurship]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=790</guid>
		<description><![CDATA[Our team (Mole Shopper) won Startup Weekend Orlando!  It was a great experience, and I highly recommend that anyone who is interested in entrepreneurship attend a Startup Weekend event.  An MBA might tell you about how business is supposed to work, but launching a business in 52 hours will show you how business actuallyworks. We owe [...]]]></description>
			<content:encoded><![CDATA[<p>Our team (<a title="Mole Shopper: mobile software enabling customer feedback" href="http://www.moleshopper.com/" target="_blank">Mole Shopper</a>) <a title="Startup Weekend Orlando Winners" href="http://orlando.startupweekend.org/2012/03/26/winners-of-sworl-2012/" target="_blank">won Startup Weekend Orlando</a>!  It was a great experience, and I highly recommend that anyone who is interested in entrepreneurship attend a <a title="Startup Weekend" href="http://startupweekend.org/" target="_blank">Startup Weekend event</a>.  An MBA might tell you about how business is supposed to work, but launching a business in 52 hours will show you how business <em>actually</em>works. We owe a great debt to the volunteer mentors that helped us formulate our business plan and refine our pitch.  We won $5,000 in seed funding from <a href="http://www.startuporangecounty.com/">Startup Orange County</a> (Florida), three months of incubation at the <a href="http://www.venturelab.ucf.edu/">UCF Venture Lab</a>, 4 months of internet marking and social media consulting by <a href="http://www.p2gdesigns.com/">Pro2Go Designs</a>, 2 months of legal services by <a href="http://www.orlandobusinesslawyer.com/">The Entrepreneurship Law Firm</a>, a $500 credit for <a href="http://voicebunny.com/">VoiceBunny</a> and a subscription to <a href="http://startupthreads.com/">Startup Threads</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2012/04/we-won-startup-weekend-orlando/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partial derivative notation in Sage</title>
		<link>http://www.shocksolution.com/2012/03/partial-derivative-notation-in-sage/</link>
		<comments>http://www.shocksolution.com/2012/03/partial-derivative-notation-in-sage/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 18:36:26 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Sage]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=779</guid>
		<description><![CDATA[This post will explain the notation used to denote partial derivatives in the output from Sage.  It&#8217;s confusing at first, but a simple example will make it clear. Here is the input to Sage: var&#40;'x y'&#41; function&#40;'test', x, y&#41; show&#40;test&#40;x, y&#41;&#41; show&#40;diff&#40;test&#40;x, y&#41;, x&#41;&#41; show&#40;diff&#40;test&#40;x, y&#41;, x, 2&#41;&#41; show&#40;diff&#40;test&#40;x, y&#41;, y&#41;&#41; show&#40;diff&#40;test&#40;x, y&#41;, y, 2&#41;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>This post will explain the notation used to denote partial derivatives in the output from <a title="Sage" href="http://www.sagemath.org/" target="_blank">Sage</a>.  It&#8217;s confusing at first, but a simple example will make it clear. Here is the input to Sage:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">var<span style="color: black;">&#40;</span><span style="color: #483d8b;">'x y'</span><span style="color: black;">&#41;</span>
function<span style="color: black;">&#40;</span><span style="color: #483d8b;">'test'</span>, x, y<span style="color: black;">&#41;</span>
show<span style="color: black;">&#40;</span><span style="color: #dc143c;">test</span><span style="color: black;">&#40;</span>x, y<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
show<span style="color: black;">&#40;</span>diff<span style="color: black;">&#40;</span><span style="color: #dc143c;">test</span><span style="color: black;">&#40;</span>x, y<span style="color: black;">&#41;</span>, x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
show<span style="color: black;">&#40;</span>diff<span style="color: black;">&#40;</span><span style="color: #dc143c;">test</span><span style="color: black;">&#40;</span>x, y<span style="color: black;">&#41;</span>, x, <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
show<span style="color: black;">&#40;</span>diff<span style="color: black;">&#40;</span><span style="color: #dc143c;">test</span><span style="color: black;">&#40;</span>x, y<span style="color: black;">&#41;</span>, y<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
show<span style="color: black;">&#40;</span>diff<span style="color: black;">&#40;</span><span style="color: #dc143c;">test</span><span style="color: black;">&#40;</span>x, y<span style="color: black;">&#41;</span>, y, <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>I defined a function of two variables called <strong>test</strong>.  When you run this in the notebook interface, you get:</p>
<pre>test(x,y)
D[0](test)(x,y)
D[0,0](test)(x,y)
D[1](test)(x,y)
D[1,1](test)(x,y)</pre>
<p>The capital D denotes a derivative. The numbers in brackets indicate which variable the derivative is with respect to. In this example, 0 denotes <span style="color: #0000ff;">x</span> and 1 denotes <span style="color: #0000ff;">y</span>. The number of times a number is repeated indicates the order of the derivative. <strong>D[0]</strong> is the first derivative with respect to <span style="color: #0000ff;">x</span>, <strong>D[1]</strong> is the first derivative with respect to <span style="color: #0000ff;">y</span>, <strong>D[0,0]</strong> is the second derivative with respect to <span style="color: #0000ff;">x</span> and <strong>D[1,1]</strong> is the second derivative with respect to <span style="color: #0000ff;">y</span>.  Sage uses the same notation when typesetting equations in LaTeX, so you will have to do some manual typsetting if you want traditional partial derivative notation.</p>
<p>Why does Sage do it this way instead of using traditional notation?  The reason is that <strong>test</strong> is defined as a function of two variables, but Sage doesn&#8217;t know in advance what these variables will be.  <strong>test</strong> may be a function of two other functions, in which the chain rule would have to be used to display the derivatives correctly.  The <a title="Discussion on derivative notation in Sage" href="http://groups.google.com/group/sage-devel/browse_thread/thread/2c8068f27c1fb642" target="_blank">extensive discussion that went into this design decision</a> is archived in this thread.</p>
<p>If you&#8217;re new to Sage, I suggest you check out my <a title="Sage Beginner's Guide" href="http://www.packtpub.com/sage-beginners-guide/book" target="_blank">Sage Beginner&#8217;s Guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2012/03/partial-derivative-notation-in-sage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publication-quality plots with Excel</title>
		<link>http://www.shocksolution.com/2012/02/publication-quality-plots-with-excel/</link>
		<comments>http://www.shocksolution.com/2012/02/publication-quality-plots-with-excel/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 21:36:11 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Technical Writing]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=761</guid>
		<description><![CDATA[Microsoft Office tools are not the best choice for scientific publications, but sometimes you have to use them.  Some journals actually require Word documents, and many of my collaborators simply don&#8217;t do LaTeX.  The process outlined below is they best way that I&#8217;ve found to make high-quality plots and charts with Microsoft  Excel.  High-quality graphics [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft Office tools are not the best choice for scientific publications, but sometimes you have to use them.  Some journals actually require Word documents, and many of my collaborators simply don&#8217;t do LaTeX.  The process outlined below is they best way that I&#8217;ve found to make high-quality plots and charts with Microsoft  Excel.  High-quality graphics with consistent size, aspect ratio, typeface, and font size will make your publications look much more professional.  You can do this with Excel, but it requires some effort.  You will need to install the <a title="Bullzip PDF Printer" href="http://www.bullzip.com/products/pdf/info.php" target="_blank">free Bullzip PDF Printer</a> before you begin.</p>
<p><span id="more-761"></span></p>
<p>1. Create and format the chart correctly in Excel.  It&#8217;s better to insert a &#8220;floating&#8221; chart in an existing worksheet, as shown below, rather than creating a new worksheet that contains only the chart.  Set the size of the chart by right-clicking near the edge of the chart and selecting <strong>Format Chart Area</strong>.  Then select <strong>Size</strong> and set the actual size and aspect ratio that you want (try 3 inches by 4 inches).  <em>If you want a set of plots to have consistent formatting, it is very important that they are the exact same size in Excel!</em>  If the finished plots must be different sizes but have the same formatting, make the outer dimensions for all the charts big enough to accommodate the largest plot.  Then shrink the plot within the frame, leaving whitespace which will be cropped out at a later step.  Also set correct font sizes, line widths, colors, etc.</p>
<p style="text-align: left;"><a href="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/Chart_Formatting.png"><img class="size-medium wp-image-763 aligncenter" title="Proper Chart Formatting in Excel" src="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/Chart_Formatting-300x223.png" alt="" width="300" height="223" /></a></p>
<p style="text-align: left;">2. Select the chart and print.  This will print the chart, by itself, on its own page.  When the Excel print dialog opens, select &#8220;Bullzip PDF Printer&#8221; instead of your normal printer and press Print. The Bullzip dialog will open and allow you to choose options for printing to a file. Choose a TIFF file in the General tab and set the output file name.  Then go to the Image tab, select tiff24nc (24-bit RGB) and set the resolution to at least 600dpi.  I have not gotten the other TIFF formats to work correctly.  Press the Save button when finished.  The resulting file will be quite large because it is uncompressed.</p>
<p style="text-align: left;"><a href="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/Bullzip_dialog.png"><img class="aligncenter size-medium wp-image-764" title="Bullzip dialog" src="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/Bullzip_dialog-268x300.png" alt="" width="268" height="300" /></a></p>
<p>3. Open the saved file in an image editor such as the GIMP.  You will see that the chart has been printed on a large white page.  Use the crop tool to eliminate the extra whitespace around the chart.  Then choose &#8220;Save As&#8221; to save the image.  After you choose a file name, another dialog will appear to select TIFF options.  Choose &#8220;LZW&#8221; compression&#8211;it&#8217;s lossless, which is good for plots and line art.<a href="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/GIMP_save_dialog.png"><br />
<img class="aligncenter size-medium wp-image-762" title="GIMP save dialog" src="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/GIMP_save_dialog-254x300.png" alt="" width="254" height="300" /></a></p>
<p>Here is a link to the <a title="Final TIFF image" href="http://shocksolution.com/wordpress/wp-content/uploads/2012/02/test_plot.tif" target="_blank">finished TIFF image</a>.  This method is much more reliable and consistent than copying and pasting plots from Excel into Word or Powerpoint.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2012/02/publication-quality-plots-with-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PETSc and libMesh on CentOS 5</title>
		<link>http://www.shocksolution.com/2012/01/installing-petsc-and-libmesh-on-centos-5/</link>
		<comments>http://www.shocksolution.com/2012/01/installing-petsc-and-libmesh-on-centos-5/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 20:06:18 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scientific computing]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=746</guid>
		<description><![CDATA[Prerequisites: boost-devel, openmpi-devel, valgrind-devel I installed PETSc and libMesh in my user directory, since I have a single-user workstation. Installing PETSc for use with libMesh First, ensure that OpenMPI is installed and the system paths have been configured correctly.  You will need to add the directory containing OpenMPI binaries to your $PATH, and the directory [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Prerequisites:</strong> boost-devel, openmpi-devel, valgrind-devel</p>
<p>I installed PETSc and libMesh in my user directory, since I have a single-user workstation.</p>
<h2>Installing PETSc for use with libMesh</h2>
<p>First, ensure that OpenMPI is installed and the system paths have been configured correctly.  You will need to add the directory containing OpenMPI binaries to your $PATH, and the directory containing OpenMPI libraries to $LD_LIBRARY_PATH.  CentOS does <em>not</em> do this automatically!  Type <strong>mpicc</strong> on the command line to make sure the shell can find the binary.  If mpicc and mpif77 run, then you <a title="OpenMPI docs on PETSc" href="http://www.open-mpi.org/faq/?category=mpi-apps#petsc" target="_blank">should <em>not</em> need to use the comnand-line flags to the configure script for PETSc</a>.</p>
<p><span id="more-746"></span></p>
<p>If you are going to use libMesh with PETSc, you need to enable C++ with a command-line option to the configure script.  Here is the process I used (it might be a good idea to set PETSC_ARCH and PETSC_DIR in your .bashrc so they are consistent for all builds).</p>
<pre>tar xfz petsc-3.2-p6.tar.gz
cd petsc-3.2-p6
export PETSC_DIR=$PWD
./configure --with-clanguage=c++
make PETSC_ARCH=arch-linux2-c-debug all
make PETSC_ARCH=arch-linux2-c-debug test</pre>
<h2>Installing libMesh</h2>
<p>You must have <a title="Building PETSc for libMesh" href="http://comments.gmane.org/gmane.comp.mathematics.libmesh.user/2764">compiled PETSc with C++ support</a>, as detailed above, to install libMesh successfully.  Also, the environment variables PETSC_ARCH and PETSC_DIR in the libMesh build environment must have the same values used to build PETSc.  Once PETSc is built correctly, libMesh is easy to build:</p>
<pre> cd libmesh-0.7.2/libmesh
./configure
make
make run_examples</pre>
<p>That&#8217;s it!  Please comment below if you have a different experience.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2012/01/installing-petsc-and-libmesh-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paraview 3.12 on 64-bit CentOS 5.7</title>
		<link>http://www.shocksolution.com/2012/01/paraview-3-12-on-64-bit-centos-5-7/</link>
		<comments>http://www.shocksolution.com/2012/01/paraview-3-12-on-64-bit-centos-5-7/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 19:23:15 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scientific computing]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=740</guid>
		<description><![CDATA[I finally got around to installing Paraview on my CentOS 5 box.  There are no official RPMS for CentOS 5, so I was expecting a painful build process. To my great surprise, I was able to download the Paraview binary for Linux (64-bit) from Kitware, unpack the archive, and run it!  As root, I placed [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to installing Paraview on my CentOS 5 box.  There are no official RPMS for CentOS 5, so I was expecting a painful build process. To my great surprise, I was able to <a title="Download Paraview" href="http://www.paraview.org/paraview/resources/software.php" target="_blank">download the Paraview binary</a> for Linux (64-bit) from Kitware, unpack the archive, and run it!  As root, I placed the entire ParaView-3.12.0 directory under <span style="color: #0000ff;">/opt/Paraview</span>.  You could also keep it in your home directory if you are running a single-user system.  I added <span style="color: #0000ff;">/opt/Paraview/ParaView-3.12.0/bin</span> to the $PATH in the .bashrc file in my home directory.  Now I can type <strong>paraview</strong> at the command line and it runs!</p>
<p>What if you want Paraview to appear in the Applications menu in your desktop environment?  Most modern desktops (I use XFCE4) construct the Applications menu &#8220;on the fly&#8221; based upon the files in a standard directory (<span style="color: #0000ff;">/usr/share/applications</span> on CentOS).  The <a title="Free Desktop Project" href="http://www.freedesktop.org/wiki/Home" target="_blank">Free Desktop Project</a> has created a <a title="Desktop Entry File Format" href="http://standards.freedesktop.org/desktop-entry-spec/latest/" target="_blank">standard for desktop entry files</a>.  You may also find this <a title="Summary of .desktop standard" href="http://linuxcritic.wordpress.com/2010/04/07/anatomy-of-a-desktop-file/" target="_blank">summary of the standard</a> to be helpful.  To add Paraview to the menu, you simply need to create a new file in the standard location.  If you installed Paraview in your user directory, you may want to place the desktop file in <span style="color: #0000ff;">$HOME/.local/applications</span>.  Here are the contents of a file I called paraview.desktop:</p>
<pre>[Desktop Entry]
Type=Application
Name=Paraview
Categories=Graphics;3DGraphics;Science;Engineering
Comment=3D visualization tool
Exec=paraview
Icon=paraview.svg</pre>
<p>I found <a title="Paraview icons" href="http://www.paraview.org/pipermail/paraview/2008-May/007909.html" target="_blank">Paraview menu icons here</a>.  Save the SVG icon to /usr/share/icons (there may be an equivalent location in your user directory but I don&#8217;t know what it is).  Now, when you bring up the Applications menu in your desktop environment the entry should appear (no need to restart or anything).</p>
<div id="attachment_743" class="wp-caption aligncenter" style="width: 310px"><a href="http://shocksolution.com/wordpress/wp-content/uploads/2012/01/Paraview_glyphs.png"><img class="size-medium wp-image-743" title="Paraview screenshot" src="http://shocksolution.com/wordpress/wp-content/uploads/2012/01/Paraview_glyphs-300x222.png" alt="" width="300" height="222" /></a><p class="wp-caption-text">Screenshot of Paraview</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2012/01/paraview-3-12-on-64-bit-centos-5-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Sage 4.7 on CentOS 5</title>
		<link>http://www.shocksolution.com/2011/11/installing-sage-4-7-on-centos-5/</link>
		<comments>http://www.shocksolution.com/2011/11/installing-sage-4-7-on-centos-5/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 23:07:59 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sage]]></category>
		<category><![CDATA[Scientific computing]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=714</guid>
		<description><![CDATA[I recently upgraded my desktop workstation from an old 32-bit version of Gentoo to 64-bit CentOS 5.  I downloaded and installed the latest version of Sage, and the process went smoothly. If you find this post helpful, please check out the Sage Beginner&#8217;s Guide at Packt Publishing.  Since I don&#8217;t use Sage every day, I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my desktop workstation from an old 32-bit version of Gentoo to 64-bit CentOS 5.  I downloaded and installed the latest version of <a title="Sage home page" href="http://www.sagemath.org/" target="_blank">Sage</a>, and the process went smoothly.</p>
<p>If you find this post helpful, please check out the <a title="Sage Beginner's Guide" href="http://www.packtpub.com/sage-beginners-guide/book" target="_blank">Sage Beginner&#8217;s Guide at Packt Publishing</a>.  Since I don&#8217;t use Sage every day, I actually refer to my own book on a regular basis!</p>
<h3>Download</h3>
<p>Since CentOS is designed to be binary compatible with Red Hat Enterprise Linux, the correct binary to download is<br />
<strong>sage-4.7.2-linux-64bit-red_hat_enterprise_linux_server_release_5.6_tikanga-x86_64-Linux.tar.gz</strong></p>
<h3>Install</h3>
<p>Uncompress the file with <strong>tar xfz</strong> &lt;filename&gt;  The result is a huge directory (3.1Gb) with a self-contained version of Sage that can be run right where you uncompressed it.  As <strong>root</strong>, I moved the directory to <strong>/opt</strong>, changed ownership to <strong>root</strong>, and changed the name to <strong>sage-4.7.2</strong>.  I then edited the script <strong>/opt/sage-4.7.2/sage</strong> so that the variable SAGE_ROOT contains the correct path:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">SAGE_ROOT</span>=<span style="color: #ff0000;">&quot;/opt/sage-4.7.2&quot;</span></pre></div></div>

<p>Run sage once as root to set the paths correctly.</p>
<p><span id="more-714"></span></p>
<h3>User Access</h3>
<p>To make it easier to run Sage,  I created a symbolic link to the Sage run script in /usr/bin/:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>sage-4.7.2<span style="color: #000000; font-weight: bold;">/</span>sage sage</pre></div></div>

<p>Since this directory is on every user&#8217;s default path, a user can now start Sage by simply typing <strong>sage</strong> in a terminal.</p>
<h3>Notebook Interface</h3>
<p>When you first start Sage you will get a comnand-line interface in a terminal, which is very similar to iPython.  If you want to use a more graphical interface, type <strong>notebook()</strong> at the Sage command prompt:</p>
<div id="attachment_722" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.shocksolution.com/2011/11/installing-sage-4-7-on-centos-5/screenshot-1/" rel="attachment wp-att-722"><img class="size-medium wp-image-722" title="Launching Sage Notebook" src="http://shocksolution.com/wordpress/wp-content/uploads/2011/11/Screenshot-1-300x173.png" alt="" width="300" height="173" /></a><p class="wp-caption-text">Launching Sage Notebook</p></div>
<p>You will have to create an admin password, as shown above.  Follow the advice and create a secure password.  If a new browser tab or window doesn&#8217;t automatically open, open one manually and paste <strong>http://localhost:8000</strong> into the address field.  You are now logged in as a user called <strong>admin</strong>, so I suggest creating a separate user account for yourself (for the same reason that you should only use the <strong>root</strong> account for system administration on a Linux system).  From the links at the top of the screen choose <span style="color: #0000ff;">Settings-&gt;Manage Users-&gt;Add User</span>.  After entering a user name, you will be given a temporary password.  Copy the temporary password, log out, and log in with your new user name and temporary password.  I suggest that you go to <span style="color: #0000ff;">Settings</span> and change your password to something easier to remember.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2011/11/installing-sage-4-7-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python string format examples</title>
		<link>http://www.shocksolution.com/2011/11/python-string-format-examples/</link>
		<comments>http://www.shocksolution.com/2011/11/python-string-format-examples/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 22:38:10 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Scientific computing]]></category>
		<category><![CDATA[Software development]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=705</guid>
		<description><![CDATA[The format method for Python strings (introduced in 2.6) is very flexible and powerful.  It&#8217;s also easy to use, but the documentation is not very clear.  It all makes sense with a few examples.  I&#8217;ll start with one and add more as I have time: Formatting a floating-point number &#34;{0:.4f}&#34;.format&#40;0.1234567890&#41; The result is the following [...]]]></description>
			<content:encoded><![CDATA[<p>The <a title="Python strings format method" href="http://docs.python.org/library/string.html#format-string-syntax" target="_blank">format method for Python strings</a> (introduced in 2.6) is very flexible and powerful.  It&#8217;s also easy to use, but the documentation is not very clear.  It all makes sense with a few examples.  I&#8217;ll start with one and add more as I have time:</p>
<h2>Formatting a floating-point number</h2>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #483d8b;">&quot;{0:.4f}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.1234567890</span><span style="color: black;">&#41;</span></pre></div></div>

<p>The result is the following string:</p>
<pre>'0.1235'</pre>
<h3>Explanation</h3>
<p>Braces { } are used to enclose the &#8220;replacement field&#8221;<br />
0 indicates the first argument to method <strong>format</strong><br />
: indicates the start of the format specifier<br />
.4 indicates four decimal places<br />
f indicates a floating-point number</p>
<h2>Scientific Notation</h2>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #483d8b;">&quot;{0:.4e}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.1234567890</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Output:</p>
<pre>'1.2346e-01'</pre>
<h2>Multiple Arguments</h2>
<p>In Python 2.6 you can include multiple arguments like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #483d8b;">&quot;sin({0:.4f}) = {1:.4e}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.1234567890</span>, sin<span style="color: black;">&#40;</span><span style="color: #ff4500;">0.123456789</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<pre>'sin(0.1235) = 1.2314e-01'</pre>
<p>In Python 2.7 and later, you may omit the first integer from each replacement field, and the arguments to <strong>format</strong> will be taken in order:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #483d8b;">&quot;sin({:.4f}) = {:.4e}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.1234567890</span>, sin<span style="color: black;">&#40;</span><span style="color: #ff4500;">0.123456789</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<pre>'sin(0.1235) = 1.2314e-01'</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2011/11/python-string-format-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux kernel 3.1 config for Gentoo guest on VMWare Fusion</title>
		<link>http://www.shocksolution.com/2011/10/linux-kernel-3-1-config-for-gentoo-guest-on-vmware-fusion/</link>
		<comments>http://www.shocksolution.com/2011/10/linux-kernel-3-1-config-for-gentoo-guest-on-vmware-fusion/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 03:23:48 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=699</guid>
		<description><![CDATA[The following kernel configuration was posted by Alessandro Di Marco as a comment on a previous post in which I provided a Linux kernel config for an earlier version of the kernel. In the interest of sharing his contribution, I&#8217;m placing it in its own post. I don&#8217;t know the author personally and I have [...]]]></description>
			<content:encoded><![CDATA[<p>The following kernel configuration was posted by Alessandro Di Marco as a comment on a previous post in which I provided a Linux kernel config for an earlier version of the kernel. In the interest of sharing his contribution, I&#8217;m placing it in its own post. I don&#8217;t know the author personally and I have not tried this config.  Like any other free software, you are <span style="color: #ff0000;">using it at your own risk and neither Alessandro nor I provide any warranty</span>. Download the file from the link below, change the file extension from .txt. to .config and load the config into one of the standard kernel configuration tools (such as <strong>make menuconfig</strong>) and look over all the options before using it.</p>
<p><a href="http://shocksolution.com/wordpress/wp-content/uploads/2011/11/gentoo_kernel31_config.txt">Gentoo Kernel 3.1 Config</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2011/10/linux-kernel-3-1-config-for-gentoo-guest-on-vmware-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TeXLive and Asymptote on CentOS 5</title>
		<link>http://www.shocksolution.com/2011/10/texlive-and-asymptote-on-centos-5/</link>
		<comments>http://www.shocksolution.com/2011/10/texlive-and-asymptote-on-centos-5/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 18:18:50 +0000</pubDate>
		<dc:creator>craig</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.shocksolution.com/?p=689</guid>
		<description><![CDATA[Tex Live For reasons unknown, a TeX Live package is not available for Red Hat Enterprise Linux/Centos 5 from the major repositories (EPEL or DAG).  I consider this to be a glaring omission, since TeXLive is a great improvement upon teTeX.  Since I don&#8217;t have time right now to package it myself, I installed TeX [...]]]></description>
			<content:encoded><![CDATA[<h3>Tex Live</h3>
<p>For reasons unknown, a <a title="TeX Live" href="http://www.tug.org/texlive/" target="_blank">TeX Live</a> package is not available for Red Hat Enterprise Linux/Centos 5 from the major repositories (EPEL or DAG).  I consider this to be a glaring omission, since TeXLive is a great improvement upon teTeX.  Since I don&#8217;t have time right now to package it myself, I installed TeX Live manually in my user directory and it&#8217;s working fine.  I used the network install process, which starts with <a title="Tex Live installation script" href="http://www.tug.org/texlive/acquire-netinstall.html" target="_blank">downloading a command-line installer</a> and then following the <a title="Detailed TeX Live installation instructions" href="http://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-150003" target="_blank">detailed installation instructions </a>with the base path set to <span style="color: #000080;">$HOME/texlive/2011</span>.</p>
<h3>Asymptote</h3>
<p>The binary version of <a title="Asymptote vector graphics language" href="http://asymptote.sourceforge.net/" target="_blank">Asymptote</a> installed with TeX Live didn&#8217;t run on my system, so I installed the Asymptote vector graphics language manually.  As root, I used <strong>yum</strong> to install the <strong>gc</strong> and <strong>gc-devel</strong> packages to provide the <a title="Boehm garbage collector" href="http://www.hpl.hp.com/personal/Hans_Boehm/gc/" target="_blank">Boehm garbage collector</a> that Asymptote uses.  I also had to install the package <strong>texinfo-tex</strong> from the CentOS base repo to provide the <strong>texindex</strong> utility that Asymptote uses to build its documentation.  Once the dependencies were in place, I downloaded the Asymptote source archive and unpacked it.  I used the following commands to build Asymptote in my user directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>asymptote
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Finally, I set up up the path environment variable in my .bashrc so that the copy of Asymptote I just built will run instead of the binary that comes with TeX Live and my locally installed TeX Live will run instead of the system installation of teTeX:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=~<span style="color: #000000; font-weight: bold;">/</span>asymptote<span style="color: #000000; font-weight: bold;">/</span>bin:~<span style="color: #000000; font-weight: bold;">/</span>texlive<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2011</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>x86_64-linux:<span style="color: #007800;">$PATH</span></pre></div></div>

<p>If you are doing this from scratch, you should check whether there is a away to prevent the TeX Live installer from installing Asymptote.</p>
<p>Technically, I could remove the system installation of teTeX at this point, but the <a title="LyX" href="http://http://www.lyx.org/" target="_blank">LyX</a> package depends on teTeX and I&#8217;ll have to see if there&#8217;s a way to tell yum to keep LyX and get rid of teTeX.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shocksolution.com/2011/10/texlive-and-asymptote-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

