簡體   English   中英

通過bash文件在本地編譯R時出錯

[英]Error compiling R locally via bash file

我正在嘗試使用bash文件在本地編譯R,但是它失敗並顯示以下錯誤:

tar: command not found
cd: R-3.2.5: No such file or directory
./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.
R-3.2.5/lib64/R/bin/R: No such file or directory
sed: command not found
mv: command not found
tar: command not found

貝婁是我提交的bash文件:

#!/bin/bash
tar -xzvf R-3.2.5.tar.gz
cd R-3.2.5
./configure --prefix=$(pwd)
make
make install
cd ..
R-3.2.5/lib64/R/bin/R -e 'install.packages(c("BGLR"), 
repos="http://cran.cnr.berkeley.edu/", dependencies = TRUE)'
sed -i '/^R_HOME_DIR=/c R_HOME_DIR=$(pwd)/R' R-3.2.5/lib64/R/bin/R
mv R-3.2.5/lib64/R ./
tar -czvf R.tar.gz R/

當我直接在終端上運行相同的命令行時,它可以正常工作,但是當我嘗試使用bash文件運行它們時,它將失敗。

有誰知道如何使它起作用?

用於運行腳本的bash實例似乎沒有正確設置$PATH變量,因此無法找到tar和其他命令。

嘗試用#!/bin/bash -l替換第一行。 添加echo Path: $PATH作為第二行,並查看列出的目錄之一是否實際包含tar。 您應該得到類似/bin:/sbin:/usr/bin/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM