R-alpha: R on Windows95/gnuwin32 -- status report

Peter Dalgaard BSA (pd@kubism.ku.dk)
17 Jan 1997 22:07:15 +0100


To: r-testers@stat.math.ethz.ch
Subject: R-alpha: R on Windows95/gnuwin32 -- status report
From: Peter Dalgaard BSA <pd@kubism.ku.dk>
Date: 17 Jan 1997 22:07:15 +0100
Message-Id: <x24tggf1to.fsf@bush.kubism.ku.dk>

I got R working under W95 *in text mode* now. I thought I'd better
write down what I did to get this far, while I can still remember it,
in case anyone else wants to try a stab.

*** Note that these instructions are only intended for people who can
*** take a vague, perhaps slightly wrong hint and follow it as intended.

Space requirements: A 100 MB partition works for me when drvspace'd,
but there's *nothing* else on it. 200MB should work uncompressed, I
guess. Maybe a little less.

First, you'll need GNU-WIN32 itself. Get it from
http://www.cygnus.com/misc/gnu-win32/ Follow instructions to set it up
- almost! Turns out that the long filenames they suggest get into
trouble with a 66 character limit with some of W95's disk utilities. I
used gw32 for the home and renamed H-i386-somethinglongwinded to
Hi386.

I had some trouble setting the GCC_EXEC_PREFIX from autoexec.bat, but
once set from inside bash, it seems to stay set right. Note that the
path to bash et al. must be set before it is invoked (in autoexec.bat)
or you get "fork failed" errors. Play around with bash (invoke it from
the Explorer or in a DosBox) for a while to get a feeling for the
differences from Unix.

Non-US keyboard get in trouble with deadkey characters, which is a bit
of a pain (loses ^`~), and must be resolved, but for now, you can do
without. 

You'll soon discover that 'more' and 'vi' is missing. There are
pointers to less and vim on the web page above. Install them and
rename or copy as 'more' and 'vi'. 

You'll also want groff eventually, that was more tricky, so I'll tell
you about it later.

Untar R-0.15alpha.tar.gz in a suitable directory. Do NOT try this on a
networked drive or strange case-folding issues arise.

Type ./configure or sh configure. Keep an eye on the results. They
should look reasonably unix-like, except for missing X11 and dynamic
loading. Weird things happen if the setup is wrong.

Move the INSTALL file to another name. The gw32 make has case
insensitive targets and we want to make 'install'... Type make. Things
plod alog merrily until we get to dataentry.c, which wants some X11
include files. Change the line

#if defined(Macintosh) | defined(Unix)

to 

#if defined(Macintosh) | defined(Unix) & !defined(X_DISPLAY_MISSING)

Similar changes are required to devX11.c (surprise...) and rotated.c I
#else'd a dummy return into devX11.c and #if'd the entire contents of
rotated.c out.

Note that these fixes are actually also necessary on Unices without
X11. Not that there are many of those around, nowadays...

Continue the make. There is one (count'em: 1!) other problem in the
files used in R.binary: arithmetic.c defines log2() as a function, but
it is already defined as a macro, giving a parse error. Just insert
#ifdef log2
#undef log2
#endif
and it goes away.

R.binary links, and the base library gets installed and so forth. The
dynamically loadable code in src/library/{eda,mva} fails for obvious
reasons. 

At this point, textmode R works with almost zero glitches. Get rid of
the line in the profile file that tries to start x11() if it annoys.
Even command recall works, except for the ^`~ problem. Online help is
not there yet, though.

This is when we need to install groff. Get the version via the web
page (it's for NT, but never mind). Unpack it and move the binaries
over to all the other stuff with bash and friends. The files in the
share/groff directory want to live in /usr/local/share/groff, so just
move it over there. It is necessary to create your own nroff command.
Do this with a little shell script (nroff.exe):
#!/bin/sh
troff -Tascii $* | grotty

The etc/install-help script needs a little editing. First, there is no
/dev/null in W95, so replace the
cp /dev/null help/base/AnIndex
with
> help/base/AnIndex
which does the same thing, and also ditch the 2>/dev/null from nroff.
Secondly, the "sort" command seems to be badly broken in gw32, so
change the last line of the script to 
) >> help/base/AnIndex
It gets searched with grep anyway, so there's mainly cosmetic reasons
to sort it - or? BTW: What's the need to clear and then append to
AnIndex?? That could be just ">", right?

So far, so good. Next comes figuring out how to get a graphics window
running. The headers and libraries are all there and there's already
a Win32 device in the source, but I gather that it has gotten somewhat
old relative to the rest of the source...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-