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

Duncan Murdoch murdoch at stats.uwo.ca
Fri Mar 24 15:18:15 CET 2006


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                  
> major    2              
> minor    2.1            
> year     2005           
> month    12             
> 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                           text    html    latex   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 disclosure. If the reader of this message is not 
> the intended recipient you are hereby notified that any dissemination, distribution
> or copying of this communication is strictly prohibited. If you have received this 
> communication in error, please notify us immediately by replying to the message 
> and deleting it from your computer. Thank you. IHE
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list