From ripley at stats.ox.ac.uk  Tue Jul 29 08:46:13 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 29 Jul 2008 07:46:13 +0100 (BST)
Subject: [Rd] a package installation problem on windows
In-Reply-To: <bc33365a0807282327m28b914fj8a4041c45163de95@mail.gmail.com>
References: <bc33365a0807282327m28b914fj8a4041c45163de95@mail.gmail.com>
Message-ID: <alpine.LFD.1.10.0807290742060.7429@gannet.stats.ox.ac.uk>

Nothing in the documentation says that DLLs created in the source 
directory will be installed -- this applies only to pkgname.dll.

We recommend you use R CMD INSTALL [--build], not R CMD build --binary.

It is very rare to need a src/Makefile.win, but it you choose to use one 
yo do need to ensure that you do understand the package installation 
mechanism.  Being surprised that undocumented things do not work is a sure 
sign that you have not studied the mechanism and documentation.

On Mon, 28 Jul 2008, Gang Liang wrote:

> Dear all,
>
> I encountered a problem when test installing a package of my own under
> the windows platform. The latest Rtools is installed, and Makefile.win
> is used for directing the compilation of C++ codes under the src
> directory. A sketch of the Makefile.win is as follows:
>
> --- Makefile.win (old) ---------
> all: part1.dll part2.dll
>
> %.dll: %.cpp
> 	R CMD SHLIB $<
> ---------------------------------------
>
> When I run "R CMD build --binary pakname", the Makefile.win is
> executed without error, but to my surprise, the wanted dll files are
> not produced as expected; thus, the binary package will be created
> without dlls. While if I run make in the src directory manually, all
> dll files will be created. This problem can be by-passed using my
> updated Makefile.win,
>
> --- Makefile.win (new) ---------
> all: part1.dll part2.dll copy
>
> %.dll: %.cpp
> 	R CMD SHLIB $<
>
> copy: part1.dll part2.dll
> 	mkdir -p ../inst/libs
> 	cp *.dll ../inst/libs
> ---------------------------------------
>
> It is ugly because I have to access the libs directory directly. My
> question is what is the right syntax to compile codes using Makefile
> then? Thanks very much!
>
> Gang Liang
>
> PS: Re the missing dll problem, my guess is that the command "R CMD
> SHLIB ..." is doing the compilation on a memory disk, and the final
> result is discarded right away. I even interrupted the compilation
> midway, and am still not able to find any intermediate files on my
> harddrive. On the other hand, the compilation is clearly done.
>
> ______________________________________________
> 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



[Rd] a package installation problem on windows
Prof Brian Ripley