search for: package_name_init

Displaying 2 results from an estimated 2 matches for "package_name_init".

2024 Oct 25
1
Good practice for packages with Fortran and C code
....which is the init.c approach you have been using. With useDynLib(package name, list of compiled routine names), R has to ask the operating system's dynamic loader to find exported functions in the DLL by their names. With function registration, it is enough for the DLL to export one function (package_name_init) and then directly provide function pointers together with their desired names to R. The latter is considered more reliable than talking to the operating system's dynamic loader. It also provides an opportunity for R to check the number of arguments and their types. > I'm also using For...
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,