From ripley at stats.ox.ac.uk  Fri Nov  9 13:17:12 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 9 Nov 2007 12:17:12 +0000 (GMT)
Subject: [Rd] Building Rdll.lib with Visual C++
In-Reply-To: <E81FF08A6B0BD24CB237041DEF7FAEB308A7C503@NLDNC101PEX1.ubsw.net>
References: <E81FF08A6B0BD24CB237041DEF7FAEB308A7C503@NLDNC101PEX1.ubsw.net>
Message-ID: <Pine.LNX.4.64.0711091211040.23116@gannet.stats.ox.ac.uk>

On Fri, 9 Nov 2007, William.Fulton at ubs.com wrote:

>> From the R-2.6.0/doc/README.packages it says:
>
>  Using Visual C++
>  ================
>
>  You may if you prefer use Visual C++ to make the DLLs (unless they use
>  Fortran source!). The notes here were tested with VC++6.
>
>  First build the import library Rdll.lib by
>
> 	make R.exp
>  ...
>
> In the installation (R-2.6.0-win32.exe) there is no Makefile with an
> R.exp target that I could find and I get (using Cygwin's make):
>
> $ pwd
> /c/Program Files/R/R-2.6.0/src/gnuwin32
> $ make R.exp
> make: *** No rule to make target `R.exp'.  Stop.
>
> I found a R.exp target in the gnuwin32/Makefile after extracting the
> files in R-2.6.0.tar.gz. However, attempting to use this target fails,
> it looks like it is attempting to build the object files in R.dll first.
> Do I have to go figure out how to build R from Source in order to get
> the Rdll.lib file or am I doing something fundamentally wrong?

You do (although it only involves RTFM).  Alternatively, you could be less 
selective in your reading, and note it also says

   (Another, less reliable, way to make R.exp is to use pexports.exe from
   mingw-utils.)

The reason for the comment is that some earlier versions of pexports.exe 
used to choke, but it seems to work on all recent versions.

> Perhaps the maintainers would consider shipping Rdll.lib in the future
> with the distribution like the equivalent .lib file is done for building
> extensions for Perl, Ruby, Tcl, Python etc.

But they are built with VC++, and R is not.  No such file is needed to 
build extensions for R using the recommended tools.

-- 
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] Building Rdll.lib with Visual C++
Prof Brian Ripley