Skip to content
Back to formatted view

Raw Message

Message-ID: <1b9367b8-917d-6662-bdfd-d8afdd877430@uiowa.edu>
Date: 2023-03-25T14:41:47Z
From: iuke-tier@ey m@iii@g oii uiow@@edu
Subject: [R-pkg-devel] [External] Another DLL requires the use of native symbols thread
In-Reply-To: <SA1PR13MB48780AED002BFE3D1A6CA460C3859@SA1PR13MB4878.namprd13.prod.outlook.com>

Take another look at R-exts, specifically

https://cran.r-project.org/doc/manuals/R-exts.html#Registering-native-routines

Your call

     R_forceSymbols(dll, TRUE);

says you want foreign function calls to only work with entry points
specified by R objects representing native symbols. This was not being
enforced but is now in R devel.

Your NAMESPACE file directive

     useDynLib(splines, .registration = TRUE, .fixes = "C_")

says that these R objects should use a C_ prefix, so your .Fortran
call should be

    res <- .Fortran(C_bt, as.double(Temp), as.double(y), as.integer(icode))

So you can either fix your .Fortran call to be consistent with what
you have asked R to use, or drop the R_forceSymbols call.

Best,

luke

On Sat, 25 Mar 2023, Shawn Way wrote:

> Sorry to kind of repeat this but I really didn't understand the issues with the prior thread and how it relates to my issue.
>
> I'm getting the error message in
>
>    B_T <- BT(Temp)
>    Error in BT(Temp) : DLL requires the use of native symbols
>    Execution halted
>
> And frankly, I have no idea what this means.  The function call is pretty simple and meets the requirement of .Fortran
>
> res <- .Fortran('BT', as.double(Temp), as.double(y), as.integer(icode))
>
> and the following matches the R-ext's method for using registration:
>
> extern void F77_NAME(bt)(double *T, double *B, int *icode);
>
> void R_init_IAPWS95(DllInfo *dll)
> {
>  R_registerRoutines(dll, NULL, NULL, FortranEntries, NULL);
>  R_useDynamicSymbols(dll, FALSE);
>  R_forceSymbols(dll, TRUE);
> }
>
> With
>
> static const R_FortranMethodDef FortranEntries[] = {
>  {"bt",        (DL_FUNC) &F77_NAME(bt),        3},
>  {NULL, NULL, 0}
> };
>
> Furthermore the NAMESPACE includes:
>
> useDynLib(splines, .registration = TRUE, .fixes = "C_")
>
>
> which matches R-ext.
>
> Since this is only occurring on the Linux versions for the software and I use windows, can someone point me in the right direction to fix this error?
>
> Shawn Way
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

-- 
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:   luke-tierney at uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu