-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add R builds for RHEL 9 #133
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
FROM rockylinux:9 | ||
|
||
ENV OS_IDENTIFIER rhel-9 | ||
|
||
RUN dnf -y upgrade \ | ||
&& dnf -y install dnf-plugins-core \ | ||
&& dnf config-manager --set-enabled crb \ | ||
&& dnf install -y epel-release \ | ||
&& dnf -y install \ | ||
autoconf \ | ||
automake \ | ||
bzip2-devel \ | ||
cairo-devel \ | ||
gcc-c++ \ | ||
gcc-gfortran \ | ||
java-11-openjdk-devel \ | ||
libICE-devel \ | ||
libSM-devel \ | ||
libX11-devel \ | ||
libXmu-devel \ | ||
libXt-devel \ | ||
libcurl-devel \ | ||
libicu-devel \ | ||
libjpeg-devel \ | ||
libpng-devel \ | ||
libtiff-devel \ | ||
libtool \ | ||
make \ | ||
ncurses-devel \ | ||
pango-devel \ | ||
pcre-devel \ | ||
pcre2-devel \ | ||
readline-devel \ | ||
rpm-build \ | ||
ruby \ | ||
ruby-devel \ | ||
tcl-devel \ | ||
tex \ | ||
texinfo-tex \ | ||
texlive-collection-latexrecommended \ | ||
tk-devel \ | ||
unzip \ | ||
valgrind-devel \ | ||
which \ | ||
wget \ | ||
xz-devel \ | ||
zlib-devel \ | ||
&& dnf clean all | ||
|
||
# Install AWS CLI | ||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ | ||
unzip awscliv2.zip && \ | ||
./aws/install && \ | ||
rm -rf aws awscliv2.zip | ||
|
||
RUN gem install fpm | ||
|
||
RUN chmod 0777 /opt | ||
|
||
# Configure flags for RHEL 9 that don't use the defaults in build.sh | ||
ENV CONFIGURE_OPTIONS="\ | ||
--enable-R-shlib \ | ||
--with-tcltk \ | ||
--enable-memory-profiling \ | ||
--with-x \ | ||
--with-system-valgrind-headers \ | ||
--with-tcl-config=/usr/lib64/tclConfig.sh \ | ||
--with-tk-config=/usr/lib64/tkConfig.sh \ | ||
--enable-prebuilt-html" | ||
|
||
# RHEL 9 doesn't have the inconsolata font, so override the defaults. | ||
# This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora. | ||
# Or check `dnf provides '*/inconsolata.sty'` for a package that provides it. | ||
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals | ||
ENV R_RD4PDF="times,hyper" | ||
|
||
# Make sure that patching Java does not break R. | ||
# R's default JAVA_HOME path includes the exact Java version on CentOS/RHEL, which | ||
# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the | ||
# major version symlink to avoid this. | ||
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support | ||
# https://solutions.rstudio.com/r/using-rjava/ | ||
ENV JAVA_HOME=/usr/lib/jvm/jre-11-openjdk | ||
|
||
# R 3.x requires PCRE2 for Pango support on RHEL 9 | ||
ENV INCLUDE_PCRE2_IN_R_3 yes | ||
|
||
COPY package.rhel-9 /package.sh | ||
COPY build.sh . | ||
ENTRYPOINT ./build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
if [[ ! -d /tmp/output/rhel-9 ]]; then | ||
mkdir -p /tmp/output/rhel-9 | ||
fi | ||
|
||
# R 3.x requires PCRE1 | ||
pcre_lib='pcre2-devel' | ||
if [[ "${R_VERSION}" =~ ^3 ]]; then | ||
pcre_lib='pcre-devel' | ||
fi | ||
|
||
# Create post-install script required for OpenBLAS. | ||
# | ||
# On RHEL and SUSE, we link R against the internal shared BLAS to make the | ||
# R binaries more portable and allow users to switch BLAS implementations without | ||
# having to recompile R. We default to OpenBLAS, but users may prefer other implementations. | ||
# | ||
# Binary packages built against the shared BLAS are also more portable and may be used | ||
# with the default R distributed by RHEL/SUSE, or other R installations using | ||
# shared BLAS and configured with a different BLAS (such as Microsoft R Open with MKL). | ||
# This is especially important for RSPM's binary packages. | ||
# | ||
# On Ubuntu/Debian, we link R against the external BLAS instead (--with-blas/--with-lapack), | ||
# as those distributions use the alternatives system to swap BLAS libraries at runtime. | ||
# The default R distributions on Ubuntu/Debian use the external BLAS, so we do as well | ||
# for portability. | ||
# | ||
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Shared-BLAS | ||
cat <<EOF >> /post-install.sh | ||
mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep | ||
ln -s /usr/lib64/libopenblasp.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so | ||
EOF | ||
|
||
# Create after-remove script to remove internal BLAS, which won't be cleaned up automatically. | ||
cat <<EOF >> /after-remove.sh | ||
if [ -d /opt/R/${R_VERSION} ]; then | ||
rm -r /opt/R/${R_VERSION} | ||
fi | ||
EOF | ||
|
||
fpm \ | ||
-s dir \ | ||
-t rpm \ | ||
-v 1 \ | ||
-n "R-${R_VERSION}" \ | ||
--vendor "RStudio, PBC" \ | ||
--url "https://www.r-project.org" \ | ||
--description "GNU R statistical computation and graphics system" \ | ||
--maintainer "RStudio, PBC <https://github.com/rstudio/r-builds>" \ | ||
--license "GPLv2+" \ | ||
--after-install /post-install.sh \ | ||
--after-remove /after-remove.sh \ | ||
-p /tmp/output/rhel-9/ \ | ||
-d bzip2-devel \ | ||
-d gcc \ | ||
-d gcc-c++ \ | ||
-d gcc-gfortran \ | ||
-d libcurl-devel \ | ||
-d libicu-devel \ | ||
-d libSM \ | ||
-d libtiff \ | ||
-d libXmu \ | ||
-d libXt \ | ||
-d make \ | ||
-d openblas-devel \ | ||
-d pango \ | ||
-d ${pcre_lib} \ | ||
-d tcl \ | ||
-d tk \ | ||
-d unzip \ | ||
-d which \ | ||
-d xz-devel \ | ||
-d zip \ | ||
-d zlib-devel \ | ||
"/opt/R/${R_VERSION}" | ||
|
||
export PKG_FILE=$(ls /tmp/output/rhel-9/R-${R_VERSION}*.rpm | head -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelmayer2 I've added some docs to explain how we configure BLAS here (#132)
I'll add a similar comment to the openSUSE 15.4 build as well. I didn't copy these over to the previous CentOS versions since we usually just add new platforms based off the most recent version of that distro.