Last active
March 3, 2017 21:28
-
-
Save slwu89/f97a97e26d4f0466883e093871b84cdf to your computer and use it in GitHub Desktop.
How to make a package with RcppGSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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