diff --git a/builder/Dockerfile.fedora-gcc15 b/builder/Dockerfile.fedora-gcc15 new file mode 100644 index 0000000..1eeb622 --- /dev/null +++ b/builder/Dockerfile.fedora-gcc15 @@ -0,0 +1,89 @@ + +FROM fedora:42 + +ENV OS_IDENTIFIER fedora-42 + +RUN dnf -y upgrade \ + && dnf -y install dnf-plugins-core \ + && dnf -y install \ + autoconf \ + automake \ + bzip2-devel \ + cairo-devel \ + gcc \ + g++ \ + gfortran \ + java-21-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 \ + tcl-devel \ + tex \ + texinfo-tex \ + texlive-collection-latexrecommended \ + tk-devel \ + unzip \ + valgrind-devel \ + which \ + wget \ + xz-devel \ + zlib-devel \ + && dnf clean all + +RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch + +RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \ + dnf install -y "nfpm_$(cat /tmp/arch).rpm" && \ + rm "nfpm_$(cat /tmp/arch).rpm" + +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.posit.co/envs-pkgs/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 builder/config.fedora-gcc /config.site +COPY builder/config.fedora-gcc.aarch64 /config.site.aarch64 + +COPY builder/package.fedora-gcc /package.sh +COPY build.sh . +ENTRYPOINT ./build.sh diff --git a/containers/gcc15/Dockerfile b/containers/gcc15/Dockerfile new file mode 100644 index 0000000..e279cc1 --- /dev/null +++ b/containers/gcc15/Dockerfile @@ -0,0 +1,120 @@ + +FROM fedora:42 + +# ------------------------------------------------------------------------------------ +# Install pre-built R and requirements + +RUN dnf -y upgrade && \ + dnf -y install dnf-plugins-core && \ + dnf -y install curl && \ + curl -LO "https://github.com/r-hub/containers/releases/download/latest/R-rstudio-fedora-40-devel-gcc15-1-1.$(arch).rpm" && \ + yum install -y R-*.rpm && \ + rm R-*.rpm + +# Extra system packages that pak does not know about +RUN dnf install -y flexiblas +RUN dnf install -y https://rpms.r-pkg.org/fedora-38/jags-4.3.2-1.$(arch).rpm + +# ------------------------------------------------------------------------------------ +# Put R on PATH +# AUto-install system requirements + +ENV PATH="/opt/R/devel-gcc15/bin:${PATH}" +ENV PKG_SYSREQS=true +ENV R_PKG_SYSREQS2=true + +# ------------------------------------------------------------------------------------ +# Set CRAN repo, no P3M for Fedora + +RUN echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' \ + >> /opt/R/devel-gcc15/lib/R/library/base/R/Rprofile + +RUN if [ "$(arch)" = "x86_64" ]; then \ + . /etc/os-release; \ + RVER=$(R -s -e 'cat(paste(getRversion()[,1:2]))'); \ + echo "options(repos = c(RHUB = 'https://raw.githubusercontent.com/r-hub/repos/main/${ID}-${VERSION_ID}/${RVER}', getOption('repos')))" \ + >> /opt/R/devel-gcc15/lib/R/library/base/R/Rprofile; \ + echo 'options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))' \ + >> /opt/R/devel-gcc15/lib/R/library/base/R/Rprofile; \ + fi + +# ------------------------------------------------------------------------------------ +# Install pak + +RUN /opt/R/devel-gcc15/bin/R -q -e \ + 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "devel", .Platform$pkgType, R.Version()$os, R.Version()$arch))' + +# ------------------------------------------------------------------------------------ +# Locale + +RUN dnf install -y glibc-langpack-en + +ENV LC_ALL en_GB.UTF-8 +ENV LANG en_GB.UTF-8 + +# ------------------------------------------------------------------------------------ +# Use user's package library for the rest + +RUN /opt/R/devel-gcc15/bin/R -q -e 'dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' + +# ------------------------------------------------------------------------------------ +# Copy check script + +COPY r-check /usr/local/bin + +# ------------------------------------------------------------------------------------ +# Useful system packages + +RUN dnf -y install pkg-config devscripts-checkbashisms qpdf git tidy + +# ------------------------------------------------------------------------------------ +# CRAN's config from https://www.stats.ox.ac.uk/pub/bdr/gcc14/README.txt + +ENV _R_CHECK_INSTALL_DEPENDS_ true +## the next is the default, but --as-cran has true +ENV _R_CHECK_SUGGESTS_ONLY_ false +ENV _R_CHECK_NO_RECOMMENDED_ true +ENV _R_CHECK_DOC_SIZES2_ true +ENV _R_CHECK_DEPRECATED_DEFUNCT_ true +ENV _R_CHECK_SCREEN_DEVICE_ warn +ENV _R_CHECK_REPLACING_IMPORTS_ true +ENV _R_CHECK_TOPLEVEL_FILES_ true +ENV _R_CHECK_DOT_FIRSTLIB_ true +ENV _R_CHECK_RD_LINE_WIDTHS_ true +ENV _R_CHECK_S3_METHODS_NOT_REGISTERED_ true +ENV _R_CHECK_OVERWRITE_REGISTERED_S3_METHODS_ true +ENV _R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_ TRUE +ENV _R_CHECK_NATIVE_ROUTINE_REGISTRATION_ true +ENV _R_CHECK_FF_CALLS_ registration +ENV _R_CHECK_PRAGMAS_ true +ENV _R_CHECK_COMPILATION_FLAGS_ true +ENV _R_CHECK_R_DEPENDS_ true +ENV _R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_ true +ENV _R_CHECK_PKG_SIZES_ false +ENV _R_CHECK_SHLIB_OPENMP_FLAGS_ true + +ENV _R_CHECK_LIMIT_CORES_ true +ENV _R_CHECK_LENGTH_1_CONDITION_ package:_R_CHECK_PACKAGE_NAME_,verbose +#ENV _R_CHECK_LENGTH_1_LOGIC2_="package:_R_CHECK_PACKAGE_NAME_,verbose" +ENV _R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_ true +ENV _R_CHECK_COMPILATION_FLAGS_KNOWN_="-Wno-deprecated-declarations -Wno-ignored-attributes -Wno-parentheses -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -Werror=implicit-function-declaration" +ENV _R_CHECK_AUTOCONF_ true +ENV _R_CHECK_THINGS_IN_CHECK_DIR_ true +ENV _R_CHECK_THINGS_IN_TEMP_DIR_ true +ENV _R_CHECK_THINGS_IN_TEMP_DIR_EXCLUDE_="^ompi" +ENV _R_CHECK_BASHISMS_ true +ENV _R_CHECK_DEPENDS_ONLY_DATA_ true +ENV _R_CHECK_MATRIX_DATA_ TRUE +ENV _R_CHECK_RD_VALIDATE_RD2HTML_ true +ENV _R_CHECK_RD_MATH_RENDERING_ true + +# ------------------------------------------------------------------------------------ +# Check config, no need to check the PDF manual and vignettes here. +# We also avoid that bashism checks, as it needs external tools. + +ENV _R_CHECK_TESTS_NLINES_="0" +ENV CHECK_ARGS="--no-manual --no-build-vignettes" +ENV _R_CHECK_BASHISMS_=false + +# Support R CMD INSTALL --use-LTO ., similarly to CRAN at https://www.stats.ox.ac.uk/pub/bdr/LTO/README.txt +RUN echo -e '# Support --use-LTO\nLTO_OPT = -flto=10\nLTO_FC_OPT = -flto=10' >> /opt/R/devel-gcc15/lib/R/etc/Makeconf diff --git a/containers/gcc15/r-check b/containers/gcc15/r-check new file mode 100755 index 0000000..898ce4e --- /dev/null +++ b/containers/gcc15/r-check @@ -0,0 +1,18 @@ +#! /bin/bash +set -e + +checkdir=${1-/check} + +do_check () { + pkg=${1} + echo Checking "$pkg" + ( + cd `dirname $pkg` + R -q -e "pak::pkg_install('deps::$pkg', dependencies = TRUE)" + R CMD check $CHECK_ARGS $pkg + ) +} + +for pkg in `ls $checkdir/*.tar.gz`; do + do_check "$pkg" +done diff --git a/docker-compose.yml b/docker-compose.yml index 1055423..e8f5a8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -120,6 +120,20 @@ services: volumes: - ./integration/tmp:/tmp/output + fedora-gcc15: + platform: linux/amd64 + command: ./build.sh + environment: + - R_VERSION=devel + - R_TYPE=-gcc15 + - LOCAL_STORE=/tmp/output + build: + context: . + dockerfile: builder/Dockerfile.fedora-gcc15 + image: rhub/fedora-gcc15:latest + volumes: + - ./integration/tmp:/tmp/output + fedora-mkl: platform: linux/amd64 command: ./build.sh