<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>examples/bzlmod/cross_compile/LLVM_Troubleshooting.md - fork/rules_rust @ patching</title>
<meta name="description" content="examples/bzlmod/cross_compile/LLVM_Troubleshooting.md in fork/rules_rust at patching.">
<meta property="og:title" content="examples/bzlmod/cross_compile/LLVM_Troubleshooting.md - fork/rules_rust @ patching">
<meta property="og:description" content="examples/bzlmod/cross_compile/LLVM_Troubleshooting.md in fork/rules_rust at patching.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="patching" data-tip="285c36a623da1fba565098c0a65746ca7a2f7ebf">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/rules_rust</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/rules_rust</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Marvin Hansen</span><span class="commit-message" data-commit="c177ccc1a75b11badd984c01e51e61c840c572d8">Bazelmod documentation and code examples. (#2713)</span><span class="snapshot-sha sha" data-commit="c177ccc1a75b11badd984c01e51e61c840c572d8">c177ccc1</span><time datetime="2024-07-12T20:31:00+08:00" title="2024-07-12 20:31:00 +0800">2024-07-12</time></p>
<header class="topbar"><details class="switcher"><summary>patching</summary><div class="menu"><strong>branches</strong><a href="/fork/rules_rust/ref/cleanup/">cleanup</a><a href="/fork/rules_rust/ref/gh-pages/">gh-pages</a><a href="/fork/rules_rust/ref/main/">main</a><a class="current" href="/fork/rules_rust/ref/patching/">patching</a><a href="/fork/rules_rust/ref/rust-analyzer/">rust-analyzer</a><strong>tags</strong><a href="/fork/rules_rust/ref/0.10.0/">0.10.0</a><a href="/fork/rules_rust/ref/0.11.0/">0.11.0</a><a href="/fork/rules_rust/ref/0.5.0/">0.5.0</a><a href="/fork/rules_rust/ref/0.6.0/">0.6.0</a><a href="/fork/rules_rust/ref/0.7.0/">0.7.0</a><a href="/fork/rules_rust/ref/0.8.0/">0.8.0</a><a href="/fork/rules_rust/ref/0.8.1/">0.8.1</a><a href="/fork/rules_rust/ref/0.9.0/">0.9.0</a><a class="all" href="/fork/rules_rust/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/rules_rust/">rules_rust</a> / <a href="/fork/rules_rust/ref/patching/tree/examples/">examples</a> / <a href="/fork/rules_rust/ref/patching/tree/examples/bzlmod/">bzlmod</a> / <a href="/fork/rules_rust/ref/patching/tree/examples/bzlmod/cross_compile/">cross_compile</a> / <span class="cur">LLVM_Troubleshooting.md</span></nav>
<span class="view-stats"><span>1.6 KiB</span><span>29 lines</span></span><span class="actions"><a class="raw" href="/fork/rules_rust/raw/56c11c87e08afc7bf480cfcee4597bc847f3b083/examples/bzlmod/cross_compile/LLVM_Troubleshooting.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h3>LLVM Troubleshooting</h3>
<p>On older linux distributions (Ubuntu 16.04) you may encounter an error that C++ versions before C++ 14 are no longer
supported. In this case, just install gcc version 7 or newer. This is rare corner case, but there are gcc backports for
older distributions, so please upgrade your compiler if you ever see this error.</p>
<p>On Ubuntu 20.04 you may see an error that a shared library called libtinfo.so.5 is missing. In that case, just install
libtinfo via apt-get since its in the official 20.04 repo. To so, open a terminal and type:</p>
<p><code>apt update &amp;&amp; apt install -y libtinfo5</code></p>
<p>The libtinfo5 library may have different package names on other distributions, but it is a well known
issue. <a href="https://stackoverflow.com/questions/48674104/clang-error-while-loading-shared-libraries-libtinfo-so-5-cannot-open-shared-o">See this SO discussion</a>
for various solutions.</p>
<p>On MacOX, it is sufficient to have the Apple Clang compiler installed.
I don't recommend installing the full Xcode package unless you're developing software for an Apple device. Instead, the
Xcode Command Line Tools provide everything you need at a much smaller download size. In most cases, a simple:</p>
<p><code>xcode-select --install</code></p>
<p>From a terminal triggers the installation process. For details and alternative
options, <a href="https://www.freecodecamp.org/news/install-xcode-command-line-tools/">read this article on freebootcamp.</a></p>
<p>Windows is not directly supported, but you can use Linux on Windows with WSL to setup an Ubuntu environment within
Windows. Please refer to
the <a href="https://learn.microsoft.com/en-us/windows/wsl/install">official WSL documentation for details.</a></p>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>###</a-p> <a-tt>LLVM Troubleshooting</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">On older linux distributions (Ubuntu 16.04) you may encounter an error that C++ versions before C++ 14 are no longer</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">supported. In this case, just install gcc version 7 or newer. This is rare corner case, but there are gcc backports for</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">older distributions, so please upgrade your compiler if you ever see this error.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">On Ubuntu 20.04 you may see an error that a shared library called libtinfo.so.5 is missing. In that case, just install</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text">libtinfo via apt-get since its in the official 20.04 repo. To so, open a terminal and type:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">`</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text">apt update &amp;&amp; apt install -y libtinfo5</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">`</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">The libtinfo5 library may have different package names on other distributions, but it is a well known</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">issue. [See this SO discussion](https://stackoverflow.com/questions/48674104/clang-error-while-loading-shared-libraries-libtinfo-so-5-cannot-open-shared-o)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">for various solutions.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">On MacOX, it is sufficient to have the Apple Clang compiler installed.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text">I don&#39;t recommend installing the full Xcode package unless you&#39;re developing software for an Apple device. Instead, the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text">Xcode Command Line Tools provide everything you need at a much smaller download size. In most cases, a simple:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text">`xcode-select --install`</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text">From a terminal triggers the installation process. For details and alternative</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text">options, [read this article on freebootcamp.](https://www.freecodecamp.org/news/install-xcode-command-line-tools/)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text">Windows is not directly supported, but you can use Linux on Windows with WSL to setup an Ubuntu environment within</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text">Windows. Please refer to</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text">the [official WSL documentation for details.](https://learn.microsoft.com/en-us/windows/wsl/install)</span></span></pre></div></div>
</main>
</body>
</html>
