# ---
# Compile pkg with icc to have loops nicely vectorized
# MAKEFLAGS="CC=icc SHLIB_LD=icc CFLAGS=-vec-report" R CMD INSTALL --preclean pkg-gldist

# ---
# Profile code with google-perftools
# MAKEFLAGS="LDFLAGS=-lprofiler CFLAGS=" R CMD INSTALL --preclean pkg-gldist
# env CPUPROFILE=./gldist.prof R
# pprof --pdf pkg-gldist/src/gldist.so gldist.prof  > gldist.pdf
# pprof --text pkg-gldist/src/gldist.so gldist.prof  > gldist.txt
# NOTE : can focus on particular functions with --focus=do_qgl
# NOTE : create kcachgrind file with 'pprof --callgrind pkg-gldist/src/gldist.so gldist.prof > gldist.callgrind'
