Pmetrics:在调用 PMBuild() 之前声明默认的 Fortran 编译器
Pmetrics: declare default fortran compiler before calling PMBuild()
我们正在尝试使用名为 Pmetrics
的 R 包
这通常不支持 Linux 环境,但我们想在并行设置中执行一些测试。例如。 1000 运行s 分布在 20 个容器上的分布式测试。
使用此 Dockerfile 可以重现错误。
FROM centos:centos7.5.1804
RUN yum -y install gcc-gfortran epel-release
RUN mkdir /root/pksim
RUN mkdir /root/pksim/Rlibraries
WORKDIR /root/pksim
RUN yum -y install R
COPY test.r test.r
COPY install.r install.r
install.r 脚本包含这些行
.libPaths("/root/pksim/Rlibraries")
install.packages("http://www.lapk.org/software/Pmetrics/Repos/src/contrib/Pmetrics_1.5.2.tar.gz", repos=NULL)
test.r 脚本包含这些行
r = getOption("repos")
r["CRAN"] = "http://lib.ugent.be/CRAN/"
options(repos = r)
rm(r)
.libPaths("/root/pksim/Rlibraries")
library(Pmetrics)
PMbuild()
您可以使用这些命令完成这项工作:
- 构建图像:
docker build -t pksim .
- 运行 图片:
docker run -ti pksim /bin//bash
。应该会出现一个控制台。
- 运行 R install.r 脚本(在控制台上):
Rscript install.r
- 运行 R test.r 脚本(在控制台上):
Rscript test.r
它在调用 PMBuild()
时卡住
执行 test.r 时,进程卡在请求此用户输入的无限循环中。
Pmetrics needs to know which Fortran compiler you are using.
You only have to specify this once.
However, you can reconfigure if your compiler changes
by using the command PMFortranConfig(reconfig=T).
In each of the following <exec> is a place holder for the executable file name
and <files> is a placeholder for the files to be compiled. Both are required.
When applicable serial and parallel compile statements in Pmetrics are listed in that order.
1. gfortran -m64 -w -O3 -o <exec> <files>
gfortran -O3 -w -fopenmp -fmax-stack-var-size=32768 -o <exec> <files>
2. g95: g95 -o -fstatic <exec> <files>
3. Intel Visual: ifort -o <exec> <files>
4. Lahey: lf90 <files> -fix -out <exec>
5. Other (define custom command)
6. Help, I don't have a Fortran compiler!
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
有没有办法通过在 运行ning PMBuild() 之前的某处设置一些选项来配置默认编译器?
我们创建了一个 GitHub 存储库,其中包含此问题的来源。
谁能想出解决办法?
可以创建文件 ~/.config/Pmetrics/FortConfig.txt
,内容如下:
gfortran -m64 -w -O3 -o <exec> <files>
gfortran -O3 -w -fopenmp -fmax-stack-var-size=32768 -o <exec> <files>
如果您想使用建议的 1 个编译器。
我们正在尝试使用名为 Pmetrics
的 R 包这通常不支持 Linux 环境,但我们想在并行设置中执行一些测试。例如。 1000 运行s 分布在 20 个容器上的分布式测试。
使用此 Dockerfile 可以重现错误。
FROM centos:centos7.5.1804
RUN yum -y install gcc-gfortran epel-release
RUN mkdir /root/pksim
RUN mkdir /root/pksim/Rlibraries
WORKDIR /root/pksim
RUN yum -y install R
COPY test.r test.r
COPY install.r install.r
install.r 脚本包含这些行
.libPaths("/root/pksim/Rlibraries")
install.packages("http://www.lapk.org/software/Pmetrics/Repos/src/contrib/Pmetrics_1.5.2.tar.gz", repos=NULL)
test.r 脚本包含这些行
r = getOption("repos")
r["CRAN"] = "http://lib.ugent.be/CRAN/"
options(repos = r)
rm(r)
.libPaths("/root/pksim/Rlibraries")
library(Pmetrics)
PMbuild()
您可以使用这些命令完成这项工作:
- 构建图像:
docker build -t pksim .
- 运行 图片:
docker run -ti pksim /bin//bash
。应该会出现一个控制台。 - 运行 R install.r 脚本(在控制台上):
Rscript install.r
- 运行 R test.r 脚本(在控制台上):
Rscript test.r
它在调用PMBuild()
时卡住
执行 test.r 时,进程卡在请求此用户输入的无限循环中。
Pmetrics needs to know which Fortran compiler you are using.
You only have to specify this once.
However, you can reconfigure if your compiler changes
by using the command PMFortranConfig(reconfig=T).
In each of the following <exec> is a place holder for the executable file name
and <files> is a placeholder for the files to be compiled. Both are required.
When applicable serial and parallel compile statements in Pmetrics are listed in that order.
1. gfortran -m64 -w -O3 -o <exec> <files>
gfortran -O3 -w -fopenmp -fmax-stack-var-size=32768 -o <exec> <files>
2. g95: g95 -o -fstatic <exec> <files>
3. Intel Visual: ifort -o <exec> <files>
4. Lahey: lf90 <files> -fix -out <exec>
5. Other (define custom command)
6. Help, I don't have a Fortran compiler!
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
Enter the number of your compiler:
有没有办法通过在 运行ning PMBuild() 之前的某处设置一些选项来配置默认编译器?
我们创建了一个 GitHub 存储库,其中包含此问题的来源。
谁能想出解决办法?
可以创建文件 ~/.config/Pmetrics/FortConfig.txt
,内容如下:
gfortran -m64 -w -O3 -o <exec> <files>
gfortran -O3 -w -fopenmp -fmax-stack-var-size=32768 -o <exec> <files>
如果您想使用建议的 1 个编译器。