Skip to content

installing package in Windows

3 messages · Karl W. Broman, Brian Ripley

#
Could you help me in getting a package to compile from source in Windows?
I'm running Windows NT 4.0 on a pentium 450 with 128 Mb of Ram.  I've got R
1.0.0.

I am developing a package for R which includes a bit of C code.  I have things
working in Unix just fine, and now I want to port it to Windows NT.  

I've been following the instructions in the R complements to Venables and
Ripley's book, "Building from a source-code library under Windows."  I
installed cygwin-20 and gcc-2.95.2, and ran "make pkg-qtl" (qtl is the name of
the package).  

That part works just fine.  But then when I run "make pkgcheck-qtl" I get the
following error.

======================================================================
bash-2.02$ make pkgcheck-qtl
-------- Testing package qtl --------
Running examples in 'qtl-Ex.R' ...
/Programs/R/rw1000/bin/rterm --vanilla R_LIBS="/Programs/R/rw1000/library;" < qtl-Ex.R > qtl-Ex.Rout

make[1]: *** [run] Error 1
make: *** [pkgcheck-qtl] Error 2
bash-2.02$
======================================================================

If, after a long sigh, I run Rgui and just cross my fingers.  Then the first
time I do "library(qtl)", I get the following error.  (No surprise, given the
above.) 

======================================================================
Error in dyn.load(x, as.logical(local), as.logical(now)) : 
        unable to load shared library "E:\Programs\R\rw1000/library/qtl/libs/qtl.dll":
  LoadLibrary failure
======================================================================

When I type "library(qtl)" a second time, I don't get an error, and all of the
R functions which do not call C routines run just fine, though the ones with C
routines give an error like "...C/Fortran function name not in load table."

Any hints on what I should fiddle with next, or what I read next?

One other thing...the "R.h" include file doesn't seem to include the
"R_ext/PrtUtil.h", where Rprintf is defined.  If I wish to use Rprintf, should
I include the latter file; should it have been included in R.h?

Thanks!
karl
-----------------
Karl W Broman
kbroman at jhsph.edu
-----------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 8 Mar 2000, Karl W. Broman wrote:

            
The documentation in rw1000sp.zip is the current set, and is more detailed
that in those complements.
Do look at the output to see what the error was.
We need to find out why you can't load this. One common reason is that
your DLL depends on some other DLL that it can't find.  And one common
cause for that if you used cygwin-b20 is that you managed to compile
against the cygwin1.dll.  You did have MkRules set up for CYGNUS not
MINGW32?

The simplest way to find out if dependencies are the problem is to look at
the DLL with pedump, a free program you should be able to find on the net
(it keeps moving).  You can make things work that are compiled against
cygwin1.dll, but you need to put it in your global path.

The only other reason we know of for problems is Win95-specific, and is
solved by using the cygwin ld.exe.

If that does not help can you send me the complete compile and link log
and the dll?
Yes, no (and the Writing R Extensions manual should mention this). There
are other things in that file that should not be included unless necessary.
#
Regarding my difficulty in building a package from source within Windows: as
Prof. Ripley suggested, I had not changed the line in
Rhome/src/gnuwin32/MkRules from "BUILD=MINGW32" to "BUILD=CYGWIN".  Once I
changed that, all ran smoothly

(Also, for the record, I hadn't looked at the qtl-Ex.Rout to find out what
the build error was, and I hadn't read the readme.packages file.)

Thanks for the quick response.  And thanks to all who have contributed to R;
it is totally cool.

Cheers,
karl
------------------------------------------
Karl W Broman
kbroman at jhsph.edu
http://biosun01.biostat.jhsph.edu/~kbroman
------------------------------------------
On Wed, 8 Mar 2000, Prof Brian D Ripley wrote:

            
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._