Displaying 20 results from an estimated 46 matches for "f77_name".
2013 Aug 27
1
Error in simulation. NAN
...}
int nSamples_save = iter_2;
// generatore random
GetRNGstate();
// /*****************************************
// // UPDATE PARAMETRI
// *****************************************/
// alpha
double *alpha_acc_P = (double *) R_alloc(1, sizeof(double));
F77_NAME(dcopy)(&incOne, start_alpha_P, &incOne, alpha_acc_P, &incOne);
// mu_acc
double *mu_acc_P = (double *) R_alloc(J, sizeof(double));
F77_NAME(dcopy)(&incJ, start_mu_P, &incOne, mu_acc_P, &incOne);
// phi
double *phi_acc_P = (double *) R_alloc(1, sizeof...
2010 Jan 03
3
F77_CALL, F77_NAME definition
I give up. Maybe it is my search (Windows) but I cannot seem to find the definition of the F77_CALL or F77_NAME macros. Either there are too many matches or the search just doesn't find it. For example where is the source for:
F77_CALL(dpotri)
?
Thank you.
Kevin
2002 Feb 08
1
question about F77_NAME()
Dear R-help,
Sorry if this is way obvious. (It just wasn't for me...)
Do all parameters passed to Fortran routines from C need to be declared as
pointers? In various header files (e.g., Linpack.h), that seems to be the
case.
Also, what type should I declare in front of F77_NAME() for a subroutine?
void?
Thanks for any help!
Regards,
Andy
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the...
2015 Mar 25
4
F77_CALL/NAME problem
Dear R-devel,
I am trying to use Fortran DGESV subroutine into C. Here it is the relevant
part of the C file I am currently writing
#include<stdio.h>
#include<R.h>
#include<Rmath.h>
#include<math.h>
void F77_NAME(DGESV)( int*, int*, double*, int*, int*, double*, int*, int*);
void solve( int *p, double *A, double *Ainv)
{
...
F77_CALL(DGESV)(p, p, Ain, p, ipiv, Bin, p, &info);
}
In order to create the ".so" file to load in R I downloaded the dgesv.f file
as well as the dependencies (...
2008 Aug 06
1
error in installing R packages
...TIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
-mtune=generic -c classTree.c -o classTree.o
classTree.c:15:15: error: R.h: No such file or directory
classTree.c:16:19: error: Rmath.h: No such file or directory
In file included from classTree.c:17:
rf.h:95: error: ?F77_NAME? declared as function returning a function
rf.h:95: warning: parameter names (without types) in function
declaration
classTree.c:292: error: ?F77_NAME? declared as function returning a
function
classTree.c: In function ?F77_NAME?:
classTree.c:292: warning: type of ?catmax? defaults to ?int?
cl...
2017 May 09
2
registering Fortran routines in R packages
...rmetrics.
Reading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
static const R_FortranMethodDef FortEntries[] = {
{"halton", (DL_FUNC) &F77_NAME(HALTON), 7},
{"sobol", (DL_FUNC) &F77_NAME(SOBOL), 11},
{NULL, NULL, 0}
};
But I got error messages when building : use of undeclared identifier ?SOBOL_?. I also tried in lower case sobol and halton.
Looking at expm package https://r-forge.r-project.org/scm/viewvc.php/pkg/src/in...
2014 Jun 04
1
Lapack / dgesvx function declaration
Hello there
I'm writing some c-code to solve a numerically tough problem for me in
R. Looking in Lapack.h, i find the following line
F77_NAME(dgesvx)(const int* fact, const char* trans, const int* n,
and I believe that "fact" should've been char instead of int, i.e.
F77_NAME(dgesvx)(const char* fact, const char* trans, const int* n,
My reasoning: In the R-source:
src/modules/lapack/dlapack.f
I find the following lines:...
2009 Mar 10
1
dger_ in BLAS definition
...'dger_' discards
qualifiers from pointer target type
conditionals.c:104: warning: passing argument 6 of 'dger_' discards
qualifiers from pointer target type
the netlib documentation states that the arguments x and y should be
unchanged on exit. Should should imply the defintion:
F77_NAME(dger)(const int * const m, const int * const n, const double *
const alpha,
double const * const x, const int *const incx,
double const * const y, const int *const incy,
double * const a, const int * const lda);
the current definition is missing the appropriate con...
2006 Dec 19
1
precision when calling a C function; presence of Fortran call
...n call affects the
result of a floating-point operation. I have C functions
void test1(int *n, double *f){
int outC;
double c0;
c0 = (double) *n * *f;
outC = floor(c0);
printf("when f computed by R, C says %d by itself\n",outC);
}
void test2(int *n, double *f){
extern int F77_NAME(ifloor)(double *);
int outC,outFor;
double c0;
c0 = (double) *n * *f;
outFor = F77_CALL(ifloor)(&c0);
outC = floor(c0);
printf("when f computed by R, C says %d, Fortran says %d\n",outC,outFor);
}
where the Fortran function ifloor is
integer function ifloor(x)...
2005 Aug 28
2
xerbla called from BLAS routine (PR#8100)
Full_Name: G?ran Brostr?m
Version: R-2.1.1, 2.2.0
OS: Debian unstable
Submission from: (NULL) (213.65.9.59)
Some BLAS routines call xerbla for error messages, which results in a message
like
"LAPACK routine DGER gave error code -9".
Suggested solution: In
void F77_NAME(xerbla)(char *srname, int *info)
{
/* srname is not null-terminated. It should be 6 characters. */
char buf[7];
strncpy(buf, srname, 6);
buf[6] = '\0';
error(_("LAPACK routine '%6s' gave error code %d"), buf, -(*info));
}
change 'LAPACK' to ...
2008 Jul 09
1
Help with installing add-on packages
...-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -c init.c -o init.o
init.c:2:15: error: R.h: No such file or directory
init.c:3:24: error: Rinternals.h: No such file or directory
In file included from init.c:5:
akima.h:7: error: ?F77_NAME? declared as function returning a function
akima.h:7: warning: parameter names (without types) in function declaration
akima.h:12: error: ?F77_NAME? declared as function returning a function
akima.h:12: warning: parameter names (without types) in function declaration
akima.h:18: error: ?F77_NAME? d...
2012 Mar 06
2
Calling FORTRAN function from R issue?
...routines can be called (not functions), probably
because of the non-standard way the compilers map FORTRAN
function names to symbols in the DLL.
This is consistent with the interface prototype for the BLAS
routine zdotc contained in <R>/include/R_ext/BLAS.h, namely,
BLAS_extern Rcomplex
F77_NAME(zdotc)(Rcomplex * ret_val, int *n,
Rcomplex *zx, int *incx, Rcomplex *zy, int *incy);
But this seems to BOTH return a result, and pass the result
as the first argument?
On the other hand, this is not consistent with the standard
FORTRAN definition for zdotc that is contained in
<R>/sr...
2008 Sep 18
2
Problem installing packages in newer versions of R
...-fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -c init.c -o init.o
init.c:2:15: error: R.h: No such file or directory
init.c:3:24: error: Rinternals.h: No such file or directory
In file included from init.c:5:
akima.h:7: error: ?F77_NAME? declared as function returning a function
akima.h:7: warning: parameter names (without types) in function declaration
akima.h:12: error: ?F77_NAME? declared as function returning a function
akima.h:12: warning: parameter names (without types) in function declaration
akima.h:18: error: ?F77_NAME? d...
2017 May 09
0
registering Fortran routines in R packages
...ading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
>
> static const R_FortranMethodDef FortEntries[] = {
> {"halton", (DL_FUNC) &F77_NAME(HALTON), 7},
> {"sobol", (DL_FUNC) &F77_NAME(SOBOL), 11},
> {NULL, NULL, 0}
> };
>
> But I got error messages when building : use of undeclared identifier ?SOBOL_?. I also tried in lower case sobol and halton.
>
> Looking at expm package https://r-forge.r-proj...
2023 Mar 17
1
La_library() always returns "" on R-devel?
Seems like this in 83986 [1] needs a fix in Lapack.c:
if (dladdr((void *) F77_NAME(ilaver), &dl_info)) {
char buf[PATH_MAX+1];
char *res = realpath(dl_info.dli_fname, buf);
if (res) {
SEXP nfo = R_NilValue;
if (strstr(res, "flexiblas"))
nfo = R_flexiblas_info();
i...
2004 Jul 05
1
passing char's from C to Fortran (mac os x)
Hello All,
In some package I use a c-routine which calls a fortran routine which
expects a char-string as input.
As per the writing R-extensions manual,
the Fortran routine is declared in C as:
void F77_NAME (setoptions) (char **option);
and then it is calles as follows:
char **option;
option = new char*[1];
option[0] = new char[256];
option[0] = strcpy(option[0],"Iteration Limit = 100");
Rprintf(option[0]);
F77_CALL (setoptions) (option);
Unfortunately this does not wor...
2001 Oct 01
1
Graceful exit from fortran.
Is there a way to exit gracefully from dynamically loaded Fortran,
(several layers down), if an error condition is detected?
I.e. suppose I'm within a subroutine called by a subroutine, ...,
called by .Fortran(); I want to give up gracefully if an error
condition is detected.
If I say something like
if(x .gt. 42.d0) stop
then indeed everything stops, i.e. R falls over. I'd
2024 Oct 25
1
Good practice for packages with Fortran and C code
My older packages have some Fortran and C routines. The Fortran is ancient and I am started to convert it to Fortran 2018 (thanks ChatGPT). To have a mixture of Fortran and C code in a package I have had a src/init.c file that provides names for routines of the form F77_name, and I called the routines with .Fortran(F77_name, ...) and in NAMESPACE had useDynLib(package name, .registration=TRUE, .fixes="F_").
Now I find that I can get rid of init.c, and change NAMESPACE to use useDynLib(package name, list of compiled routine names) (without .registration and...
2019 Apr 29
3
R 3.6.0 for Debian buster
Am Montag, 29. April 2019, 13:44:03 CEST schrieb Kurt Hornik:
> >>>>> Johannes Ranke writes:
> Thanks. You may have seen that with current gfortran in
> testing/unstable, there are problems with the R BLAS/LAPACK API entries
> using a Fortran interface (and hence in particular when using the BLAS
> and LAPACK sources that ship with R).
No, I wasn't aware of
2019 Apr 29
3
R 3.6.0 for Debian buster
...gt;
> Not really, as the issue seems to complicated to condense into a bug
> report. From discussions with Thomas Koenig from the GCC team, it seems
> that f2c, g77 and now gfortran have always added additional character
> length arguments for each character argument, where the R
> F77_NAME/F77_CALL mechanism has always called with the arguments of the
> Fortran subroutine but without the additional length arguments. A
> change in gcc trunk also ported to gcc-8-branch apparently changed what
> happened in such case, to the effect that we're now seeing about 25
> CRAN...