-
-
Save jwbowers/2031115 to your computer and use it in GitHub Desktop.
## First do the unix account setup http://wiki.dreamhost.com/Unix_account_setup | |
cd ${HOME} | |
# create the first level directories (and log/setup) | |
mkdir -pv soft run www log log/setup backup data | |
# create the second level directories within run (our own FHS) | |
for subdir in bin etc include lib man share | |
do | |
mkdir -pv run/${subdir} | |
done | |
# symlink so that man pages stay all in the same place | |
ln -sv ../man run/share/man | |
# symlink so that the apache logs are also found within log | |
ln -sv ../logs log/vhosts | |
mkdir -pv ${HOME}/.cpan/CPAN | |
cat > ${HOME}/.cpan/CPAN/MyConfig.pm <<eof | |
\$CPAN::Config = { | |
'auto_commit' => q[0], | |
'build_cache' => q[10], | |
'build_dir' => q[\$ENV{HOME}/.cpan/build], | |
'cache_metadata' => q[1], | |
'commandnumber_in_prompt' => q[1], | |
'cpan_home' => q[\$ENV{HOME}/.cpan], | |
'dontload_hash' => { }, | |
'ftp' => q[/usr/bin/ftp], | |
'ftp_passive' => q[1], | |
'ftp_proxy' => q[], | |
'getcwd' => q[cwd], | |
'gpg' => q[/usr/bin/gpg], | |
'gzip' => q[/bin/gzip], | |
'histfile' => q[\$ENV{HOME}/.cpan/histfile], | |
'histsize' => q[100], | |
'http_proxy' => q[], | |
'inactivity_timeout' => q[0], | |
'index_expire' => q[1], | |
'inhibit_startup_message' => q[0], | |
'keep_source_where' => q[\$ENV{HOME}/.cpan/sources], | |
'lynx' => q[/usr/bin/lynx], | |
'make' => q[/usr/bin/make], | |
'make_arg' => q[], | |
'make_install_arg' => q[], | |
'make_install_make_command' => q[/usr/bin/make], | |
'makepl_arg' => q[PREFIX=\$ENV{RUN}], | |
'mbuild_arg' => q[], | |
'mbuild_install_arg' => q[], | |
'mbuild_install_build_command' => q[./Build], | |
'mbuildpl_arg' => q[], | |
'ncftpget' => q[/usr/bin/ncftpget], | |
'no_proxy' => q[], | |
'pager' => q[less], | |
'prerequisites_policy' => q[follow], | |
'scan_cache' => q[atstart], | |
'shell' => q[/bin/bash], | |
'tar' => q[/bin/tar], | |
'term_is_latin' => q[0], | |
'term_ornaments' => q[1], | |
'unzip' => q[/usr/bin/unzip], | |
'urllist' => [q[ftp://cpan.cse.msu.edu/], q[ftp://cpan-du.viaverio.com/pub/CPAN/], q[ftp://cpan.mirrors.redwire.net/pub/CPAN/], q[ftp://cpan.hostrack.net/pub/CPAN]], | |
'use_sqlite' => q[0], | |
'wget' => q[/usr/bin/wget], | |
}; | |
1; | |
__END__ | |
eof | |
cat >>${HOME}/.bashrc <<eof | |
function pathmunge () { | |
if [ -d \$1 ] && ! echo $PATH | /bin/egrep -q "(^|:)\$1(\$|:)" | |
then | |
if [ "\$2" = "after" ] | |
then | |
PATH=$PATH:\$1 | |
else | |
PATH=\$1:\$PATH | |
fi | |
fi | |
} | |
export RUN="\${HOME}/run" | |
pathmunge \${RUN}/bin | |
export LD_LIBRARY_PATH=\${RUN}/lib:\${LD_LIBRARY_PATH} | |
export LD_RUN_PATH=\${RUN}/lib:\${LD_RUN_PATH} | |
# perl library search path | |
PERL5LIB=\${RUN}/share/perl/5.8:\${RUN}/share/perl/5.8.4:\${PERL5LIB} | |
export PERL5LIB=\${RUN}/lib/perl/5.8:\${RUN}/lib/perl/5.8.4:\${PERL5LIB} | |
eof | |
## THEN | |
cd ~/soft | |
curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.0.tar.gz | |
tar xzvf readline-6.0.tar.gz | |
cd ~/soft/readline-6.0 | |
./configure --prefix=${HOME}/run | |
make | |
make install | |
cd ~/soft | |
## OLD:installing R-2.9.2 went without problem. | |
wget http://cran.r-project.org/src/base/R-2/R-2.14.2.tar.gz | |
tar xvzf R-2.13.1.tar.gz | |
cd ~/soft/R-2.13.1 | |
./configure --prefix=${HOME}/run --with-x=no LDFLAGS=-L${HOME}/run/lib | |
make | |
## when trying recent R got "Yikes! One of your processes was just killed because yourprocesses are, as a whole, consuming too much memory." in response to gfortran -fopenmp -fpic -g -O2 -c dlapack3.f -o dlapack3.o | |
## So, I just went an compiled by hand. The optimization in O2 was causing the trouble | |
cd src/modules/lapack/ | |
gfortran -fopenmp -fpic -g -c dlapack3.f -o dlapack3.o | |
cd ../../../ | |
make | |
make install | |
##install R packages (inside R) | |
##install.packages(c("bitops", "plyr", "car", "XML"), dep=TRUE) | |
##install RCurl | |
## first install curl | |
cd ~/soft | |
wget http://curl.haxx.se/download/curl-7.21.7.tar.gz | |
tar -vxzf curl-7.21.7.tar.gz | |
cd ~/soft/curl-7.21.7 | |
./configure --prefix=$HOME/run LDFLAGS=-L${HOME}/run/lib | |
make | |
make install | |
## now RCurl | |
cd ~/soft | |
wget http://cran.r-project.org/src/contrib/RCurl_1.6-6.tar.gz | |
## with more recent versions of R, install doesn't work if a configure file is present in the | |
## package as it needs to know whether to target bit64 systems. | |
## It may be possible to use R --arch='x86_64' CMD INSTALL RCurl --configure-args='exec_prefix=${HOME}/run' | |
tar -vxzf RCurl_1.6-6.tar.gz | |
cd RCurl | |
./configure | |
rm configure | |
R CMD INSTALL RCurl --configure-args='exec_prefix=${HOME}/run' | |
Hi. I should preface this by saying I really don't know what I am doing, I am trying to install R on my dreamhost account so I can run some R scripts on a cron job so I am trying to pick up some of this stuff with internet searches. I am trying to follow your code but it breaks with this line when (I guess) trying to install R:
./configure --prefix=${HOME}/run --with-x=no LDFLAGS=-L${HOME}/run/lib
it seems that my dreamhost does not have a fortran compiler? How do I get around this? Especially since you used the command "gfortran" soon after this, but when I type gfortran into my shell it doesnt know what I am talking about.
Any help would be seriously appreciated!!
Also, I guess there is a small typo in your code with the version numbers not matching:
wget http://cran.r-project.org/src/base/R-2/R-2.14.2.tar.gz
tar xvzf R-2.13.1.tar.gz
cd ~/soft/R-2.13.1
The key here was that the O2 optimization on gcc compilation was too memory intensive for dlapack3.f (and nothing else so far). So I disabled that optimization in the compilation of that particular file.