16 Fortran / C / C++ / Python / Third-Party Code

If the package contains C or Fortran code, it should adhere to the standards and methods described in the System and foreign language interfaces section of the Writing R Extensions manual.

16.1 Makevars

Make judicious use of the Makevars and Makefile files within a package. These are often not required at all (See the Configure and cleanup section of the Writing R Extensions manual).

16.2 Fortran

Consider utilizing the dotCall64 CRAN package.

16.3 C / C++

The Rcpp CRAN package allows seamless integration of C++ with R, and is cross-platform. The package affords many of the same benefits for the R C interface that make C++ so appealing as a language, while eliminating many of the pitfalls of programming to the R interface.

The package is well documented, and has an extensive repository of working examples for many tasks: the Rcpp Gallery.

16.4 Python

The basilisk package uses conda to configure an appropriate Python environment on the user’s machine. It is strongly recommended if the routine operation of a Bioconductor package relies on Python, as users should not be asked to manually install Python packages.

The use of reticulate for the R/Python interaction is left to the discretion of the developer.

16.5 CMake

The biocmake package guarantees that a certain minimal version of CMake is available on the user machine, either by using an existing CMake installation or by installing its own from the official website. This should be used whenever a package relies on CMake during its build.

16.6 Other

Use of external libraries whose functionality is redundant with libraries already supported is strongly discouraged. In cases where the external library is complex, the author may need to supply pre-built binary versions for some platforms.

By including third-party code a package maintainer assumes responsibility for maintenance of that code. Part of the maintenance responsibility includes keeping the code up to date as bug fixes and updates are released for the mainline third-party project.