Saturday, October 31, 2009

Compile Rmpi with Windows MPI (HPC pack)

Compile Rmpi (http://www.stats.uwo.ca/faculty/yu/Rmpi/) in Windows

1. Install HPC Pack 2008 SDK with SP1 and modify line 314 in mpi.h (installed_dir\Include) as follows:
//typedef __int64 MPI_Offset;
typedef long long MPI_Offset;

2. Download Rmpi from http://www.stats.uwo.ca/faculty/yu/Rmpi/download/linux/Rmpi_0.5-7.tar.gz

3. Untar the source and modify src/Makevars.win by changing directory and library option (-lmsmpi) as follows:
PKG_CFLAGS = -I"C:\Program Files\Microsoft HPC Pack 2008 SDK\Include" -DMPI2 -DWin32
PKG_LIBS = -L"C:\Program Files\Microsoft HPC Pack 2008 SDK\Lib\i386" -lmsmpi

4. Compile and install
R CMD INSTALL Rmpi

5. Build for re-distribution
R CMD build --binary Rmpi

Wednesday, October 28, 2009

Setting up a non-admin SVN repository shared with multiple users

A trick is using SSH with public key as described in

As a quick summary, I have set up a SVN repository as follows:
1. create a svn root directory, which will share with others, and create a repository:
$ mkdir /path/svnshare
$ svnadmin create /path/svnshare/project

2. Get public keys of user to share svn repository and insert to ~/.ssh/authorized_keys the following line:
command="/path/to/svnserve -t -r /path/svnshare --tunnel-user=[USERID]",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty [KEY_TYPE] [PUB_KEY] [COMMENT]
[.] should be replaced with users' information

3. Now users can access the shared svn repository remotely as follows:
svn co svn+ssh://[MYID]@[SERVER IP or DNS]/project

Note that use relative path names of repository after server ip or dns