Local Web Hosting on Arch
September 11th, 2011Installing R Rmpi on Arch Linux
April 7th, 2011After 2.5 hours I have finally managed to get Rmpi installed and working on Arch.
After lots of trying and searching I finally found out that Rmpi is not compatible with the latest version of openmpi which is installed from the Arch repos (version 1.5.3-2). Following the recommendation here I was able to get Rmpi working by reverting to openmpi version 1.4.3, which is in fact the current release.
To do this, I downloaded openmpi 1.4.3 from the Open MPI download page, extracted the tarball, compiled and installed the source in the usual way:
./configure
make
make install
After installation I then followed the directions here with modifications to account for the new install location. Specifically, I ran the command:
sudo ldconfig /usr/local/lib/openmpi/
and then added the line:
export LD_LIBRARY_PATH=/usr/local/lib/openmpi/:$LD_LIBRARY_PATH
to my .bashrc file.
Finally, I was able to install Rmpi in R using the following command:
install.packages("Rmpi",
configure.args =
c("--with-Rmpi-include=/usr/local/include/",
"--with-Rmpi-libpath=/usr/local/lib/openmpi/",
"--with-Rmpi-type=OPENMPI"))
I have now test Rmpi by running the script I posted previously after opening R as:
/usr/local/bin/mpirun -np 1 R --vanilla
and it all seems to work as expected. Phew!
Introduction to Matrix Calculus
November 19th, 2010Link: http://www4.ncsu.edu/~pfackler/MatCalc.pdf
This is a great reference for those who may have forgotten (or keep forgetting) their matrix derivative rules -- like me! The summary at the end is especially useful. Thanks Paul!!
Webcam with Skype 2.1.0.81 in Ubuntu 9.10
October 7th, 2010I recently upgraded Skype to version 2.1.0.81, and since then I've been having troubles with my web cam (Microsoft Lifecam NX-6000). The camera would work in other applications, and Skype would detect it but couldn't grab the image either in the test or in an actual call. I stumbled upon this post and creating a simple wrapper to change the LD_PRELOAD environment variable seems to have worked. The entire script is:
#/bin/bash
export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so
/usr/bin/skype
and the camera now works if I run run_skype. Don't forget to make the script executable!
Line number and amsmath
October 6th, 2010Line numbering is difficult for LaTeX because the line numbers are only known after the text has been typeset. The lineno package does a pretty good job, but it sometimes gets confused and can leave seemingly random sections of the document without numbers. I recently had this problem when submitting a paper for Biometrics using the provided style file. I then stumbled upon this great fix. Simply copy the following text and place it in your LaTeX file before the \begin{document} command:
\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}}%
\AtBeginDocument{%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}
Worked like a charm for me!