[R] Fwd: Re: Calling C code from R
Duncan Murdoch
murdoch at stats.uwo.ca
Sun Feb 4 12:23:59 CET 2007
On 2/4/2007 1:23 AM, Deb Midya wrote:
> Hi!
>
> Thanks in advance.
>
> Thanks to all of you who have responded to me on above. This is one of the responses I received on above.
>
> I have installed perl (with path C:\Perl\bin\;) an MinGW (with path C:\MinGW\bin; C:\MinGW;).
>
> At the Command Prompt (C:\R-2.4.0\bin) I have typed:
>
> C:\R-2.4.0\bin>Rcmd SHLIB useC1.c
> (No error and useC1.dll file has not been created)
>
> C:\R-2.4.0\bin>R CMD SHLIB useC1.c
> (No error and useC1.dll file has not been created)
>
> May I request you where I am going wrong.
It looks as though you didn't install the Rtools collection. Take a
look in the Installation and Administration manual, Appendix E: the
Windows toolset. For compiling code you need the first 3 items: "the
command line tools" (which you seem to be missing), Perl, and the MinGW
compilers. Be careful to get your path in the right order, as described
there.
Duncan Murdoch
>
> Regards,
>
> Deb
>
> Statistician
> NSW Department of Commerce
> Sydney Australia.
>
>
> Note: forwarded message attached.
>
>
> ---------------------------------
> Need Mail bonding?
>
>
> ------------------------------------------------------------------------
>
>
> X-Originating-IP: [129.132.145.15]
> Authentication-Results: mta305.mail.mud.yahoo.com from=stat.math.ethz.ch; domainkeys=neutral (no sig)
> Received: from 129.132.145.15 (EHLO hypatia.math.ethz.ch) (129.132.145.15)
> by mta305.mail.mud.yahoo.com with SMTP; Thu, 01 Feb 2007 09:06:15 -0800
> Received: from hypatia.math.ethz.ch (hypatia [129.132.145.15])
> by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id l11Bhc1w009865;
> Thu, 1 Feb 2007 12:44:51 +0100
> X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on hypatia.math.ethz.ch
> X-Spam-Level:
> X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,
> SPF_HELO_PASS autolearn=no version=3.1.7
> Received: from talk.nabble.com (www.nabble.com [72.21.53.35])
> by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id l11BLmS8001133
> (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO)
> for <r-help at stat.math.ethz.ch>; Thu, 1 Feb 2007 12:21:49 +0100
> Received: from [72.21.53.38] (helo=jubjub.nabble.com)
> by talk.nabble.com with esmtp (Exim 4.50) id 1HCa0h-0007kZ-Th
> for r-help at stat.math.ethz.ch; Thu, 01 Feb 2007 03:21:47 -0800
> Date: Thu, 1 Feb 2007 03:21:47 -0800 (PST)
> From: Vladimir Eremeev <wl2776 at gmail.com>
> To: r-help at stat.math.ethz.ch
> In-Reply-To: <835531.21036.qm at web50407.mail.yahoo.com>
> MIME-Version: 1.0
> X-Nabble-From: wl2776 at gmail.com
> References: <835531.21036.qm at web50407.mail.yahoo.com>
> X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch
> Subject: Re: [R] Calling C code from R
> X-BeenThere: r-help at stat.math.ethz.ch
> X-Mailman-Version: 2.1.9
> Precedence: list
> List-Id: "Main R Mailing List: Primary help" <r-help.stat.math.ethz.ch>
> List-Unsubscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,
> <mailto:r-help-request at stat.math.ethz.ch?subject=unsubscribe>
> List-Archive: <https://stat.ethz.ch/pipermail/r-help>
> List-Post: <mailto:r-help at stat.math.ethz.ch>
> List-Help: <mailto:r-help-request at stat.math.ethz.ch?subject=help>
> List-Subscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,
> <mailto:r-help-request at stat.math.ethz.ch?subject=subscribe>
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> Sender: r-help-bounces at stat.math.ethz.ch
> Errors-To: r-help-bounces at stat.math.ethz.ch
> Content-Length: 762
>
>
> You need to install perl and MinGW, at least.
> If you have them installed, then you need to properly set PATH environment
> variable and, probably, restart your command line session.
>
> See chapter 5 of the manual "Writing R extensions" (installed in
> R_HOME/doc/manual)
> and these two links
>
> http://www.murdoch-sutherland.com/Rtools/
> http://www.stats.uwo.ca/faculty/murdoch/software/debuggingR/
>
> Also, it would be great to upgrade R to 2.4.1
>
>
> Deb Midya wrote:
>> I am using R-2.4.0 on Windows XP. I am trying to create dll file.
>> My C code:
>> /* useC1.c */
>> void useC(int *i) {
>> i[6] = 100;
>> }
>>
>> I have tried to create useC1.dll.
>> C:\R-2.4.0\bin>R CMD SHLIB useC1.c
>> 'perl' is not recognized as an internal or external command, operable
>> program or batch file.
>>
>> Then I have tried:
>> C:\R-2.4.0\bin>Rcmd SHLIB useC1.c
>> 'perl' is not recognized as an internal or external command, operable
>> program or batch file.
>>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list