Running examples in ‘BuildSys-Ex.R’ failed
The error most likely occurred in:

> ### Name: BuildSys-package
> ### Title: System for Building and Debugging C/C++ Dynamic Libraries
> ### Aliases: BuildSys-package BuildSys
> ### Keywords: package debugging programming utilities
> 
> ### ** Examples
> 
> ProjectFolder <- tempdir()
> 
> # Create source file for finite convolution example in "Writing R Extensions"  
> lines <- c(
+ "#include <R.h>",
+ "#include <Rinternals.h>",
+ "",
+ "SEXP convolve2(SEXP a, SEXP b)",
+ "{",
+ "    int na, nb, nab;",
+ "    double *xa, *xb, *xab;",
+ "    SEXP ab;",
+ "",
+ "    a = PROTECT(coerceVector(a, REALSXP));",
+ "    b = PROTECT(coerceVector(b, REALSXP));",
+ "    na = length(a); nb = length(b); nab = na + nb - 1;",
+ "    ab = PROTECT(allocVector(REALSXP, nab));",
+ "    xa = REAL(a); xb = REAL(b); xab = REAL(ab);",
+ "    for(int i = 0; i < nab; i++) xab[i] = 0.0;",
+ "    for(int i = 0; i < na; i++)",
+ "        for(int j = 0; j < nb; j++) xab[i + j] += xa[i] * xb[j];",
+ "    UNPROTECT(3);",
+ "    return ab;",
+ "}")  
> 
> SourceFilePath <- paste0(ProjectFolder, "/convolve.c")
> writeLines(lines, SourceFilePath)
> 
> # digest need not be loaded but the digest package needs to be installed
> # as it is used to create a digest of the project to track the need for
> # makefile re-creation.
> require(BuildSys)
> 
> # create project to build shared library, a flat project with source in current working directory. 
> Project <- new("BSysProject", ProjectFolder)
> 
> # re-initialise project from current working directory, new("BSysProject") calls this internally
> Project <- initProjectFromFolder(Project, ProjectFolder)
> 
> # build the shared library
> make(Project)
make[1]: Entering directory '/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe'
rm convolve.so convolve.o
rm: cannot remove 'convolve.so': No such file or directory
rm: cannot remove 'convolve.o': No such file or directory
make[1]: *** [makefile:26: clean] Error 1
make[1]: Leaving directory '/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe'
make[1]: Entering directory '/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe'
gcc -O0 -g -DDEBUG -D_DEBUG -fPIC -I/data/gannet/ripley/R/R-clang/include   -c -o convolve.o convolve.c
g++ -o convolve.so -shared -fPIC convolve.o -L/data/gannet/ripley/R/R-clang/lib -lR
/usr/bin/ld: cannot find -lR
collect2: error: ld returned 1 exit status
make[1]: *** [makefile:21: convolve.so] Error 1
make[1]: Leaving directory '/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe'
BuildSys Project: convolve 
Working Folder: /tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/ 
> 
> # get project library path
> libraryPath(Project)
[1] "/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/convolve.so"
> 
> # get project source path
> sourcePath(Project)
[1] "/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/"
> 
> # get project include path
> includePath(Project)
[1] "/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/"
> 
> # get project object path
> objPath(Project)
[1] "/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/"
> 
> # get project install library path
> installLibraryPath(Project)
NULL
> 
> # get project install include path
> installIncludePath(Project)
NULL
> 
> # load the library
> loadLibrary(Project)
Error in dyn.load(libraryPath(.Object)) : 
  unable to load shared object '/tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/convolve.so':
  /tmp/RtmpDOnYuz/working_dir/RtmpTwhAJe/convolve.so: cannot open shared object file: No such file or directory
Calls: loadLibrary -> loadLibrary -> .local -> dyn.load
Execution halted