Jonathan Shore
2011-Dec-19 15:30 UTC
[Rd] Issues with building package with C src on windows [R CMD INSTALL ignoring makefile]
I've written a rather complex package that requires overriding the default compilation behavior for the C code component. In the src dir I have a Makefile that is used correctly on OSX and Linux builds of the package, but completely ignored on windows. R CMD INSTALL <package> on windows runs Makeconf instead of running make on my Makefile. If run make in the src directory manually on windows, the shared library compiles. How can I get the INSTALL command to look for the Makefile? I am building on R 2.14.0 on a win 7 vm. Thanks Jonathan
Uwe Ligges
2011-Dec-19 15:38 UTC
[Rd] Issues with building package with C src on windows [R CMD INSTALL ignoring makefile]
On 19.12.2011 16:30, Jonathan Shore wrote:> I've written a rather complex package that requires overriding the default compilation behavior for the C code component. In the src dir I have a Makefile that is used correctly on OSX and Linux builds of the package, but completely ignored on windows. > > R CMD INSTALL<package> > > on windows runs Makeconf instead of running make on my Makefile. If run make in the src directory manually on windows, the shared library compiles. > > How can I get the INSTALL command to look for the Makefile? I am building on R 2.14.0 on a win 7 vm.See Writing R Extensions that tells you to write a Makefile.win which is used under Windows. Best, Uwe Ligges> > Thanks > Jonathan > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Simon Urbanek
2011-Dec-19 15:42 UTC
[Rd] Issues with building package with C src on windows [R CMD INSTALL ignoring makefile]
On Dec 19, 2011, at 10:30 AM, Jonathan Shore wrote:> I've written a rather complex package that requires overriding the default compilation behavior for the C code component. In the src dir I have a Makefile that is used correctly on OSX and Linux builds of the package, but completely ignored on windows. > > R CMD INSTALL <package> > > on windows runs Makeconf instead of running make on my Makefile. If run make in the src directory manually on windows, the shared library compiles. >See R-ext - you probably need to create Makefile.win Note that in most cases it is unnecessary to use Makefile - you can add targets to Makevars which will supply you with the correct flags and give you flexibility whereas Makefile is very limited in that you need to write all rules by hand which is very error prone and likely to break with new R versions. Cheers, Simon> How can I get the INSTALL command to look for the Makefile? I am building on R 2.14.0 on a win 7 vm. > > Thanks > Jonathan > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >
Prof Brian Ripley
2011-Dec-19 15:43 UTC
[Rd] Issues with building package with C src on windows [R CMD INSTALL ignoring makefile]
If all else fails, read the manual: it is explicitly documented that you need a file src/Makefile.win . And very likely you should rather study the manual to resolve what issue you think 'requires' a Makefile: those who want to use R on other platforms (e.g. Solaris and AIX) are unlikely to thank you for taking that route. On 19/12/2011 15:30, Jonathan Shore wrote:> I've written a rather complex package that requires overriding the default compilation behavior for the C code component. In the src dir I have a Makefile that is used correctly on OSX and Linux builds of the package, but completely ignored on windows. > > R CMD INSTALL<package> > > on windows runs Makeconf instead of running make on my Makefile. If run make in the src directory manually on windows, the shared library compiles. > > How can I get the INSTALL command to look for the Makefile? I am building on R 2.14.0 on a win 7 vm. > > Thanks > Jonathan > ______________________________________________ > 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