From ripley at stats.ox.ac.uk  Mon Feb 20 19:23:46 2012
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 20 Feb 2012 18:23:46 +0000
Subject: [Rd] executable files R package
In-Reply-To: <CAEV=kBMAjxpA8TmXjU7_kQhs036T7QVQmfwdRAKW5OXo_4-bDQ@mail.gmail.com>
References: <CAEV=kBNoZ5ooTQVpQmsV-P4jbMekg=KSw==O=fwCMPGL71Dx0Q@mail.gmail.com>
	<4F3BCBD1.1050103@gmail.com>
	<CAEV=kBOXFsqJ=opfpPh3FgnVfM8sry0ir691JJOE=nr_AZvMfA@mail.gmail.com>
	<E66794E69CFDE04D9A70842786030B9327C43F@PA-MBX04.na.tibco.com>
	<CAEV=kBP1bRxTy-xt2B5-eL-KsNYT=dVS=n9Y-43A7d0m0QZJ-g@mail.gmail.com>
	<4F428538.4090708@stats.ox.ac.uk>
	<CAEV=kBMAjxpA8TmXjU7_kQhs036T7QVQmfwdRAKW5OXo_4-bDQ@mail.gmail.com>
Message-ID: <4F428FB2.7060500@stats.ox.ac.uk>

On 20/02/2012 18:20, sahir bhatnagar wrote:
> sorry I don't seem to be getting it. I am working on windows XP.
> I have tried several ways of writing the 'BinaryFiles' which include
>
> file("C:/myPkg/inst/executables/win32/foo.exe") '\r\n'
> file("C:/myPkg/inst/executables/win32/foo.exe") CRLF
> "C:/myPkg/inst/executables/win32/foo.exe" CRLF
>
> and variations of the above, but to no avail.

Indeed you are not. It is a file, listing one filepath per line, with 
each line (including the last) terminated by an end of line marker.

Why don't you ask your local IT support for help with creating text 
files?  It is not an R topic.

>
> On Mon, Feb 20, 2012 at 12:39 PM, Prof Brian Ripley
> <ripley at stats.ox.ac.uk <mailto:ripley at stats.ox.ac.uk>> wrote:
>
>     On 20/02/2012 17:17, sahir bhatnagar wrote:
>
>         thanks,
>         I run into the following error message when running R CMD check
>
>         "Source packages should not contain undeclared executable files"
>
>         in reference to the following instruction from the help manual:
>         "R CMD check will warn about them unless they are listed (one
>         filepath per
>         line) in a file BinaryFiles at the top level of the package."
>
>         I created a file called 'BinaryFiles' placed in 'myPkg' directory.
>         'BinaryFiles' lists the path of the executable files that are
>         included
>         in myPkg/executables/win32. however I am still getting an error:
>
>         Warning in readLines("BinaryFiles"): incomplete final line found
>         on 'Binary
>         Files'
>
>
>     That is a warning, not an error.  And it means that you did not
>     create the file correctly: ensure that you have an EOL mark (newline
>     or CRLF depending on your OS) at the end of the last line.
>
>
>         -Sahir
>
>         On Fri, Feb 17, 2012 at 4:17 PM, William
>         Dunlap<wdunlap at tibco.com <mailto:wdunlap at tibco.com>>  wrote:
>
>             If you put your prebuilt.exe into a directory under the
>             'source' package's inst directory, say
>             yourPkg/inst/executables/__win32,
>             then the installed package will have them in in
>             yourPkg/executables/win32 and the user (via code you
>             write, presumably) can get the full path to the executable
>             in the installed package with
>               system.file(package="yourPkg", "executables", "win32",
>             "prebuilt.exe").
>             Paste the output of that into the command given to system().
>
>             Bill Dunlap
>             Spotfire, TIBCO Software
>             wdunlap tibco.com <http://tibco.com>
>
>                 -----Original Message-----
>                 From: r-devel-bounces at r-project.org
>                 <mailto:r-devel-bounces at r-project.org> [mailto:
>
>             r-devel-bounces at r-project.org
>             <mailto:r-devel-bounces at r-project.org>] On Behalf Of sahir
>
>                 bhatnagar
>                 Sent: Friday, February 17, 2012 12:59 PM
>                 To: Duncan Murdoch
>                 Cc: r-devel at r-project.org <mailto:r-devel at r-project.org>
>                 Subject: Re: [Rd] executable files R package
>
>                 thanks,
>                 I will not submit to CRAN.
>
>                 I am having trouble going about including the .exe files
>                 in my package.
>                  > From the readings I see that the .exe files must be
>                 placed in a 'src'
>                 folder. But I don't see how I can access those files in
>                 R, without having
>                 to specify its path in the R command 'system'. I would
>                 like for the user
>
>             to
>
>                 only have to input a data file, which is then used in
>                 the .exe file.
>
>                 My problem is the following:
>                 Create a function which has two user inputs i.e.
>                 datasets: D1.txt and
>
>             D2.txt
>
>                 I have two '.exe' files i.e. E1.exe and E2.exe
>
>                 E1 takes in D1 and then outputs a text file say "text"
>
>                 then E2 takes in D2 and the "text", which outputs the
>                 result.
>
>                 Can this be done (even if it means having two functions)
>                 and then
>
>             assembled
>
>                 in a package, without the user having to specify the
>                 path of the .exe
>                 files, as well as the "text" that is outputted from
>                 running E1?
>
>                 Any direction as to how I can go about creating a
>                 package that would
>                 include these '.exe. files? I have only found
>                 documentation on calling .C
>                 code in R.
>
>                 Any help is much appreciated
>
>                 On Wed, Feb 15, 2012 at 10:14 AM, Duncan Murdoch
>                 <murdoch.duncan at gmail.com
>                 <mailto:murdoch.duncan at gmail.com>>__wrote:
>
>                     On 13/02/2012 2:36 PM, sahir bhatnagar wrote:
>
>                         I am in the process of creating a package in R
>                         which calls
>                         pre-compiled C code i.e. '.exe' files in Windows.
>
>                         Since CRAN will not accept packages with binary
>                         code files, what are
>                         my options to meet the requirements while still
>                         including the
>                         executable file?
>
>
>                     I think you should ask the CRAN administrators that,
>                     but my
>
>             understanding
>
>                     is that they are unlikely to accept your package as
>                     described.  CRAN is
>                     interested in platform-neutral packages, and if you
>                     have an .exe,
>
>             you're
>
>                     going to be Windows-only.
>
>                     If you include the source code for that .exe and put
>                     together the
>
>             Makefile
>
>                     to compile it, then they'd be more receptive, and
>                     someone might offer
>
>             help
>
>                     to get it to run on other platforms if it doesn't on
>                     your first
>
>             attempt.
>
>
>                     If you don't want to include the .exe source (or
>                     can't), I think you
>                     should just publish it on your own web page.
>
>                     Duncan Murdoch
>
>                       I read section 1.5.2 of the manual which mentions
>                     three options two of
>
>                         which involve negotiating with CRAN
>                         administrators. The third
>                         references the package Cairo which arranges to
>                         download additional
>                         software, but I don't see how this will allow my
>                         package to get
>                         accepted.
>
>                         It would seem that I need to ensure that my
>                         package works under both
>                         architectures (32 and 64 bit).
>
>                         1) Would this be sufficient to get it accepted?
>                         2) If so, does anyone have any documentation in
>                         performing this task,
>                         or can someone point me in the right direction?
>
>                         I was told that 'arulesSequences' is an example
>                         of a CRAN package
>                         while compiles executables. Was this package
>                         accepted because it
>                         worked under both architectures? or are there
>                         other reasons.
>
>                         thanks
>
>                         ________________________________**________________
>                         R-devel at r-project.org
>                         <mailto:R-devel at r-project.org> mailing list
>                         https://stat.ethz.ch/mailman/*__*listinfo/r-devel <https://stat.ethz.ch/mailman/**listinfo/r-devel><
>
>             https://stat.ethz.ch/mailman/__listinfo/r-devel
>             <https://stat.ethz.ch/mailman/listinfo/r-devel>>
>
>
>
>
>
>                        [[alternative HTML version deleted]]
>
>                 ________________________________________________
>                 R-devel at r-project.org <mailto:R-devel at r-project.org>
>                 mailing list
>                 https://stat.ethz.ch/mailman/__listinfo/r-devel
>                 <https://stat.ethz.ch/mailman/listinfo/r-devel>
>
>
>
>                 [[alternative HTML version deleted]]
>
>         ________________________________________________
>         R-devel at r-project.org <mailto:R-devel at r-project.org> mailing list
>         https://stat.ethz.ch/mailman/__listinfo/r-devel
>         <https://stat.ethz.ch/mailman/listinfo/r-devel>
>
>
>
>     --
>     Brian D. Ripley, ripley at stats.ox.ac.uk <mailto:ripley at stats.ox.ac.uk>
>     Professor of Applied Statistics,
>     http://www.stats.ox.ac.uk/~__ripley/
>     <http://www.stats.ox.ac.uk/~ripley/>
>     University of Oxford,             Tel: +44 1865 272861
>     <tel:%2B44%201865%20272861> (self)
>     1 South Parks Road, +44 1865 272866 <tel:%2B44%201865%20272866> (PA)
>     Oxford OX1 3TG, UK                Fax: +44 1865 272595
>     <tel:%2B44%201865%20272595>
>
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] executable files R package
Prof Brian Ripley