-
Notifications
You must be signed in to change notification settings - Fork 1
Instalando dependências do pacote no Santos Dumont
Esse documento detalha como instalar as dependências do pacote Model-R no Santos Dumont.
Primeiramente, crie um diretório para manter os pacotes R na sua área no scratch:
mkdir /scratch/modler/marinez.siqueira/R_gnu
e carregue o módulo do R
module load R/3.5.2_openmpi_2.0_gnu
OBS: nessa etapa e nas seguintes, o diretório passado via parâmetro lib
é o criado na etapa acima. Troque /scratch/modler/marinez.siqueira/R_gnu
para o diretório correspondente se necessário.
R -e "install.packages('raster', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
R -e "install.packages('dismo', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
R -e "install.packages('e1071', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
R -e "install.packages('kernlab', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
R -e "install.packages('maps', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
R -e "install.packages('randomForest', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
R -e "install.packages('data.table', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
Carregue o módulo do Java:
module load java/jdk-8u201
Exporte as seguintes variáveis de ambiente para o R conseguir compilar o rJava:
export JAVA_HOME="/scratch/app/java/jdk1.8.0_201/jre"
export JAVA="/scratch/app/java/jdk1.8.0_201/jre/bin/java"
export JAVAC="/scratch/app/java/jdk1.8.0_201/bin/javac"
export JAVAH="/scratch/app/java/jdk1.8.0_201/bin/javah"
export JAR="/scratch/app/java/jdk1.8.0_201/bin/jar"
export JAVA_INCLUDE_DIR=/scratch/app/java/jdk1.8.0_201/include
export JAVA_LD_LIBRARY_PATH=/scratch/app/java/jdk1.8.0_201/lib
export JAVA_CPPFLAGS="-I/scratch/app/java/jdk1.8.0_201/include -I/scratch/app/java/jdk1.8.0_201/include/linux"
export JAVA_LIBS="-L/scratch/app/java/jdk1.8.0_201/jre/lib/amd64/server -ljvm -L/scratch/app/xz-utils/5.2.2_intel/lib"
OBS: o módulo java/jdk-8u201
não está configurando PATH
e LD_LIBRARY_PATH
ao ser carregado. Então as linhas abaixo são necessárias:
export PATH=/scratch/app/java/jdk1.8.0_201/bin:$PATH
export LD_LIBRARY_PATH=/scratch/app/java/jdk1.8.0_201/jre/lib/amd64:/scratch/app/java/jdk1.8.0_201/jre/lib/amd64/server:$LD_LIBRARY_PATH
Instale o rJava:
R -e "install.packages('rJava', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
Baixe os fontes do geos e os descompacte:
wget -c http://download.osgeo.org/geos/geos-3.6.2.tar.bz2
tar xjvf geos-3.6.2.tar.bz2
Compile-os:
cd geos-3.6.2
./configure --prefix=$SCRATCH/geos
make
Teste-os
module load gcc/6.5
make check
Instale-os:
make install
Exporte as variáveis de ambiente para o R conseguir compilar o rgeos:
export LD_LIBRARY_PATH="/scratch/modler/marinez.siqueira/geos/lib:$LD_LIBRARY_PATH"
export PATH="/scratch/modler/marinez.siqueira/geos/bin:$PATH"
Instale o rgeos:
R -e "install.packages('rgeos', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"
Carregue os módulos gdal/2.4
e proj/6.0
:
module load gdal/2.4
module load proj/6.0
Instale o rgdal
:
R -e "install.packages('rgdal', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu', configure.args = c('--with-proj-include=/scratch/app/proj/6.0/include', '--with-proj-lib=/scratch/app/proj/6.0/lib'))"
Carregue o módulo do OpenMPI:
module load openmpi/gnu/2.0.4.2
Instale o Rmpi:
R -e "install.packages('Rmpi', repos='https://cran.rstudio.com/', lib='/scratch/modler/marinez.siqueira/R_gnu')"