## With Rcpp 0.11.0 and later, we no longer need to set PKG_LIBS as there is
## no user-facing library. The include path to headers is already set by R.
#PKG_LIBS = 

# RcppParallel
PKG_LIBS = $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")

# OpenMP
PKG_CXXFLAGS += $(SHLIB_OPENMP_CXXFLAGS) 
#..# PKG_CXXFLAGS += -fopenmp 
PKG_LIBS += $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS += -fopenmp 

# Beachmat
# PKG_LIBS += `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(BEACHMAT_LIBS)
#..# PKG_LIBS += `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(FLIBS) $(BEACHMAT_LIBS)

# # omp
#..# KG_CFLAGS = $(SHLIB_OPENMP_FFLAGS)
#..# PKG_LIBS += $(SHLIB_OPENMP_CFLAGS)

# Blas i Lapack
PKG_LIBS += $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 

# RHDF5
RHDF5_LIBS = $(shell echo 'Rhdf5lib::pkgconfig("PKG_CXX_LIBS")'|\
    "${R_HOME}/bin/R" --vanilla --slave)  
PKG_LIBS += $(RHDF5_LIBS)

## With R 3.1.0 or later, you can uncomment the following line to tell R to 
## enable compilation with C++11 (or even C++14) where available
CXX_STD = CXX11

#..#CXXFLAGS = -g3 -O3 -Wall
# CXXFLAGS += -g3 -O3 -std=c++11 -Wall
