Brian J. Knaus

Brian J. Knaus’s blog about genomics and biology.

Running r-devel-ubsan-clang in Docker

My R package, vcfR Version 1.5.0, currently has an issue with clang-UBSAN. This can be seen at it’s CRAN site and clicking the link for ‘CRAN checks.’ Under the section ‘Additional issues’ it lists ‘clang-UBSAN’. clang is ‘a C language family frontend for LLVM’ that is typically used as the compiler on OSX (Macs) when Xcode is installed. The undefined behavior sanitizer (UBSAN) tests for issues such as memory overflows. In order for UBSAN to work you need a version of R that is compiled specifically for this purpose. We typically do not want to do this to the production version of R we use at our workstation. Instead, we’ll user the Docker image provided by Rocker.

Rocker provides Docker images for R in a number of flavors. The rocker dockerhub site can be found here. The rocker group has a rocker GitHub site as well. We’ll want to make sure we have the most recent version. We can do this by ‘pulling’ the image, which we accomplish as follows.

$ sudo docker pull rocker/r-devel-ubsan-clang

We should now be able to start our container.

$ sudo docker run --name=r-devel-ubsan-clang -v ~/gits/vcfR:/RSource/vcfR --rm -ti rocker/r-devel-ubsan-clang /bin/bash

Once we have our container running we can validate clang is installed by querying its version.

# clang-3.9 --version
clang version 3.9.1-9 (tags/RELEASE_391/rc2)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

We should now be ready to address our R package issues.


Share

comments powered by Disqus