2015-05-21 26 views
6

我最近需要安裝R 3.2獲得來自Bioconductor的工作包,但我安裝好後,我收到以下錯誤:R 3.2,GCC,以及自制

[16:16:11 20] $ r 
dyld: Library not loaded: /usr/local/lib/gcc/4.9/libgfortran.3.dylib 
    Referenced from: /usr/local/Cellar/r/3.2.0/R.framework/Versions/3.2/Resources/lib/libR.dylib 
    Reason: image not found 
Trace/BPT trap: 5 

果然,釀造設爲使用gcc 5,所以我告訴釀造使用4.9版本

brew switch gcc 4.9 

其中有R運行從,但隨後R.將在包裝的中間安裝失敗(特別是當我跑biocLite('DESeq2')

從那以後,我嘗試了一些東西,包括試圖安裝gcc 4.8(但我似乎無法讓R使用它,即使通過~/.R/Makevars)。即使4.9未安裝,R仍堅持要求上述路徑。

R的Windows版本似乎是說4.9不能與3.2工作:

R-devel temporarily used a new toolchain based on 4.9.2 gcc, put together by Duncan Murdoch using build scripts written by a contractor. However, there were too many incompatibilities with existing code, and this toolchain will not be used for R 3.2.0. See notes for details on building and testing the new toolchain.

任何幫助將不勝感激!

編輯: 我試圖從源代碼安裝,通過@lmw的建議,但它失敗:

[11:27:55 2] $ brew install r --build-from-source 
==> Installing r from homebrew/homebrew-science 
==> Installing r dependency: gcc 
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2 
######################################################################## 100.0% 
curl: (28) Resolving timed out after 5542 milliseconds 
Trying a mirror... 
==> Downloading https://ftp.gnu.org/gnu/gcc/gcc-5.1.0/gcc-5.1.0.tar.bz2 
######################################################################## 100.0% 
==> Patching 
patching file gcc/jit/Make-lang.in 
==> ../configure --build=x86_64-apple-darwin14.3.0 --prefix=/usr/local/Cellar/gcc/5.1.0 --libdir=/usr/local/Cellar/gc 
==> make bootstrap 
==> make install 
==> Caveats 
GCC has been built with multilib support. Notably, OpenMP may not work: 
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670 
If you need OpenMP support you may want to 
    brew reinstall gcc --without-multilib 
==> Summary 
    /usr/local/Cellar/gcc/5.1.0: 1351 files, 248M, built in 32.5 minutes 
==> Installing r 
==> Using Homebrew-provided fortran compiler. 
This may be changed by setting the FC environment variable. 
==> Downloading http://cran.rstudio.com/src/base/R-3/R-3.2.0.tar.gz 
######################################################################## 100.0% 
==> Patching 
patching file src/modules/lapack/vecLibg95c.c 
==> ./configure --prefix=/usr/local/Cellar/r/3.2.0_1 --with-libintl-prefix=/usr/local/opt/gettext --enable-memory-pro 
==> make 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (survival) 
make[1]: *** [recommended-packages] Error 2 
make: *** [stamp-recommended] Error 2 

READ THIS: https://git.io/brew-troubleshooting 
If reporting this issue please do so at (not Homebrew/homebrew): 
    https://github.com/homebrew/homebrew-science/issues 

編輯2: 只是爲了好玩,我嘗試安裝r沒有--build-from-source選項,它工作。請參閱下面的解決方案(我認爲從源代碼構建可能已經解決了升級問題,這可以解決問題,但是我得到的結果是而不是要去嘗試它(事情終於再次起作用了......爲什麼要使用它?),但是我想知道是否我可以刪除我在~/.R/Makevars設置變量(再次,見下面的解決方案)。

+0

我現在也在處理這個相同的問題! – stanekam

+1

相關閱讀:https://github.com/Homebrew/homebrew-science/issues/2286 – stanekam

+0

不知道我是怎麼錯過的!謝謝@iShouldUseAName! – muppetjones

回答

1

這是由this commit解決,與R.新瓶確保您brew updatebrew upgrade r

+0

很高興知道!我想知道爲什麼這不起作用,雖然...我今天早上更新和升級,但它沒有奏效。正如我的工作,我可能不會這樣做,只是在case =)。謝謝!! – muppetjones

+0

另外,有可能提交是事情開始工作的原因......有沒有辦法判斷是因爲我做了什麼而不是提交?一方面,我不想選擇你的答案作爲解決方案,因爲它不是一個解決方案,更多的是「它已經修好了!」,但同時,如果原因我不想選擇另一個答案事情正在工作是因爲承諾。 – muppetjones

+0

如果您重新安裝了R,並且它已從瓶中「倒入」到/ usr/local/Cellar/r/3.2.0_1中,那麼您正在使用最新的公式修訂版。從源代碼重建也應該解決問題,雖然修訂版(增加了_1)仍然會觸發升級(參見'brew outdated')。 –

3

重建從源R解決同樣的問題對我來說。

釀造重裝[R --build-從源

+0

現在嘗試它,但它似乎被卡在下載...也許它正在編譯?希望這有效!謝謝! – muppetjones

+0

重新安裝失敗(我認爲還有其他問題),但我刪除了'r'並試圖用'--build-from-source'選項安裝,失敗了。 (請參閱編輯問題)。然而,我認爲從源代碼構建導致從源代碼構建的依賴關係之一(我沒有命令行輸出......事情崩潰了,我重新啓動了),我認爲這解決了一些與gcc升級。如果你的答案變成固定事物的一步,我會選擇你的答案 - 讓我知道! – muppetjones

0

這不是一個完整的解決方案(它使用一個較舊的gcc版本),但它讓我再次運行:

  1. brew tap homebrew/homebrew-versions
  2. brew install gcc48
  3. brew install r
    • 注:我跑brew install r --build-from-source(重新安裝沒有工作),其重建東西,而不是R(失敗)。這可能是這項工作的部分原因。請讓我知道,如果是這樣!如果他的回答是這個工作的原因,我想給@lmw信用。
  4. 編輯~/.R/Makevars和添加下列行(視需要編輯路徑):

    CC=/usr/local/Cellar/gcc48/4.8.4/bin/gcc-4.8 
    CXX=/usr/local/Cellar/gcc48/4.8.4/bin/g++-4.8 
    CFLAGS=-std=c99 
    
  5. 運行r

  6. (如果你想安裝Bioconductor的)

    source("http://bioconductor.org/biocLite.R") 
    biocLite()