diff --git a/R/src/Makevars b/R/src/Makevars index 045952da7..85daf02ad 100644 --- a/R/src/Makevars +++ b/R/src/Makevars @@ -1,2 +1,11 @@ -#TODO COPY THIS FROM Makevars.interpret -# THIS FILE IS ONLY USED WHEN using devtools::install_github('microsoft/interpret',subdir='R') +# Makevars and Makevars.interpret need to be identical files, except the COREDIR variable which indicates where to get the core C++ files +# Makevars needs to be named that exactly because it will get loaded from devtools::install_github and devtools will want it to be that name. When being installed from devtools, we can refer to .cpp and .h files wherever they are in the repo, so we use the COREDIR to point to them +# Makevars.interpret is the CRAN version of Makevars. When the interpret_*.tar.gz is created the Makevars.interpret file gets copied as Makevars into the R building directory + +COREDIR=../../core + +CXX_STD = CXX11 +PKG_CPPFLAGS= -I$(COREDIR) -I$(COREDIR)/inc -DEBMCORE_R +PKG_CXXFLAGS=$(CXX_VISIBILITY) + +OBJECTS = interpret_R.o $(COREDIR)/DataSetByFeature.o $(COREDIR)/DataSetByFeatureCombination.o $(COREDIR)/InteractionDetection.o $(COREDIR)/Logging.o $(COREDIR)/SamplingWithReplacement.o $(COREDIR)/Training.o diff --git a/R/src/Makevars.interpret b/R/src/Makevars.interpret index 346354a65..274eb08a3 100644 --- a/R/src/Makevars.interpret +++ b/R/src/Makevars.interpret @@ -1,8 +1,11 @@ -ROOTDIR=../../ +# Makevars and Makevars.interpret need to be identical files, except the COREDIR variable which indicates where to get the core C++ files +# Makevars needs to be named that exactly because it will get loaded from devtools::install_github and devtools will want it to be that name. When being installed from devtools, we can refer to .cpp and .h files wherever they are in the repo, so we use the COREDIR to point to them +# Makevars.interpret is the CRAN version of Makevars. When the interpret_*.tar.gz is created the Makevars.interpret file gets copied as Makevars into the R building directory -CXX_STD = CXX11 +COREDIR=./core -PKG_CPPFLAGS= -Icore -Icore/inc -DEBMCORE_R +CXX_STD = CXX11 +PKG_CPPFLAGS= -I$(COREDIR) -I$(COREDIR)/inc -DEBMCORE_R PKG_CXXFLAGS=$(CXX_VISIBILITY) -OBJECTS = interpret_R.o core/DataSetByFeature.o core/DataSetByFeatureCombination.o core/InteractionDetection.o core/Logging.o core/SamplingWithReplacement.o core/Training.o +OBJECTS = interpret_R.o $(COREDIR)/DataSetByFeature.o $(COREDIR)/DataSetByFeatureCombination.o $(COREDIR)/InteractionDetection.o $(COREDIR)/Logging.o $(COREDIR)/SamplingWithReplacement.o $(COREDIR)/Training.o