8

Windows環境を使用せざるを得ない職場でRInsideをセットアップしようとしています。

RToolsをインストールし、CRANからRInsideバイナリをダウンロードしました。

私のRインストールはc:\ R \ R-2.12.2にあるので、スペースのあるフォルダーに問題はありません。

RにRcppパッケージとRInsideパッケージをインストールしました。

ダウンロードしたRInsideバイナリに含まれている次のmakefileMakefile.winを実行します

## -*- mode: makefile; tab-width: 8; -*-
##
## Simple Makefile
##
## TODO:
##  proper configure for non-Debian file locations,   [ Done ]
##  allow RHOME to be set for non-default R etc

## comment this out if you need a different version of R,
## and set set R_HOME accordingly as an environment variable
R_HOME :=       'cygdrive/c/R/R-2.12.2'

sources :=      $(wildcard *.cpp)
programs :=         $(sources:.cpp=)

## include headers and libraries for R
RCPPFLAGS :=        $(shell $(R_HOME)/bin/R CMD config --cppflags)
RLDFLAGS :=         $(shell $(R_HOME)/bin/R CMD config --ldflags)
RBLAS :=        $(shell $(R_HOME)/bin/R CMD config BLAS_LIBS)
RLAPACK :=      $(shell $(R_HOME)/bin/R CMD config LAPACK_LIBS)

## include headers and libraries for Rcpp interface classes
RCPPINCL :=         $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --    slave)
RCPPLIBS :=         $(shell echo 'Rcpp:::LdFlags()'  | $(R_HOME)/bin/R --vanilla --slave)

## include headers and libraries for RInside embedding classes
RINSIDEINCL :=      $(shell echo 'RInside:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
RINSIDELIBS :=      $(shell echo 'RInside:::LdFlags()'  | $(R_HOME)/bin/R --vanilla --slave)

## compiler etc settings used in default make rules
CXX :=          $(shell $(R_HOME)/bin/R CMD config CXX)
CPPFLAGS :=         -Wall $(shell $(R_HOME)/bin/R CMD config CPPFLAGS)
CXXFLAGS :=         $(RCPPFLAGS) $(RCPPINCL) $(RINSIDEINCL) $(shell     $(R_HOME)/bin/R     CMD config CXXFLAGS)
LDFLAGS =       -s
LDLIBS :=       $(RLDFLAGS) $(RBLAS) $(RLAPACK) $(RINSIDELIBS) $(RCPPLIBS) 
CC :=           $(shell $(R_HOME)/bin/R CMD config CXX)

all :           $(programs)

clean:
        rm -vf $(programs)

コマンドで

make -f Makefile.win

含まれている標準的な例をビルドしてみてください

ただし、次のエラーが発生します。

C:\RInside_0.2.3\RInside\examples\standard>make -f Makefile.win
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
cygdrive/c/R/R-2.12.2/bin/R: not found
cygdrive/c/R/R-2.12.2/bin/R: not found
cygdrive/c/R/R-2.12.2/bin/R: not found
cygdrive/c/R/R-2.12.2/bin/R: not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
make: cygdrive/c/R/R-2.12.2/bin/R: Command not found
Wall  -s  rinside_callbacks0.cpp        -o rinside_callbacks0
make: Wall: Command not found
make: [rinside_callbacks0] Error 127 (ignored)
Wall  -s  rinside_module_sample0.cpp        -o rinside_module_sample0
make: Wall: Command not found
make: [rinside_module_sample0] Error 127 (ignored)
Wall  -s  rinside_sample0.cpp        -o rinside_sample0
make: Wall: Command not found
make: [rinside_sample0] Error 127 (ignored)
Wall  -s  rinside_sample1.cpp        -o rinside_sample1
make: Wall: Command not found
make: [rinside_sample1] Error 127 (ignored)
Wall  -s  rinside_sample2.cpp        -o rinside_sample2
make: Wall: Command not found
make: [rinside_sample2] Error 127 (ignored)
Wall  -s  rinside_sample3.cpp        -o rinside_sample3
make: Wall: Command not found
make: [rinside_sample3] Error 127 (ignored)
Wall  -s  rinside_sample4.cpp        -o rinside_sample4
make: Wall: Command not found
make: [rinside_sample4] Error 127 (ignored)
Wall  -s  rinside_sample5.cpp        -o rinside_sample5
make: Wall: Command not found
make: [rinside_sample5] Error 127 (ignored)
Wall  -s  rinside_sample6.cpp        -o rinside_sample6
make: Wall: Command not found
make: [rinside_sample6] Error 127 (ignored)
Wall  -s  rinside_sample7.cpp        -o rinside_sample7
make: Wall: Command not found
make: [rinside_sample7] Error 127 (ignored)
Wall  -s  rinside_sample8.cpp        -o rinside_sample8
make: Wall: Command not found
make: [rinside_sample8] Error 127 (ignored)
Wall  -s  rinside_sample9.cpp        -o rinside_sample9
make: Wall: Command not found
make: [rinside_sample9] Error 127 (ignored)
Wall  -s  rinside_test0.cpp        -o rinside_test0
make: Wall: Command not found
make: [rinside_test0] Error 127 (ignored)
Wall  -s  rinside_test1.cpp        -o rinside_test1
make: Wall: Command not found
make: [rinside_test1] Error 127 (ignored)

R_HOMEのさまざまなパスを試しましたが、正しいパスを見つけることができるかどうか疑問に思っています。私はmakefileを初めて使用するので、エラー出力はあまり役に立ちません。

誰かが共有するための貴重な洞察を持っていることを願っています!

前もって感謝します、

キリスト教徒

4

3 に答える 3

6

私も同じような設定をしているので、これを試してみました。を指定すると、例を作成できますR_LIBS_SITE。Cygwinパスではなく、Windowsパスである必要があることに注意してください。

export R_LIBS_SITE=c:/R/site-library
于 2011-04-13T14:14:04.490 に答える
6

ここでは、2つの明確な問題があるようです。

  1. あなた$PATHはおそらくオフであるか、ジョシュが示唆したように、あなたの$R_HOME割り当ては間違っています。がmake実際にRtoolsからのバイナリであり、割り当てたパスが正しい場合、ビルドは成功します。これが、WindowsでRパッケージを構築するための一般的なルールです。マニュアルに非常に注意深く従えば、機能します。

  2. RInsideはWindowsで壊れています。ごめんなさい。それが構築され、segfaultsが発生します。Romainと私は、ドキュメントでそのように明確に述べています。

Romainと私はそれぞれOSXとLinuxでほぼ独占的に作業しているので、デバッグの助けをいただければ幸いです。それは実行可能であるはずですが、メモリサブシステム内の何かが腹を立てるにつれて、Rの内部について学ぶための真剣な意欲がおそらく必要です。名前にXが含まれているOSでは明らかにそうではありません。

2011年12月8日に更新:RInside 0.2.5、本日現在のCRANで、他のコメントの修正Jamesノートを使用してWindows機能を復元します。

于 2011-04-13T13:45:16.767 に答える
4

私は今日、Windows版のRInsideのバグを調べるのに少し時間を費やしました。私は次のようなバグを発見したと思います。

RInside :: initialize(……)では、structRStart構造が入力されますが、R \ src \ gnuwin32 \ embedded.cのRf_initEmbeddedR()に示すように、ウィンドウの場合は追加のフィールドを入力する必要があります。

Rp->rhome = RHome;
Rp->home = getRUser();
Rp->CharacterMode = LinkDLL;
Rp->ReadConsole = myReadConsole;
Rp->WriteConsole = myWriteConsole;
Rp->CallBack = myCallBack;
Rp->ShowMessage = askok;
Rp->YesNoCancel = askyesnocancel;
Rp->Busy = myBusy;

有効なコールバックを提供するには、RInside.cppで同等の割り当てが必要になります。

于 2011-11-28T00:57:00.623 に答える