linux - 在 Linux CentOS 6.5 版上安装 R3.1.1 时出现问题(检查 LDFLAGS 以获取 Fortran 库的路径)

标签 linux r centos installation fortran

我正在尝试从 CentOS 6.5 上的源代码安装 R3.1.1

.configure 引发了以下错误

(...)
checking whether we can compute C Make dependencies... yes, using $(CC) -MM
checking whether gcc -std=gnu99 supports -c -o FILE.lo... yes
checking for gcc -std=gnu99 option to support OpenMP... -fopenmp
checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran...  -L/usr/local/lib64 -L/cm/shared/apps/slurm/14.03.0/lib64/../lib64 -L/cm/shared/apps/gcc/4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2 -L/cm/shared/apps/gcc/4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/cm/shared/apps/slurm/14.03.0/lib64/slurm -L/cm/shared/apps/slurm/14.03.0/lib64 -L/cm/shared/apps/gcc/4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../.. -lgfortran -lm -lquadmath
checking how to get verbose linking output from gcc -std=gnu99... -v
checking for C libraries of gcc -std=gnu99...  -L/usr/local/lib64 -L/cm/shared/apps/slurm/14.03.0/lib64/../lib64 -L/cm/shared/apps/gcc/4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2 -L/cm/shared/apps/gcc/4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/cm/shared/apps/slurm/14.03.0/lib64/slurm -L/cm/shared/apps/slurm/14.03.0/lib64 -L/cm/shared/apps/gcc/4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../.. -lgcc_s
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking whether gfortran appends underscores to external names... yes
checking whether gfortran appends extra underscores to external names... no
checking whether mixed C/Fortran code can be run... configure: WARNING: cannot run mixed C/Fortran code
configure: error: Maybe check LDFLAGS for paths to Fortran libraries?

gfortran 是使用 yum 安装的

 gfortran --version
GNU Fortran (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.

我不知道应该在 LDFLAGS 中放入什么来修复该错误。

更新:

# find / -name "libgfor*.so"
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgfortran.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libgfortran.so
/cm/shared/apps/gcc/4.8.2/lib64/libgfortran.so
/cm/shared/apps/gcc/4.8.2/lib/libgfortran.so
/cm/images/default-image/usr/lib/gcc/x86_64-redhat-linux/4.4.4/libgfortran.so
/cm/images/default-image/usr/lib/gcc/x86_64-redhat-linux/4.4.4/32/libgfortran.so

.

# tail config.log 
#define SIZEOF_LONG_LONG 8
#define SIZEOF_DOUBLE 8
#define SIZEOF_SIZE_T 8
#define HAVE_LONG_DOUBLE 1
#define SIZEOF_LONG_DOUBLE 16
#define F77_FUNC(name,NAME) name ## _
#define F77_FUNC_(name,NAME) name ## _
#define HAVE_F77_UNDERSCORE 1

configure: exit 1

最佳答案

尝试在您的系统中找到 libgfortran.so 并提供路径 -Lthe_path -lgfortran 或设置相应的环境变量。如果这没有帮助,请尝试在 config.log(或类似的)文件中查找更多详细信息,以找出配置在该检查中实际尝试执行的操作。

您的 gfortran 报告它是 4.8.2 版本,但库来自 4.4.4 版本。尝试定位(通过 which)您运行的是哪个 gfortran 二进制文件以及它的库在哪里。尝试为 libgfortran 运行 locate 命令。

关于linux - 在 Linux CentOS 6.5 版上安装 R3.1.1 时出现问题(检查 LDFLAGS 以获取 Fortran 库的路径),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25033951/

相关文章:

linux - Linux cpu 使用的 psutil 和 sar 有什么区别?

r - 导出具有负刻度线长度的图时,轴标签会碰到轴 (ggplot2)

r - R 中合并中的循环多列

linux - 从 cron 作业的 shell 脚本启动服务( Upstart )

centos - 如何在 centos 中更改/升级我的 GLIBCXX

r - 将多个大型 csv 文件合并(rbind)为一个具有不同列顺序的文件

java - 如何在 Windows 上反射(reflect)来自 JAR 的类

c - 如何从 char 数组中提取值?

r - 使用 grep 确定字符串的频率

linux - 更新服务器时出现 Subversion 错误