[R] Fortran code

Dave Roberts droberts at montana.edu
Thu Apr 13 20:46:52 CEST 2006


Sotiris,

    R is generally fairly graceful about FORTRAN in linux; Windows is 
another matter.  For example, R/linux will allow you to write to the R 
console as a file device without using the special I/O routines often 
needed in R.  There are many very complicated FORTRAN routines currently 
running in libraries where you don't know you're running FORTRAN.

    Does your code compile successfully to a shared object?

R CMD SHLIB *.f

    If so, does it fail when you try to dyn.load?  Or does it fail at 
run time when you invoke the function?  If the last step is the problem, 
make very sure that you cast your R variables explicitly in your 
.Fortran call to make sure that the variable sizes in memory are correct.

    Please give us much more complete information about the error or we 
will be unable to help.

Dave R.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David W. Roberts                                     office 406-994-4548
Professor and Head                                      FAX 406-994-3190
Department of Ecology                         email droberts at montana.edu
Montana State University
Bozeman, MT 59717-3460

Sotiris Adamakis wrote:
>   Hi!
> 
> I have faced a big problem with R on my LINUX machine. I want to load a Fortran code via R, but the program can't do it. I have tried to load simpler codes, which seem to work perfectly, but the code I would like to load - which is a little more complicated - can't be loaded. 
> I have installed the R 2.2.1 version. Should I need anything else to install (e.g. a library)? Is there a way out or should I just quit? I am asking this because I don't know if R is compatible with more complicated Fortran subroutines. 
> Any suggestions would be very helpful for this crucial problem. If there are any, where should I search for this answer?
> 
> Thanks in advance, 
> Sotiris
> 
> 
> 		
> ---------------------------------
> 
> 
>  http://login.yahoo.com/config/mail?.intl=gr 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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