Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1ae810d 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Dec 15, 2024
1 parent f11c315 commit 97a1fc8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions r-admin/Installing-R-under-Unix-alikes.html
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ <h3 class="subsection anchored" data-number="2.7.4" data-anchor-id="c-standards"
</section>
<section id="link-time-optimization" class="level3 subsection page-columns page-full" data-number="2.7.5">
<h3 class="subsection anchored" data-number="2.7.5" data-anchor-id="link-time-optimization"><span class="header-section-number">2.7.5</span> Link-Time Optimization</h3>
<p>There is support for using link-time optimization (LTO) if the toolchain supports it: configure with flag <code>--enable-lto</code>. When LTO is enabled it is used for compiled code in add-on packages unless the flag <code>--enable-lto=R</code> is used<a href="#fn12" class="footnote-ref" id="fnref12" role="doc-noteref"><sup>12</sup></a>.</p>
<div class="no-row-height column-margin column-container"><div id="fn12"><p><sup>12</sup>&nbsp;Then recommended packages installed as part of the R installation do use LTO, but not packages installed later.</p></div><div id="fn13"><p><sup>13</sup>&nbsp;A complete CRAN installation reduced from 50 to 35GB.</p></div></div><p>The main benefit seen to date from LTO has been detecting long-standing bugs in the ways packages pass arguments to compiled code and between compilation units. Benchmarking in 2020 with <code>gcc</code>/<code>gfortran</code>&nbsp;10 showed gains of a few percent in increased performance and reduction in installed size for builds without debug symbols, but large size reductions for some packages<a href="#fn13" class="footnote-ref" id="fnref13" role="doc-noteref"><sup>13</sup></a> with debug symbols. (Performance and size gains are said to be most often seen in complex C++ builds.)</p>
<p>There is support for using link-time optimization (LTO) if the toolchain supports it: configure with flag <code>--enable-lto</code>. When LTO is enabled it is also used for compiled code in add-on packages unless the flag <code>--enable-lto=R</code> is used<a href="#fn12" class="footnote-ref" id="fnref12" role="doc-noteref"><sup>12</sup></a>.</p>
<div class="no-row-height column-margin column-container"><div id="fn12"><p><sup>12</sup>&nbsp;Then all add-on packages, including recommended packages are not installed with LTO.</p></div><div id="fn13"><p><sup>13</sup>&nbsp;A complete CRAN installation reduced from 50 to 35GB.</p></div></div><p>The main benefit seen to date from LTO has been detecting long-standing bugs in the ways packages pass arguments to compiled code and between compilation units. Benchmarking in 2020 with <code>gcc</code>/<code>gfortran</code>&nbsp;10 showed gains of a few percent in increased performance and reduction in installed size for builds without debug symbols, but large size reductions for some packages<a href="#fn13" class="footnote-ref" id="fnref13" role="doc-noteref"><sup>13</sup></a> with debug symbols. (Performance and size gains are said to be most often seen in complex C++ builds.)</p>
<p>Whether toolchains support LTO is often unclear: all of the C compiler, the Fortran compiler<a href="#fn14" class="footnote-ref" id="fnref14" role="doc-noteref"><sup>14</sup></a> and linker have to support it, and support it by the same mechanism (so mixing compiler families may not work and a non-default linker may be needed). It has been supported by the GCC and LLVM projects for some years with diverging implementations.</p>
<div class="no-row-height column-margin column-container"><div id="fn14"><p><sup>14</sup>&nbsp;although there is the possibility to exclude Fortran but that misses some of the benefits.</p></div></div><p>LTO support was added in 2011 for GCC&nbsp;4.5 on Linux but was little used before 2019: compiler support has steadily improved over those years and <code>--enable-lto=R</code> is nowadays used for some routine CRAN checking.</p>
<p>Unfortunately <code>--enable-lto</code> may be accepted but silently do nothing useful if some of the toolchain does not support LTO: this is less common than it once was.</p>
Expand All @@ -647,8 +647,8 @@ <h3 class="subsubsection anchored" data-number="2.7.6" data-anchor-id="lto-with-
<span id="cb33-5"><a href="#cb33-5" aria-hidden="true" tabindex="-1"></a><span class="dt">CXX17PICFLAGS</span><span class="ch">=</span><span class="st">-fPIC</span></span>
<span id="cb33-6"><a href="#cb33-6" aria-hidden="true" tabindex="-1"></a><span class="dt">CXX20PICFLAGS</span><span class="ch">=</span><span class="st">-fPIC</span></span>
<span id="cb33-7"><a href="#cb33-7" aria-hidden="true" tabindex="-1"></a><span class="dt">FPICFLAGS</span><span class="ch">=</span><span class="st">-fPIC</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>We suggest only using these if the problem is encountered (it had not been seen on CRAN with GCC 10–14 at the time of writing).</p>
<p>Note that R may need to be re-compiled after even a minor update to the compiler (e.g.&nbsp;from 13.1 to 13.2).</p>
<p>We suggest only using these if the problem is encountered (it had not been seen on CRAN with GCC 10–15 at the time of writing).</p>
<p>Note that R will usually need to be re-compiled after even a minor update to the compiler (e.g.&nbsp;from 13.1 to 13.2).</p>
</section>
<section id="lto-with-llvm" class="level3 subsubsection" data-number="2.7.7">
<h3 class="subsubsection anchored" data-number="2.7.7" data-anchor-id="lto-with-llvm"><span class="header-section-number">2.7.7</span> LTO with LLVM</h3>
Expand Down
4 changes: 2 additions & 2 deletions r-admin/Platform-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ <h3 class="subsection anchored" data-number="C.3.8" data-anchor-id="tcltk-header
</section>
<section id="java" class="level3 subsection page-columns page-full" data-number="C.3.9">
<h3 class="subsection anchored" data-number="C.3.9" data-anchor-id="java"><span class="header-section-number">C.3.9</span> Java</h3>
<p>macOS does not comes with an installed Java runtime (JRE) and a macOS upgrade may remove one if already installed: it is intended to be installed at first use. Check if a JRE is installed by running <code>java -version</code> in a <code>Terminal</code> window: if Java is not installed on an Intel Mac this may prompt you to install it. We recommend you install a version with long-term support, e.g.&nbsp;17 or 21<a href="#fn21" class="footnote-ref" id="fnref21" role="doc-noteref"><sup>21</sup></a> but not 18–20, 22–24 with a 6-month lifetime.</p>
<div class="no-row-height column-margin column-container"><div id="fn21"><p><sup>21</sup>&nbsp;The planned nextLTS release is 25 in September 2025. Java 8 <em>aka</em> 1.8.0 is still LTS but some packages require 11 or later.</p></div><div id="fn22"><p><sup>22</sup>&nbsp;which website works with Safari but not some other browsers.</p></div></div><p>The currently simplest way to install Java is from <a href="https://adoptium.net">Adoptium</a><a href="#fn22" class="footnote-ref" id="fnref22" role="doc-noteref"><sup>22</sup></a>: this installs into an Apple-standard location and so works with <code>/usr/bin/java</code>. Other builds are available from <a href="https://www.azul.com/downloads/zulu-community/?os=macos&amp;architecture=arm-64-bit&amp;package=jdk" class="uri">https://www.azul.com/downloads/zulu-community/?os=macos&amp;architecture=arm-64-bit&amp;package=jdk</a> and from OpenJDK at <a href="https://jdk.java.net/" class="uri">https://jdk.java.net/</a>, for which <code>JAVA_HOME</code> may need to be set both when configuring R and at runtime. Note that Java distribution sites may use unusual designations for macOS CPUs such as <code>AArch64</code>, <code>x64</code> or <code>x86 64-bit</code>.</p>
<p>macOS does not comes with an installed Java runtime (JRE) and a macOS upgrade may remove one if already installed: it is intended to be installed at first use. Check if a JRE is installed by running <code>java -version</code> in a <code>Terminal</code> window: if Java is not installed this may prompt you to install it from Oracle<a href="#fn21" class="footnote-ref" id="fnref21" role="doc-noteref"><sup>21</sup></a> (but see the next paragraph). We recommend you install a version with long-term support, e.g.&nbsp;17 or 21<a href="#fn22" class="footnote-ref" id="fnref22" role="doc-noteref"><sup>22</sup></a> but not 18–20, 22–24 with a 6-month lifetime.</p>
<div class="no-row-height column-margin column-container"><div id="fn21"><p><sup>21</sup>&nbsp;Oracle Java has a restrictive licence, unlike distributions based on OpenJDK.</p></div><div id="fn22"><p><sup>22</sup>&nbsp;The planned nextLTS release is 25 in September 2025. Java 8 <em>aka</em> 1.8.0 is still LTS but some packages require 11 or later.</p></div><div id="fn23"><p><sup>23</sup>&nbsp;which website works with Safari but not some other browsers.</p></div></div><p>The currently simplest way to install Java is from <a href="https://adoptium.net">Adoptium</a><a href="#fn23" class="footnote-ref" id="fnref23" role="doc-noteref"><sup>23</sup></a>: this installs into an Apple-standard location and so works with <code>/usr/bin/java</code>. Other builds of OpenJDK are available from <a href="https://www.azul.com/downloads/zulu-community/?os=macos&amp;architecture=arm-64-bit&amp;package=jdk" class="uri">https://www.azul.com/downloads/zulu-community/?os=macos&amp;architecture=arm-64-bit&amp;package=jdk</a> and from OpenJDK at <a href="https://jdk.java.net/" class="uri">https://jdk.java.net/</a>, for which <code>JAVA_HOME</code> may need to be set both when configuring R and at runtime. Note that Java distribution sites may use unusual designations for macOS CPUs such as <code>AArch64</code>, <code>x64</code> or <code>x86 64-bit</code>.</p>
<p>Binary distributions of R are built against a specific version (e.g. 11.0.18 or 17.0.1) of Java so</p>
<div class="sourceCode" id="cb37"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> R CMD javareconf</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>will likely be needed to be run before using Java-using packages.</p>
Expand Down
Loading

0 comments on commit 97a1fc8

Please sign in to comment.