Use ifdefs to distinguish R and Python compiles. Use RcppArmadillo for R builds and plain armadillo for python builds.
Give a compile time choice of floats versus doubles. This affects armadillo apis (fmat vs. mat) and also all functions that current return floats rather than doubles.