Displaying 2 results from an estimated 2 matches for "cfortran".
Did you mean:
fortran
2009 Feb 06
1
Use of cfortran.h?
...(Don't panic -- this won't happen quickly.) Mike writes
f77 code. After some chasing about, I've realized that because
optimization codes need to call the objective function written in R, they
need to use a language that can do this. C can, Fortran cannot.
There is, however, a package cfortran that allows for mixed coding in C
and Fortran. This might not be the ultimate solution -- e.g., it may not
be Windows usable. However, it could be a useful tool to try out some
programs that are already available in Fortran.
My query is to ask if anyone has experience they can share in using
cfort...
2005 Sep 04
1
.Call with C and Fortran together (PR#8122)
...compile it as a shared lib. Look at the files:
File: prog.f
-------------
subroutine cg()
write(*,*) 'Just a simple test'
end
subroutine program()
write(*,*) 'Calling the function...'
call cg()
end
File test.h
------------
#include "cfortran.h"
PROTOCCALLSFSUB0(PROGRAM,program)
#define program() CCALLSFSUB0(PROGRAM,program)
File test.c
------------
#include <R.h>
#include <Rdefines.h>
#include <stdio.h>
SEXP simple_program(){
program();
return R_NilValue;
}
I compile the C and Fortran souces into a shar...