[Rd] R CMD check --force-biarch

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Oct 19 16:58:08 CEST 2012


On 19/10/2012 15:00, Simon Urbanek wrote:
>
> On Oct 18, 2012, at 12:17 PM, Russell G. Almond wrote:
>
>> I'm having problems getting R CMD check to work correctly on Windows 7 (64 bit) in a package that uses C code.  What I want to do is to be able to pass the equivalent of the "--force-biarch" option to check, but this is only supported for INSTALL.

And he seems to have missed

R CMD check --help

includes

       --install-args=	command-line args to be passed to INSTALL

so I would have used

R CMD check --install-args=--force-biarch

(and when I do, it works for me).

>> Background:
>> I'm writing a package (RNetica) which forms a link between R and a third-party library (Netica.dll).  The vendor supplies this library in both a 32 bit and a 64 bit version.
>> Under Linux, I use configure to link against the 32 or 64 bit version of libnetica.a as appropriate.
>> Under Windows, I use configure.win to copy the 32 and 64 bit versions to "$R_PACKAGE_DIR/libs/i386"  and "$R_PACKAGE_DIR/libs/x64" respectively.
>>
>> Installation:
>> This mostly works.  If I run R CMD INSTALL RNetica, R detects the configure.win and only builds the 64 bit version of RNetica.  [I'm not entirely clear on why R doesn't at least try to build both architectures. Wouldn't the default assumption be that the author wrote the configure.win file to handle both cases?]
>
> No, it's not configure's job to detect anything but the current architecture. Typically it needs to modify files so it can only modify them for one architecture. Your use of configure is very odd since you don't actually configure the package, you are copying dependencies into installation directories (so you can't even test it without override - that's very unusual and a bit questionable).
>
>
>>   But if I use R CMD INSTALL RNetica --force-biarch, it correctly builds and installs both the 32 and 64 bit versions.  I can verify that I can load my library and call a few functions that exercise the DLL.
>>
>> Checking:
>> When I run R CMD check RNetica, I get the following problem in my 00install.out log:
>>> Warning: this package has a non-empty 'configure.win' file,
>>> so building only the main architecture
>> It then fails with the message:
>>> Error:  .onLoad failed in loadNamespace() for 'RNetica', details:
>>> Call:  library.dynam("RNetica",pkgname, libname)
>>> Error:  DLL 'RNetica' not found:  maybe not installed for this architecture?
>> Sure enough, if I check the directory RNetica.Rcheck/RNetica/libs/x64
>> It has Netica.dll, RNetica.dll, and symbols.rds
>> If I check the directory RNetica.Rcheck/RNetica/libs/i386
>> It only has Netica.dll (copied there by the configure.win).
>>
>> If I run R CMD check RNetica --no-multiarch, this test runs correctly.
>> If I run R CMD check RNetica --extra-arch, this fails at the same point.
>>
>
> You probably mean to use R --arch i386 to check your 32-bit version - architectures are normally tested separately.
>
> Cheers,
> Simon
>
>
>> Thanks in advance for any help.
>>
>>
>>
>> Russell Almond
>> almond at acm.org
>> http://ralmond.net/
>>
>>
>> Russell G. Almond
>> 12065 Cedar Bluff Trail
>> Tallahassee, FL 32312
>> 1-850-668-9624
>> http://ralmond.net
>> almond at acm.org
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
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



More information about the R-devel mailing list