[STATSGRASS] Re: [GRASS5] CygWIN: compilation of current CVS HEAD?
Roger Bivand
Roger.Bivand at nhh.no
Sun Feb 9 08:36:38 EST 2003
On Sat, 8 Feb 2003, Glynn Clements wrote:
>
> Roger Bivand wrote:
>
> > Further to my comments on compiling the R/GRASS interface under Windows,
> > and after trying various routes, I'm inclined to think that Glynn is
> > right. I think libgis.a and libdatetime.a really ought to be compiled
> > using the R build train (MinGW) - at present for a fresh CygWin install
> > there are version differences that raise errors when the DLL is being
> > created. When compilation works, it is probably more luck than design. I'm
> > going to look at trying to build an R binary package for Windows using
> > libgrass - has anyone tried this? I'm moving this thread to statgrass, as
> > it is more relevant there.
>
> libgis uses the Unix API (open, read, write) for most of its file I/O,
> as well as using several other Unix functions for other (mostly
> peripheral) purposes. Presumably this means that the Cygwin DLL is
> required.
>
> Specifically, libgis imports the following non-ANSI functions from
> libc:
>
> accept access bind chmod close connect creat dup environ execl
> fdopen fileno fork geteuid gethostname getlogin getpid
> getpwuid gettimeofday getuid ioctl isatty kill link listen
> lseek mkdir open pipe read setlocale setpgrp setpriority
> setreuid setuid sleep socket system umask unlink wait write
>
> Mike Thomas <miketh at brisbane.paradigmgeo.com> has recently started
> work on getting GRASS to compile with MinGW; however, I don't know how
> far advanced this work is.
>
This is useful. In fact I have no idea how the GRASS package for R can be
compiled and installed - it contains a configure file, and the
installation scripts for R on Windows see it, issue a warning:
@if test -f ${SPKG}/configure; then \
echo ; \
echo " **********************************************" ; \
echo " WARNING: this package has a configure script" ; \
echo " It probably needs manual configuration" ; \
echo " **********************************************" ; \
echo ; \
fi
and proceed not compiling anything. For the INSTALL configure arguments to
work, some other scripts than that in rw10*/bin and rw10*/src/gnuwin32 are
needed - my guess is that the Unix INSTALL script is being run.
Consequently, Markus' advice on the web page probably only applies to a
very special setup. For me with a recent CygWin, recent R, recent MinGW,
Glynn's remarks about the Unix API apply, with unfulfilled references to
lots of things in libgis.a, which could only be "met" by linking libc.a
from CygWin, and creating a fictive global variable _impure_ptr - and the
DLL still wouldn't load (this was after removing the configure process in
package installation, and hard-wiring -L and -l).
Can I ask people who have got the R/GRASS interface installed with R for
Windows to report on their CygWin version, MinGW version, R version,
interface version, and what you did with PATH settings and any other
changes that were needed? This information is needed to find out how to
write a "configure.win" file, or how to modify the package in order to
have it compile cleanly with the current MinGW-based R package
installation system. Then the package may be moved from Devel to the
regular contrib package area, I hope.
Since the interface only needs a subset of libgis.a and really doesn't
need libdatetime.a, it is possible that the files in src/libes/gis and
src/libes/datetime could be put within #ifndef RGRASS_INTERFACE #endif
to use an #ELSE /* RGRASS_INTERFACE */ to choose just the functions and
variables needed - to permit a subset of the files and headers to be
distributed with the package. I think this should be updated manually -
there is no good reason why the main source should be altered. I would
welcome advice on whether the CygWin GRASS / R / R interface user
community is sufficiently large for it to be sensible to use time on this!
Roger
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
More information about the grass-stats
mailing list