无法找到gfortran 4.8来构建包 [英] Can't find gfortran 4.8 to build package

查看:166
本文介绍了无法找到gfortran 4.8来构建包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过 install.packages(deldir,type ='source')在R中安装 deldir code>但是得到以下错误信息(这是OSX Mavericks):

  *安装* source * deldir'... 
** package'deldir'已成功解压并检查MD5总和
** libs
gfortran-4.8 -fPIC -g -O2 -c acchk.f -o acchk。 o
make:gfortran-4.8:没有这样的文件或目录
make:*** [acchk.o]错误1
错误:编译包'deldir'失败

gfortran 4.8似乎在我的系统上可用,但是:

 > gfortran -v 
使用内置规格。
COLLECT_GCC = gfortran
COLLECT_LTO_WRAPPER = / usr / local / gfortran / libexec / gcc / x86_64-apple-darwin13 / 4.8.2 / lto-wrapper
目标:x86_64-apple-darwin13
配置为:../gcc-4.8.2/configure --prefix = / usr / local / gfortran --with-gmp = / Users / fx / devel / gcc / deps-static / x86_64 --enable-languages = c,c ++,fortran,objc,obj-c ++ --build = x86_64-apple-darwin13
线程模型:posix
gcc版本4.8.2(GCC)



<$>将gfortran-4.8链接到gfortran后,我得到了更多的进步,但仍然失败:

  *安装* source *包'deldir'... 
** package'deldir'成功解压并检查MD5总和
** libs
gfortran -4.8 -fPIC -g -O2 -c acchk.f -o acchk.o
gfortran-4.8 -fPIC -g -O2 -c addpt.f -o addpt.o
gfortran-4.8 -fPIC -g -O2 -c adjchk.f -o adjchk.o
gfortran-4.8 -fPIC -g -O2 -c binsrt.f -o binsrt.o
gfortran-4.8 -fPIC -g -O2 -c circen.f -o circen.o
gfortran-4.8 -fPIC -g -O2 -c cross.f -o cross.o
gfortran-4.8 -fPIC -g -O2 -c delet.f -o delet.o
gfortran-4.8 -fPIC -g -O2 -c delet1.f -o delet1.o
gfortran-4.8 -fPIC -g -O2 -c delout.f -o delout.o
gfortran-4.8 -fPIC -g -O2 -c delseg.f -o delseg.o
gfortran-4.8 -fPIC -g -O2 -c dirout.f -o dirout.o
gfortran-4.8 -fPIC -g -O2 -c dirseg.f - o dirseg.o
gfortran-4.8 -fPIC -g -O2 -c dldins.f -o dldins.o
gfortran-4.8 -fPIC -g -O2 -c initad.f -o initad.o
gfortran-4.8 -fPIC -g -O2 -c insrt.f -o insrt.o
gfortran-4.8 -fPIC -g -O2 -c insrt1.f -o insrt1.o
gfortran-4.8 -fPIC -g -O2 -c intro.f -o intri.o
gfortran-4.8 -fPIC -g -O2 -c locn.f -o locn.o
gfortran-4.8 - fPIC -g -O2 -c master.f -o master.o
gfortran-4.8 -fPIC -g -O2 -c mnnd.f -o mnnd.o
gfortran-4.8 -fPIC -g - O2 -c pred.f -o pred.o
gfortran-4.8 -fPIC -g -O2 -c qtest.f -o qtest.o
gfortran-4.8 -fPIC -g -O2 -c qtest1.f -o qtest1.o
gfortran-4.8 -fPIC -g -O2 -c stoke.f -o stoke.o
gfortran-4.8 -fPIC -g -O2 -c succ.f - o succ.o
gfortran-4.8 -fPIC -g -O2 -c swap.f -o swap.o
gfortran-4.8 -fPIC -g -O2 -c testeq.f -o testeq.o
gfortran-4.8 -fPIC -g -O2 -c triar.f -o triar.o
gfortran-4.8 -fPIC -g -O2 -c trifnd.f -o trifnd.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L / usr / local / lib -o deldir.so acchk.o addpt.o adjchk.o binsrt.o circen.o cross.o delet.o delet1.o delout .o delseg.o dirout.o dirseg.o dldins.o initad.o insrt.o insrt1.o intri.o locn.o master.o mnnd.o pred.o qtest.o qtest1.o stoke。 o succ.o swap.o testeq.o triar.o trifnd.o -L / usr / local / lib / gcc / x86_64-apple-darwin13.0.0 / 4.8.2 - lgfortran -lquadmath -lm -F / Library / Frameworks /R.framework/ .. -framework R -Wl,-framework -Wl,CoreFoundation
ld:warning:找不到选项'-L / usr / loc al / lib / gcc / x86_64-apple-darwin13.0.0 / 4.8.2'
ld:library找不到-lgfortran
clang:错误:linker命令失败,退出代码1(使用-v to请参阅调用)
make:*** [deldir.so]错误1
错误:编译包'deldir'失败

请注意, /usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.3 存在, /usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 不会



sessionInfo( ):

 > sessionInfo()
R版本3.1.1(2014-07-10)
平台:x86_64-apple-darwin13.1.0(64位)

语言环境:
[1] en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8附加基本软件包


[1] stats graphics grDevices utils datasets methods base

Sys.getenv():

 > sys.getenv()
__CF_USER_TEXT_ENCODING
0x1F5:0:0
__CHECKFIX1436934
1
Apple_PubSub_Socket_Render
/ tmp / launch -jCxLku /渲染
DISPLAY
:0
DYLD_FALLBACK_LIBRARY_PATH
/ Users /< myusername> / lib:/ usr / local / lib: /usr/lib::/Library/Frameworks/R.framework/Resources/lib
编辑
vi
GIT_ASKPASS
rpostback-askpass
HOME
/ Users /< myusername>
LANG
en_US.UTF-8
LC_CTYPE
en_US.UTF-8
LN_S
ln -s
LOGNAME
< myusername>
make
make
PAGER
/ usr / bin / less
PATH
/ usr / bin:/ bin:/ usr / sbin:/ usr / local / bin:/ usr / texbin
R_BROWSER
/ usr / bin / open
R_BZIPCMD
/ usr / bin / bzip2
R_DOC_DIR
/Library/Frameworks/R.framework/Resources/doc
R_GZIPCMD
/ usr / bin / gzip
R_HOME
/Library/Frameworks/R.framework/Resources
R_INCLUDE_DIR
/Library/Frameworks/R.framework/Resources/include
R_LIBS_SITE

R_LIBS_USER
〜/ Library / R / 3.1 / library
R_PAPERSIZE
a4
R_PDFVIEWER
/ usr / bin / open
R_PLATFORM
x86_64-apple-darwin13.1.0
R_PRINTCMD
lpr
R_QPDF
/Library/Frameworks/R.framework/Resources/bin/qpdf
R_RD4PDF
times,inconsolata,hyper
R_SESSION_TMPDIR
/ var / folders / jf / ds4sdyys44xckz_7f9zhrvsh0000gn / T // RtmpXaPpYF
R_SHARE_DIR
/Library/Frameworks/R.framework/Resources/share
R_SYSTEM_ABI
osx,gcc,gxx,gfortran,?
R_TEXI2DVICMD
/ usr / bin / texi2dvi
R_UNZIPCMD
/ usr / bin / unzip
R_ZIPCMD
/ usr / bin / zip
RS_RPOSTBACK_PATH
/Applications/RStudio.app/Contents/MacOS/rpostback
RS_SHARED_SECRET
<去除>
RSTUDIO
1
RSTUDIO_PANDOC
/Applications/RStudio.app/Contents/MacOS/pandoc
RSTUDIO_SESSION_PORT
10153
RSTUDIO_USER_IDENTITY
< myusername>
SED
/ usr / bin / sed
SHELL
/ bin / bash
SSH_AUTH_SOCK
/ tmp / launch-Shnu2H / Listeners
TAR
/ usr / bin / tar
TMPDIR
/ var / folders / jf / ds4sdyys44xckz_7f9zhrvsh0000gn / T /
USER
< myusername>


解决方案

我在这里找到了一个解决方案: https ://support.rstudio.com/hc/communities/public/questions/201688563-Problem-with-Mac-Yosemite-Beta-and-RStudio-not-finding-TeX-distribution


事实证明,Adam Maxwell指出,优胜美地测试版在将环境变量传递给子进程方面存在重大错误。


安装gfortran后,如 OS X软件包的安装取决于gfortran-4.8



这样做的效果:在 .bash_profile

中创建一个别名

然后关闭并打开终端。



在启动RStudio之前,在终端执行修复程序命令。

然后,我可以成功建立igraph。


I'm trying to install the deldir package in R via install.packages("deldir",type = 'source') but am getting the following error message (this is OSX Mavericks):

* installing *source* package ‘deldir’ ...
** package ‘deldir’ successfully unpacked and MD5 sums checked
** libs
gfortran-4.8   -fPIC  -g -O2  -c acchk.f -o acchk.o
make: gfortran-4.8: No such file or directory
make: *** [acchk.o] Error 1
ERROR: compilation failed for package ‘deldir’

gfortran 4.8 does seem to be available on my system, however:

> gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin13/4.8.2/lto-wrapper
Target: x86_64-apple-darwin13
Configured with: ../gcc-4.8.2/configure --prefix=/usr/local/gfortran --with-gmp=/Users/fx/devel/gcc/deps-static/x86_64 --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin13
Thread model: posix
gcc version 4.8.2 (GCC) 

After symlinking gfortran-4.8 to gfortran I get a bit further but fail nonetheless:

* installing *source* package ‘deldir’ ...
** package ‘deldir’ successfully unpacked and MD5 sums checked
** libs
gfortran-4.8   -fPIC  -g -O2  -c acchk.f -o acchk.o
gfortran-4.8   -fPIC  -g -O2  -c addpt.f -o addpt.o
gfortran-4.8   -fPIC  -g -O2  -c adjchk.f -o adjchk.o
gfortran-4.8   -fPIC  -g -O2  -c binsrt.f -o binsrt.o
gfortran-4.8   -fPIC  -g -O2  -c circen.f -o circen.o
gfortran-4.8   -fPIC  -g -O2  -c cross.f -o cross.o
gfortran-4.8   -fPIC  -g -O2  -c delet.f -o delet.o
gfortran-4.8   -fPIC  -g -O2  -c delet1.f -o delet1.o
gfortran-4.8   -fPIC  -g -O2  -c delout.f -o delout.o
gfortran-4.8   -fPIC  -g -O2  -c delseg.f -o delseg.o
gfortran-4.8   -fPIC  -g -O2  -c dirout.f -o dirout.o
gfortran-4.8   -fPIC  -g -O2  -c dirseg.f -o dirseg.o
gfortran-4.8   -fPIC  -g -O2  -c dldins.f -o dldins.o
gfortran-4.8   -fPIC  -g -O2  -c initad.f -o initad.o
gfortran-4.8   -fPIC  -g -O2  -c insrt.f -o insrt.o
gfortran-4.8   -fPIC  -g -O2  -c insrt1.f -o insrt1.o
gfortran-4.8   -fPIC  -g -O2  -c intri.f -o intri.o
gfortran-4.8   -fPIC  -g -O2  -c locn.f -o locn.o
gfortran-4.8   -fPIC  -g -O2  -c master.f -o master.o
gfortran-4.8   -fPIC  -g -O2  -c mnnd.f -o mnnd.o
gfortran-4.8   -fPIC  -g -O2  -c pred.f -o pred.o
gfortran-4.8   -fPIC  -g -O2  -c qtest.f -o qtest.o
gfortran-4.8   -fPIC  -g -O2  -c qtest1.f -o qtest1.o
gfortran-4.8   -fPIC  -g -O2  -c stoke.f -o stoke.o
gfortran-4.8   -fPIC  -g -O2  -c succ.f -o succ.o
gfortran-4.8   -fPIC  -g -O2  -c swap.f -o swap.o
gfortran-4.8   -fPIC  -g -O2  -c testeq.f -o testeq.o
gfortran-4.8   -fPIC  -g -O2  -c triar.f -o triar.o
gfortran-4.8   -fPIC  -g -O2  -c trifnd.f -o trifnd.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined     suppress -L/usr/local/lib -o deldir.so acchk.o addpt.o adjchk.o binsrt.o circen.o cross.o delet.o delet1.o delout    .o delseg.o dirout.o dirseg.o dldins.o initad.o insrt.o insrt1.o intri.o locn.o master.o mnnd.o pred.o qtest.o     qtest1.o stoke.o succ.o swap.o testeq.o triar.o trifnd.o -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -    lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [deldir.so] Error 1
ERROR: compilation failed for package ‘deldir’

Note that /usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.3 exists, /usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 does not

sessionInfo():

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

Sys.getenv():

> Sys.getenv()
                                                                          __CF_USER_TEXT_ENCODING 
                                                                                      "0x1F5:0:0" 
                                                                                __CHECKFIX1436934 
                                                                                              "1" 
                                                                       Apple_PubSub_Socket_Render 
                                                                      "/tmp/launch-jCxLku/Render" 
                                                                                          DISPLAY 
                                                                                             ":0" 
                                                                       DYLD_FALLBACK_LIBRARY_PATH 
"/Users/<myusername>/lib:/usr/local/lib:/usr/lib::/Library/Frameworks/R.framework/Resources/lib" 
                                                                                           EDITOR 
                                                                                             "vi" 
                                                                                      GIT_ASKPASS 
                                                                              "rpostback-askpass" 
                                                                                             HOME 
                                                                            "/Users/<myusername>" 
                                                                                             LANG 
                                                                                    "en_US.UTF-8" 
                                                                                         LC_CTYPE 
                                                                                    "en_US.UTF-8" 
                                                                                             LN_S 
                                                                                          "ln -s" 
                                                                                          LOGNAME 
                                                                                   "<myusername>" 
                                                                                             MAKE 
                                                                                           "make" 
                                                                                            PAGER 
                                                                                  "/usr/bin/less" 
                                                                                             PATH 
                                       "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin" 
                                                                                        R_BROWSER 
                                                                                  "/usr/bin/open" 
                                                                                        R_BZIPCMD 
                                                                                 "/usr/bin/bzip2" 
                                                                                        R_DOC_DIR 
                                                  "/Library/Frameworks/R.framework/Resources/doc" 
                                                                                        R_GZIPCMD 
                                                                                  "/usr/bin/gzip" 
                                                                                           R_HOME 
                                                      "/Library/Frameworks/R.framework/Resources" 
                                                                                    R_INCLUDE_DIR 
                                              "/Library/Frameworks/R.framework/Resources/include" 
                                                                                      R_LIBS_SITE 
                                                                                               "" 
                                                                                      R_LIBS_USER 
                                                                        "~/Library/R/3.1/library" 
                                                                                      R_PAPERSIZE 
                                                                                             "a4" 
                                                                                      R_PDFVIEWER 
                                                                                  "/usr/bin/open" 
                                                                                       R_PLATFORM 
                                                                      "x86_64-apple-darwin13.1.0" 
                                                                                       R_PRINTCMD 
                                                                                            "lpr" 
                                                                                           R_QPDF 
                                             "/Library/Frameworks/R.framework/Resources/bin/qpdf" 
                                                                                         R_RD4PDF 
                                                                        "times,inconsolata,hyper" 
                                                                                 R_SESSION_TMPDIR 
                                   "/var/folders/jf/ds4sdyys44xckz_7f9zhrvsh0000gn/T//RtmpXaPpYF" 
                                                                                      R_SHARE_DIR 
                                                "/Library/Frameworks/R.framework/Resources/share" 
                                                                                     R_SYSTEM_ABI 
                                                                         "osx,gcc,gxx,gfortran,?" 
                                                                                    R_TEXI2DVICMD 
                                                                              "/usr/bin/texi2dvi" 
                                                                                       R_UNZIPCMD 
                                                                                 "/usr/bin/unzip" 
                                                                                         R_ZIPCMD 
                                                                                   "/usr/bin/zip" 
                                                                                RS_RPOSTBACK_PATH 
                                             "/Applications/RStudio.app/Contents/MacOS/rpostback" 
                                                                                 RS_SHARED_SECRET 
                                                                                        <removed> 
                                                                                          RSTUDIO 
                                                                                              "1" 
                                                                                   RSTUDIO_PANDOC 
                                                "/Applications/RStudio.app/Contents/MacOS/pandoc" 
                                                                             RSTUDIO_SESSION_PORT 
                                                                                          "10153" 
                                                                            RSTUDIO_USER_IDENTITY 
                                                                                  "<myusername>" 
                                                                                              SED 
                                                                                   "/usr/bin/sed" 
                                                                                            SHELL 
                                                                                      "/bin/bash" 
                                                                                    SSH_AUTH_SOCK 
                                                                   "/tmp/launch-Shnu2H/Listeners" 
                                                                                              TAR 
                                                                                   "/usr/bin/tar" 
                                                                                           TMPDIR 
                                              "/var/folders/jf/ds4sdyys44xckz_7f9zhrvsh0000gn/T/" 
                                                                                             USER 
                                                                                  "<myusername>"     

解决方案

I found a solution here: https://support.rstudio.com/hc/communities/public/questions/201688563-Problem-with-Mac-Yosemite-Beta-and-RStudio-not-finding-TeX-distribution

It turns out that Adam Maxwell noted that Yosemite beta has a significant bug in passing environment variables to subprocesses.

After installing gfortran as in OS X package installation depends on gfortran-4.8 .

This works: create an alias in your .bash_profile

alias fixrs="launchctl setenv PATH /usr/texbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin"

Then close and open the terminal.

And execute the fixrs command in the terminal before launching RStudio.

Then I could build igraph successfully.

这篇关于无法找到gfortran 4.8来构建包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆