[Rd] .Fortran successful, R locks up.

Daniel Fuka drf28 at cornell.edu
Thu Mar 24 17:35:07 CET 2011


I am having a problem with a library compiled from some legacy fortran
code. I can call the library, it runs as it should, returns a list,
and gives a ">" prompt, but then locks up the R session. Functions
typed in return nothing. ctrl-c results in a new prompt that is still
locked up, and R overwhelms the processor. This happens on Mac,
Windows, and Linux exactly the same. I close all open files and
confirm nothing is still open with unix lsof. I also have added a
routine to deallocate all allocated variables.

Does anyone have any suggestions in how I might be able to debug this
further? I have included output from the R session, top -o CPU, and R

Thanks for your time on my behalf!

Ouput from R session with library "swat" and subroutine "junk":
> library.dynam("swat","EcoHydrology")
> .Fortran("junk")
      Soil & Water Assessment Tool
               PC Version
 Program reading from file.cio . . . executing

> q("n")
> obejcts()

> q()

> ^Z
[1]+  Stopped                 r
dan$ killall R
[1]+  Terminated              r

Output from top during lockup:
40750 R           96.6%  1:56.07   1    17     87   15M  1384K-   19M    49M

Output from R CMD INSTALL:
114 mirage5:fuka% R CMD INSTALL EcoHydrology
* installing to library
* installing *source* package ‘EcoHydrology’ ...
** libs
** arch -
Makefile:123: warning: overriding commands for target `.f.o'
/fs/local/apps/R-2.12.1/lib64/R/etc/Makeconf:132: warning: ignoring
old commands for target `.f.o'
gfortran -fPIC -g -O2   -c modparm.f
gfortran -fPIC -g -O2   -c addh.f
---SNIP successful gfortran output----
gfortran -fPIC -g -O2   -c zeroini.f
gfortran -fPIC -g -O2   -c closefiles.f
gfortran -shared  -o swat.so modparm.o addh.o albedo.o
allocate_parms.o alph.o analyse.o anfert.o apex_day.o apply.o ascrv.o
---SNIP successful link output----
writeaa.o writed.o writem.o writeswatfile.o writeswatmain.o xisquare.o
xiunc.o xmon.o ysed.o zero0.o zero1.o zero2.o zeroini.o closefiles.o
installing to /glade/home/fuka/R/x86_64-unknown-linux-gnu-library/2.12/EcoHydrology/libs
** R
** data
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded

* DONE (EcoHydrology)

More information about the R-devel mailing list