参考资料看这里
「一定要在login node下安装R包!!」 🔗
module spider r ## 可以看到有哪些可用的R版本
You will need to load all module(s) on any one of the lines below before the “mpfr/4.0.2” module is available to load.
gcc/8.3.0 intel/2019u3
module load gcc/8.3.0 r/4.1.2 ## 加载 R,和其他的modules
然后在terminal输入R,即可打开R界面。安装R包和在本地安装一样,
install.packages("tidyverse",repos = "https://cloud.r-project.org/")
magrittr package版本不对,unload后重装
# Unload the 'caret' package
library(caret, unload = TRUE)
# Install or update the 'generics' package
install.packages("generics") # Replace with the correct version if needed
# Load the 'generics' package
library(generics)
# Load the 'caret' package
library(caret)
install.packages("magrittr") # Replace with the correct version if needed
# Load the 'generics' package
library(magrittr)
# Load the 'caret' package
library(tidyverse)
# Check the version of the 'generics' package
packageVersion("generics")
package RcppEigen had non-zero exit status。🥶🥶🥶解决方案:安装source版本
正在安装千万不要暂停!!
libgfortran.so.5 cannot open shared object file: No such file or directory,更多的报错如下:
Loading required package: Matrix Error: package or namespace load failed for ‘glmnet’ in dyn.load(file, DLLpath = DLLpath, …): unable to load shared object ‘/gpfs/fs1/home/w/PIname/username/R/x86_64-pc-linux-gnu-library/4.1/glmnet/libs/glmnet.so’: libgfortran.so.5: cannot open shared object file: No such file or directory
Lmod is automatically replacing “gcc/8.3.0” with “intel/2019u4”.
然后我check了我本地电脑的libgfortran文件,但我并没有意识到它在gcc module 下(太无知了…)
然后我就找了一下server上的libgfortran文件,发现别人怎么都有这个文件!!!所以应该不是没有安装的问题。然后我捯饬很久之后发现报错里面写了Lmod is automatically replacing “gcc/8.3.0” with “intel/2019u4”. 这时候我才意识到我的bash里面load了多余的module,因为最开始它提示我加载其中一个,我想着多多益善..应该不影响…🥶🥶🥶
You will need to load all module(s) on any one of the lines below before the “mpfr/4.0.2” module is available to load.
然后我的gcc被替换掉了,所以一直不能attach到这个gcc下的libgfortran文件…🥶🥶🥶
#!/bin/bash
#SBATCH --nodes=2
#SBATCH --cpus-per-task 40
#SBATCH --time=0-08:00:00
#SBATCH --job-name sim_set1_4test
#SBATCH --output=sim_set1_%j.txt
#SBATCH --mail-type=ALL
module load gcc/8.3.0 intel/2019u4 r/4.1.2
MAINDIR=/scratch/w/PIname/username/HDSI
cd ${MAINDIR}
Rscript ${MAINDIR}/R/99_sim_set1_ccdb4_test.R
将module load gcc/8.3.0 intel/2019u4 r/4.1.2 中的intel/2019u4去掉..done!
然后我们把路径切换到scratch下,或者通过在.sh文件中增加
MAINDIR=/scratch/w/PIname/username/HDSI
cd ${MAINDIR}
把需要用的的数据都传到/scratch/w/PIname/username/HDSI目录下。然后用$scratch sbatch sim_set3_35.sh 提交工作