Skip to content

Instantly share code, notes, and snippets.

@mikemahoney218
Forked from gaborcsardi/Dockerfile
Created October 7, 2022 01:21
Show Gist options
  • Save mikemahoney218/0f103b3ac7705b25010d36bbace74af9 to your computer and use it in GitHub Desktop.
Save mikemahoney218/0f103b3ac7705b25010d36bbace74af9 to your computer and use it in GitHub Desktop.
Dockerfile for R-devel with clang 15 and libc++-15
FROM tuxmake/clang-15
RUN apt-get update -y ; apt-get install -y curl
RUN curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux-latest.tar.gz | tar xz -C /usr/local
RUN rig add devel
RUN mkdir ~/.R
RUN apt-get install -y libc++abi-15-dev libc++-15-dev
RUN printf 'CC = clang\nCXX = clang++ -stdlib=libc++\nCXX11 = clang++ -stdlib=libc++\nCXX14 = clang++ -stdlib=libc++\nCXX17 = clang++ -stdlib=libc++\nCXX20 = clang++ -stdlib=libc++\n' > ~/.R/Makevars
RUN flags="-O2 -g -Wunneeded-internal-declaration -Winvalid-utf8 -Wformat -Wsizeof-pointer-div -Wliteral-conversion -Wempty-body -Wreturn-stack-address -Wnon-c-typedef-for-linkage"; \
echo "CFLAGS=$flags" >> ~/.R/Makevars; \
echo "CXXFLAGS=$flags" >> ~/.R/Makevars; \
echo "CXX11FLAGS=$flags" >> ~/.R/Makevars; \
echo "CXX14FLAGS=$flags" >> ~/.R/Makevars; \
echo "CXX17FLAGS=$flags" >> ~/.R/Makevars; \
echo "CXX20FLAGS=$flags" >> ~/.R/Makevars
RUN apt-get install -y git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment