Skip to content

Instantly share code, notes, and snippets.

@mratsim
Created March 20, 2017 17:37
Show Gist options
  • Select an option

  • Save mratsim/51d269490fd676d282815bb2641a1993 to your computer and use it in GitHub Desktop.

Select an option

Save mratsim/51d269490fd676d282815bb2641a1993 to your computer and use it in GitHub Desktop.
~/.R/Makevars to compile R package with OpenMP and all compiler optimizations
# ~/.R/Makevars
PKG_LIBS = -fopenmp -lgomp
PKG_CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS=-D_FORTIFY_SOURCE=2
CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
CXXFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS=-j8
#-- Debugging flags
DEBUG_CFLAGS=-g -fvar-tracking-assignments
DEBUG_CXXFLAGS=-g -fvar-tracking-assignments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment