Tuesday, January 27, 2015

Install Hangul on Xubuntu 14.04

http://www.devblog.kr/r/8y0gFPAvJ2g9Z93GU2yp2Z93BNSroOEGK9Z05Whax9mN9Z7TmphZP8Z48gtkhftdt89ztuC04Bpte1ub94O

Tuesday, May 27, 2014

Proper TexLive 2013 installation on Ubuntu 12.04

For TeXLive 2012, but works perfectly with TeXLive 2013

http://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu


Monday, May 5, 2014

Using RcppEigen with sparseMatrix class

ecode <- '
using Eigen::Map;
using Eigen::MatrixXd;
using Eigen::MappedSparseMatrix;
using Eigen::SparseMatrix;

MappedSparseMatrix<double> X(as<MappedSparseMatrix<double> >(XX));

SparseMatrix<double> Xc = SparseMatrix<double>(X);
Xc = SparseMatrix<double>(Xc.selfadjointView<Eigen::Lower>());

return wrap(Xc);
'

SeigenXSX <- cxxfunction(signature(SS = "matrix", XX="dgCMatrix"), ecode,
plugin = "RcppEigen")

Friday, April 11, 2014

Installing Rmpi on NERSC's carver

The directory that contains MPI libraries is OMPI_DIR=/usr/common/usg/openmpi/1.4.5/intel; hence, we can adapt the code on this page (http://internet2.binghamton.edu/teragrid/readdoc.cgi?fname=1_1_Rmpi-Steele-2010-11-16.txt).

Use the following code in R.

local({
    my.configure.args <- list(
        "Rmpi" =
        c("--with-Rmpi-include=$OMPI_DIR/include",
          "--with-Rmpi-libpath=$OMPI_DIR/lib",
          "--with-Rmpi-type=OPENMPI")
        );
    options("configure.args" = my.configure.args);
    options(repos=c(CRAN="http://cran.cnr.Berkeley.edu"));
})


Monday, April 7, 2014

Building emacs on NERSC systems

Emacs on NERSC systems are old, so I tried to compile emacs from source. The compiler is older as well, so I encountered errors during compile time.

regex.o: In function `stpncpy': 
/usr/include/bits/string3.h:160: multiple definition of `stpncpy' /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here 
regex.o: In function `realpath': 
/usr/include/bits/stdlib.h:37: multiple definition of `realpath' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here 
regex.o: In function `ptsname_r': 
/usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here 
regex.o: In function `wctomb': 
/usr/include/bits/stdlib.h:74: multiple definition of `wctomb' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here 
regex.o: In function `mbstowcs': 
/usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here 
regex.o: In function `wcstombs': 
/usr/include/bits/stdlib.h:114: multiple definition of `wcstombs' /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here 

To get around this, use this trick:
./configure CPPFLAGS="-fgnu89-inline"

Source: http://stackoverflow.com/questions/15285776/multiple-definitions-when-linking-collect2-error-ld-returned-1-exit-status


For faster R use OpenBLAS and Rmpi

http://www.stat.cmu.edu/~nmv/2013/07/09/for-faster-r-use-openblas-instead-better-than-atlas-trivial-to-switch-to-on-ubuntu/

http://www.stat.berkeley.edu/~paciorek/statComputing/statComputing.html

Wednesday, March 26, 2014

Mount sshfs in /etc/fstab with fuse

Add the following line in /etc/fstab

[username]@[hostname]:[remote source path] [local mount path] fuse.sshfs user,_netdev,uid=1000,IdentityFile=[path to ssh key],reconnect,allow_other 0 0