Skip to content

Instantly share code, notes, and snippets.

@slwu89
Last active March 3, 2017 21:28
Show Gist options
  • Save slwu89/f97a97e26d4f0466883e093871b84cdf to your computer and use it in GitHub Desktop.
Save slwu89/f97a97e26d4f0466883e093871b84cdf to your computer and use it in GitHub Desktop.
How to make a package with RcppGSL
Things to do (MacOS Sierra):
1. make a file: src/Makevars that contains:
PKG_CFLAGS = `gsl-config --cflags`
PKG_LIBS = `gsl-config --libs`
PKG_CPPFLAGS = -I../inst/include
2. the DESCRIPTION should include:
Imports: Rcpp
LinkingTo: Rcpp, RcppGSL
3. the NAMESPACE should look like:
exportPattern("^[[:alpha:]]+")
importFrom(Rcpp, evalCpp)
useDynLib(MYPACKAGE)
4. if you need to link to external .h or .hpp files, put them in inst/include/ ; to access them from .cpp files in src/ you will use the tag #include <MYHEADER.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment