Skip to content
Prev 6141 / 12125 Next

[R-pkg-devel] C++ library USING_R

Apologies for the mis-directed reply, and, imprecise syntax/context re 
environment variable.

Just to close the loop, it seems that using a -D macro assignment inside 
the make command (macro?) is interpreted as a make option:

$(LIBEDM):
 ??? @(cd $(CPPEDM_SRC_PATH) && $(MAKE) clean && $(MAKE) \
 ??? CXX="$(CXX11) $(CXX11STD)" CXXFLAGS="$(CXX11FLAGS) $(CXX11PICFLAGS)" \
 ??? AR="$(AR)" RANLIB="$(RANLIB)" -DUSING_R=1)

...

 ?? make[1]: Entering directory 
'/tmp/RtmpxVmJkT/Rbuild1553f22c7484d/rEDM/src/cppEDM/src'
 ?? rm -f API.o CCM.o Common.o DateTime.o EDM.o EDM_Formatting.o 
EDM_Neighbors.o Eval.o Multiview.o Parameter.o Simplex.o SMap.o libEDM.a
 ?? make[1]: Leaving directory 
'/tmp/RtmpxVmJkT/Rbuild1553f22c7484d/rEDM/src/cppEDM/src'
 ?? make: invalid option -- 'D'

Hmm... since I use an R-specific makefile inside the C++ library 
directory anyway, adding -DUSING_R there seems like a decent solution.

Thanks a-million for the support & guidance to get me to the obvious 
solution!

J Park
On 10/15/20 8:17 AM, Dirk Eddelbuettel wrote: