Package 'Ropenbabel'

Title: Open Babel cheminformatics C++ library as an R package
Description: Provides version 3.2.1 of the Open Babel C++ library, built as a static library, together with its headers and data files. Intended for developers of other R packages (such as ChemmineOB) who want to link against Open Babel without requiring a system installation. Use Ropenbabel::pkgconfig() in Makevars.
Authors: Kevin Horan [aut, cre], Thomas Girke [aut], Open Babel authors [cph]
Maintainer: Kevin Horan <[email protected]>
License: GPL-2
Version: 0.99.0
Built: 2026-11-24 21:32:14 UTC
Source: https://github.com/BiocStaging/Ropenbabel

Help Index


Open Babel C++ library for R packages

Description

Ropenbabel builds the Open Babel cheminformatics library from bundled sources as a static library when the package is installed, and installs its headers and data files. Other packages, such as ChemmineOB, link to it with the flags from pkgconfig, so they need no system installation of Open Babel.

See Also

pkgconfig, vignette("Ropenbabel")


Build flags, data directory and version of the bundled Open Babel

Description

Helpers for packages that link to the static Open Babel library shipped in Ropenbabel.

Usage

pkgconfig(opt = c("PKG_LIBS", "PKG_CPPFLAGS"))
dataDir()
obVersion()

Arguments

opt

Which flags to print: "PKG_CPPFLAGS" (include path) or "PKG_LIBS" (static libraries plus any system libraries, such as Cairo, that they were built against).

Details

pkgconfig is meant to be called from a client package's ‘src/Makevars’ (or ‘src/Makevars.win’):

RSCRIPT = "$(R_HOME)/bin/Rscript"
PKG_CPPFLAGS = $(shell $(RSCRIPT) -e "Ropenbabel::pkgconfig('PKG_CPPFLAGS')")
PKG_LIBS     = $(shell $(RSCRIPT) -e "Ropenbabel::pkgconfig('PKG_LIBS')")

together with LinkingTo: Ropenbabel and Imports: Ropenbabel in ‘DESCRIPTION’.

Open Babel reads force fields, atom types and other data files from the directory named by the BABEL_DATADIR environment variable. Ropenbabel sets it to dataDir() when loaded, unless it is already set.

Value

pkgconfig prints the flags with cat and returns NULL invisibly. dataDir returns the path of the Open Babel data directory. obVersion returns the Open Babel version as a character string.

Examples

pkgconfig("PKG_CPPFLAGS")
pkgconfig("PKG_LIBS")
dataDir()
obVersion()