Skip to content

Instantly share code, notes, and snippets.

@dantonnoriega
Created December 18, 2020 02:02
Show Gist options
  • Save dantonnoriega/060ed77ff10779f41540d99c516c5d5b to your computer and use it in GitHub Desktop.
Save dantonnoriega/060ed77ff10779f41540d99c516c5d5b to your computer and use it in GitHub Desktop.
Makevars for installing data.table on Big Sur + Apple Silicon (M1; ARM)
# brew --prefix llvm
LLVM_LOC=/usr/local/opt/llvm
# brew --prefix gettext
GETTEXT=/usr/local/opt/gettext
# xcrun --show-sdk-path
XCBASE=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CC=$(LLVM_LOC)/bin/clang -fopenmp
CXX=$(LLVM_LOC)/bin/clang++ -fopenmp
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
# more on flags https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
LDFLAGS=-L"$(LLVM_LOC)/lib" -L"$(GETTEXT)/lib" --sysroot="$(XCBASE)"
CPPFLAGS=-isystem "$(LLVM_LOC)/include" -isysroot "$(XCBASE)"
@dantonnoriega
Copy link
Author

Assumes you did the hacky arm homebrew install: https://soffes.blog/homebrew-on-apple-silicon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment