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