[R] R crashes when loading library/package; Windows, Cygwin

2006-03-24 Thread Sixten Borg

Dear list members,

This is a question is about building an R package under windows and cygwin. 
Please bear with me.

I have a package in R that compiles well on my stationary computer (WINDOWS NT, 
R 1.8.1 and prior), and the resulting (package_version).zip  file works well 
there. It contains an R script file and a C file.

After installing tools to build the package on my laptop, the package builds 
successfully in the sense that both
(a)rcmd build -binary -docs=normal cultosaurus
and 
(b)  R CMD BUILD -binary -docs=normal cultosaurus
will successfully create a zipfile. (R version and compiler version below).

When I install the package from the local zip file, R seems happy and says
package 'cultosaurus' successfully unpacked and MD5 sums checked
updating HTML package descriptions

Trying to load the library, however, causes R to freeze for 10 seconds or so, 
without giving any message and then exit (Exit 5).

A subset of this package with the C source file removed will successfully 
build, and successfully load. Then of course there will be an error saying C 
entry point ... not in load table

Therefore the DLL seems to be causing this problem.


Any hints or advice would be highly appreciated.

Thanks in advance,
Sixten

 version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major2  
minor2.1
year 2005   
month12 
day  20 
svn rev  36812  
language R  
 

$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr --
exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --man
dir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,
java,objc --enable-nls --without-included-gettext --enable-version-specific-runt
ime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib --ena
ble-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=b
oehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchroniza
tion --enable-libstdcxx-debug : (reconfigured)
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)

$ perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 21 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

Binary build 816 [255195] provided by ActiveState http://www.ActiveState.com 
Built Mar  1 2006 18:00:52




Output from building the package.__
$ make
rcmd build -binary -docs=normal cultosaurus
* checking for file 'cultosaurus/DESCRIPTION' ... OK
* preparing 'cultosaurus':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking whether 'INDEX' is up-to-date ... OK
* removing junk files
* checking for LF line-endings in source files
* checking for empty directories
WARNING: directory cultosaurus/data is empty
* building binary distribution
 WARNING
* some HTML links may not be found
installing R.css in c:/DOCUME~1/Sixten/LOKALA~1/Temp/Rinst.432

Using auto-selected zip options ''
/bin/sh: latex: command not found
/bin/sh: latex: command not found
/bin/sh: latex: command not found

-- Making package cultosaurus 
/bin/sh: latex: command not found
  adding build stamp to DESCRIPTION
/bin/sh: latex: command not found
/bin/sh: latex: command not found
  making DLL ...
/bin/sh: latex: command not found
/bin/sh: latex: command not found
/bin/sh: latex: command not found
making erectus.d from erectus.c
gcc   -Ic:/program/R/R-2.2.1/include -Wall -O2   -c erectus.c -o erectus.o
ar cr cultosaurus.a erectus.o
ranlib cultosaurus.a
windres --include-dir c:/program/R/R-2.2.1/include  -i cultosaurus_res.rc -o cul
tosaurus_res.o
gcc  --shared -s  -o cultosaurus.dll cultosaurus.def cultosaurus.a cultosaurus_r
es.o  -Lc:/program/R/R-2.2.1/src/gnuwin32   -lg2c -lR
  ... DLL made
  installing DLL
/bin/sh: latex: command not found
  installing R files
/bin/sh: latex: command not found
/bin/sh: latex: command not found
  installing man source files
  installing indices
  installing help
  Building/Updating help pages for package 'cultosaurus'
 Formats: text html latex example
  sygehus   texthtmllatex   example
 missing link(s):  ~~fun~~
/bin/sh: latex: command not found
  adding MD5 sums

packaged installation of package 'cultosaurus' as cultosaurus_0.1.zip
* DONE (cultosaurus)

$

Sixten Borg

IHE
Box 2127
S-220 02 Lund
Sweden

tel: +46 46 32 91 07
fax:+46 46 12 16 04

Kommer man inte upp före klockan fyra på 
morgonen, så vaknar man inte på hela dan.

www.ihe.se
***
Note: The information contained in this message and attachments may be 
privileged
and confidential and protected from 

Re: [R] R crashes when loading library/package; Windows, Cygwin

2006-03-24 Thread Duncan Murdoch
On 3/24/2006 8:54 AM, Sixten Borg wrote:
 Dear list members,
 
 This is a question is about building an R package under windows and cygwin. 
 Please bear with me.
 
 I have a package in R that compiles well on my stationary computer (WINDOWS 
 NT, R 1.8.1 and prior), and the resulting (package_version).zip  file works 
 well there. It contains an R script file and a C file.
 
 After installing tools to build the package on my laptop, the package builds 
 successfully in the sense that both
 (a)rcmd build -binary -docs=normal cultosaurus
 and 
 (b)  R CMD BUILD -binary -docs=normal cultosaurus
 will successfully create a zipfile. (R version and compiler version below).

I think you're using a Cygwin compiler instead of the MinGW compiler, 
and that would likely cause the problem.  You should see something like this

$ gcc -v
Reading specs from f:/minGW/bin/../lib/gcc/mingw32/3.4.4/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as 
--host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls 
--enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry 
--disable-shared --e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x 
--enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter 
--enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.4 (mingw special)

instead of the gcc version report that you were getting.  You can get 
this compiler from mingw.org; it should come earlier in your path than 
the Cygwin compiler.

Duncan Murdoch

 
 When I install the package from the local zip file, R seems happy and says
 package 'cultosaurus' successfully unpacked and MD5 sums checked
 updating HTML package descriptions
 
 Trying to load the library, however, causes R to freeze for 10 seconds or so, 
 without giving any message and then exit (Exit 5).
 
 A subset of this package with the C source file removed will successfully 
 build, and successfully load. Then of course there will be an error saying C 
 entry point ... not in load table
 
 Therefore the DLL seems to be causing this problem.
 
 
 Any hints or advice would be highly appreciated.
 
 Thanks in advance,
 Sixten
 
 version
  _  
 platform i386-pc-mingw32
 arch i386   
 os   mingw32
 system   i386, mingw32  
 status  
 major2  
 minor2.1
 year 2005   
 month12 
 day  20 
 svn rev  36812  
 language R  
 
 
 $ gcc -v
 Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
 Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr 
 --
 exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib 
 --man
 dir=/usr/share/man --infodir=/usr/share/info 
 --enable-languages=c,ada,c++,d,f77,
 java,objc --enable-nls --without-included-gettext 
 --enable-version-specific-runt
 ime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib 
 --ena
 ble-interpreter --disable-libgcj-debug --enable-threads=posix 
 --enable-java-gc=b
 oehm --disable-win32-registry --enable-sjlj-exceptions 
 --enable-hash-synchroniza
 tion --enable-libstdcxx-debug : (reconfigured)
 Thread model: posix
 gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
 
 $ perl -v
 
 This is perl, v5.8.8 built for MSWin32-x86-multi-thread
 (with 21 registered patches, see perl -V for more detail)
 
 Copyright 1987-2006, Larry Wall
 
 Binary build 816 [255195] provided by ActiveState http://www.ActiveState.com 
 Built Mar  1 2006 18:00:52
 
 
 
 
 Output from building the package.__
 $ make
 rcmd build -binary -docs=normal cultosaurus
 * checking for file 'cultosaurus/DESCRIPTION' ... OK
 * preparing 'cultosaurus':
 * checking DESCRIPTION meta-information ... OK
 * cleaning src
 * checking whether 'INDEX' is up-to-date ... OK
 * removing junk files
 * checking for LF line-endings in source files
 * checking for empty directories
 WARNING: directory cultosaurus/data is empty
 * building binary distribution
  WARNING
 * some HTML links may not be found
 installing R.css in c:/DOCUME~1/Sixten/LOKALA~1/Temp/Rinst.432
 
 Using auto-selected zip options ''
 /bin/sh: latex: command not found
 /bin/sh: latex: command not found
 /bin/sh: latex: command not found
 
 -- Making package cultosaurus 
 /bin/sh: latex: command not found
   adding build stamp to DESCRIPTION
 /bin/sh: latex: command not found
 /bin/sh: latex: command not found
   making DLL ...
 /bin/sh: latex: command not found
 /bin/sh: latex: command not found
 /bin/sh: latex: command not found
 making erectus.d from erectus.c
 gcc   -Ic:/program/R/R-2.2.1/include -Wall -O2   -c erectus.c -o erectus.o
 ar cr cultosaurus.a erectus.o
 ranlib cultosaurus.a
 windres --include-dir c:/program/R/R-2.2.1/include  -i cultosaurus_res.rc -o 
 cul
 tosaurus_res.o
 gcc