[Rd] .Fortran successful, R locks up.

From: Daniel Fuka <drf28_at_cornell.edu>
Date: Thu, 24 Mar 2011 12:35:07 -0400


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 CMD INSTALL below.

Thanks for your time on my behalf!

Ouput from R session with library "swat" and subroutine "junk":
> library.dynam("swat","EcoHydrology&quot;)
> .Fortran("junk")

      Soil & Water Assessment Tool
               PC Version

 Program reading from file.cio . . . executing


> q("n")

> obejcts()

> q()

> ^Z

[1]+  Stopped                 r

DRF28:~/cornell/ecohydrology/swat_example/SJ_R_test_mac/Scenarios/Default/TxtInOut_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

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 25 Mar 2011 - 11:44:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Mar 2011 - 13:00:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive