<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RADseq genomics in R • assigner</title>
<!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="RADseq genomics in R">
<meta property="og:description" content="assigner">
<meta property="og:image" content="/logo.png">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
    <div class="container template-article">
      <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">assigner</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.8</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
<li>
  <a href="../index.html">Installation</a>
</li>
<li>
  <a href="../FEATURES.html">Features</a>
</li>
<li>
  <a href="../articles/get_started.html">Get started</a>
</li>
<li>
  <a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
<li>
      <a href="../articles/get_started.html">Get started</a>
    </li>
    <li>
      <a href="../articles/fst_confidence_intervals.html">Fst analysis</a>
    </li>
    <li>
      <a href="../articles/web_only/fst_comparisons.html">Comparisons of Fst in 8 packages/software</a>
    </li>
    <li>
      <a href="../articles/assignment.whitelists.html">Using whitelists in assignment</a>
    </li>
    <li>
      <a href="../articles/rad_genomics_computer_setup.html">Computer setup - Installation - Troubleshooting</a>
    </li>
    <li>
      <a href="../articles/life_cycle.html">Life cycle</a>
    </li>
  </ul>
</li>
<li>
  <a href="../news/index.html">News</a>
</li>
      </ul>
<ul class="nav navbar-nav navbar-right">
<li>
  <a href="https://github.com/thierrygosselin/assigner">
    <span class="fa fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
</div>
<!--/.nav-collapse -->
  </div>
<!--/.container -->
</div>
<!--/.navbar -->

      

      </header><script src="rad_genomics_computer_setup_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
  <div class="col-md-9 contents">
    <div class="page-header toc-ignore">
      <h1 data-toc-skip>RADseq genomics in R</h1>
            <h3 class="subtitle">computer setup</h3>
            
            <h4 class="date">2020-10-26</h4>
      
      <small class="dont-index">Source: <a href="https://github.com/thierrygosselin/assigner/blob/master/vignettes/rad_genomics_computer_setup.Rmd"><code>vignettes/rad_genomics_computer_setup.Rmd</code></a></small>
      <div class="hidden name"><code>rad_genomics_computer_setup.Rmd</code></div>

    </div>

    
    
<p><strong>Time to allow: ETA ~20 min</strong></p>
<p>This vignette purposes is to show users how to setup their computers for RADseq genomic analysis inside R. It targets users of my packages or workshops.</p>
<p>The vignette as an <code>Installation problems</code> section, browse through it if your experiencing installation issues.</p>
<p>The vignette is also usefull if your:</p>
<ul>
<li>conducting imputations</li>
<li>using simulations with <code>grur</code> and it’s dependencies or simulations with <code>strataG</code>.</li>
<li>specific installation instructions for:</li>
<li><code>rmetasim</code></li>
<li><code>XGBoost</code></li>
<li><code>LightGBM</code></li>
<li><code>randomForestSRC</code></li>
<li><code>ranger</code></li>
<li><code>missRanger</code></li>
<li><code>pcaMethods</code></li>
<li>how to <strong>OpenMP enabled</strong> specific packages that require to run in parallel for the imputations.</li>
</ul>
<p>I’m currently merging information also found in this <a href="http://gbs-cloud-tutorial.readthedocs.io/en/latest/03_computer_setup.html">tutorial</a></p>
<div id="macos" class="section level1">
<h1 class="hasAnchor">
<a href="#macos" class="anchor"></a>macOS</h1>
<p><strong>Warning: package management software <em>Homebrew</em> and/or <em>MacPorts</em> :</strong> My experience with these packages is that at some point they will be unreliable with genomic software installation. It might do the trick for some software, but eventually you will loose a lot of time trying to figure out what’s your problem.</p>
<div id="update-your-os" class="section level2">
<h2 class="hasAnchor">
<a href="#update-your-os" class="anchor"></a>Update your OS</h2>
<ul>
<li>the current version is macOS Catalina 10.15</li>
<li><a href="http://support.apple.com/kb/HT1338?viewlocale=en_US&amp;locale=en_US">how to update</a></li>
</ul>
</div>
<div id="get-administrator-and-root-user-access" class="section level2">
<h2 class="hasAnchor">
<a href="#get-administrator-and-root-user-access" class="anchor"></a>Get administrator and root user access</h2>
<p>Make sure you have administrator and root user access to your computer <a href="https://support.apple.com/en-ca/HT204012">how</a>.</p>
</div>
<div id="apples-command-line-tools" class="section level2">
<h2 class="hasAnchor">
<a href="#apples-command-line-tools" class="anchor"></a>Apple’s Command Line Tools</h2>
<p>Make sure it’s installed…if not, follow instructions. Although the prompt message may be a bit confusing, just click <strong>install</strong>.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1"></a><span class="ex">xcode-select</span> --install</span></code></pre></div>
<p>In the finder using keyboard shorcut <code>cmd+shift+g</code> go to: <code>/Library/Developer/CommandLineTools/Packages/</code> and double click on <code>macOS_SDK_headers_for_macOS_10.14.pkg</code> to install.</p>
<p><strong>Notes:</strong></p>
<ul>
<li>If command line tools is already installed you’ll get this message <code>xcode-select: error: command line tools are already installed, use "Software Update" to install updates</code>
</li>
<li>to test if you have a compiler, you can also type: <code>make</code> in the terminal</li>
<li>
<code>./configure</code>: configure everything before installation</li>
<li>
<code>make</code>: connect libraries and the source before make install (<a href="http://www.gnu.org/software/make/manual/make.html">doc</a>)</li>
<li>
<code>make install</code>: use to build (compile) source code to create binary files and install the application on our system as configured using <code>./configure</code>, usually in <code>/usr/local/bin</code>.</li>
<li>
<a href="https://thoughtbot.com/blog/the-magic-behind-configure-make-make-install">Reading</a>: to understand the basic steps to install software with the terminal (<em>configure</em>, <em>make</em> and <em>sudo make install</em> steps)</li>
<li>for more <em>curl</em> option type <code>curl -h</code>
</li>
</ul>
</div>
<div id="compiler" class="section level2">
<h2 class="hasAnchor">
<a href="#compiler" class="anchor"></a>Compiler</h2>
<p>Apple can’t ship GNU <a href="http://en.wikipedia.org/wiki/Compiler">Compiler</a> Collection (GCC) with OpenMP enabled, similar story with <a href="http://en.wikipedia.org/wiki/Clang">Clang</a> the other compiler used in macOS. Consequently, both need to be updateed manually if you want to run software that ues parallel computing (like stacks).</p>
<p>The command below fro both GCC and Clang will:</p>
<ul>
<li>change directory to your downloads</li>
<li>download the compiler’s binaries</li>
<li>uncompress and move folders (<code>bin</code>, <code>include</code>, <code>lib</code>, <code>libexec</code> and <code>share</code>) of the compiler on your computer <code>/usr/local</code> directory.</li>
<li>remove the downloaded file</li>
<li>check the version of gcc</li>
</ul>
<div id="update-gcc" class="section level3">
<h3 class="hasAnchor">
<a href="#update-gcc" class="anchor"></a>Update GCC</h3>
<p>Choose the binary version number based on your OS and change the version accordingly <a href="http://hpc.sourceforge.net">link</a>.</p>
<p><strong>Catalina</strong> <a href="http://prdownloads.sourceforge.net/hpc/gcc-9.2-bin.tar.gz">gcc-9.2-bin.tar.gz</a> <strong>Mojave</strong> <a href="http://prdownloads.sourceforge.net/hpc/gcc-8.3-bin.tar.gz">gcc-8.3.tar.gz</a></p>
<div class="sourceCode" id="cb2"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1"></a><span class="co">#In Terminal</span></span>
<span id="cb2-2"><a href="#cb2-2"></a><span class="bu">cd</span> Downloads</span>
<span id="cb2-3"><a href="#cb2-3"></a><span class="fu">sudo</span> tar -zxvf gcc-9.2-bin.tar.gz -C /usr/local --strip-components=2</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1"></a><span class="fu">sudo</span> rm gcc-9.2-bin.tar.gz</span>
<span id="cb3-2"><a href="#cb3-2"></a><span class="fu">gcc</span> -v</span></code></pre></div>
</div>
<div id="update-clang" class="section level3">
<h3 class="hasAnchor">
<a href="#update-clang" class="anchor"></a>Update Clang</h3>
<p>We want <a href="https://en.wikipedia.org/wiki/Clang">clang</a> compiler with OpenMP enabled.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1"></a><span class="co">#In browser</span></span>
<span id="cb4-2"><a href="#cb4-2"></a><span class="ex">http</span>://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz</span>
<span id="cb4-3"><a href="#cb4-3"></a><span class="co">#In Terminal</span></span>
<span id="cb4-4"><a href="#cb4-4"></a><span class="bu">cd</span> Downloads</span>
<span id="cb4-5"><a href="#cb4-5"></a><span class="fu">sudo</span> tar -xzvf clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz -C/usr/local --strip-components=1</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1"></a><span class="fu">sudo</span> rm clang+llvm-9.0.0-x86_64-darwin-apple.tar.xz</span>
<span id="cb5-2"><a href="#cb5-2"></a><span class="fu">clang</span> -v</span></code></pre></div>
</div>
</div>
<div id="path" class="section level2">
<h2 class="hasAnchor">
<a href="#path" class="anchor"></a>PATH</h2>
<p>The shell start up script and PATH to programs**</p>
<p>To make things a little easier to talk to your computer, each time you open the <em>Terminal</em> a <a href="http://en.wikipedia.org/wiki/Bash_(Unix_shell)">shell start up scripts</a> tells your computer where to look for programs. The path for your programs can be modified in your shell start up script. When your computer is searching for programs, it looks into these <a href="http://en.wikipedia.org/wiki/PATH_(variable)">path</a>:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1"></a><span class="va">$PATH</span></span></code></pre></div>
<p>The output should look like this: <code>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</code>. But sometimes, it will also say: <code>No such file or directory</code> (no worries, see below).</p>
<p>Use the <code>pwd</code> command to know exactly where you are!</p>
<p>The name of the shell startup file differs across platforms. Depending on OS it is called <strong>~/.bash_profile</strong> and sometimes <strong>~/.profile</strong>. Filename beginning with a dot “.” are reserved for the system and are <strong>invisible</strong> in the mac Finder.</p>
<p>Find your shell start up script with the following command:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1"></a><span class="fu">ls</span> -al ~ <span class="kw">|</span> <span class="fu">grep</span> profile</span></code></pre></div>
<p>If this returns nothing (blank), you don’t have a shell start up script. Create one with this command</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1"></a><span class="fu">sudo</span> touch <span class="va">$HOME</span>/.bash_profile</span></code></pre></div>
<p>To modify, you can use <a href="http://www.barebones.com/products/bbedit/index.html">BBEdit</a> to open or make and modify hidden items (using the option <em>Show hidden items</em> on the open file screen). With Linux, use Vi!</p>
<p>Copy/paste the line below in your <code>.bash_profile</code> file:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1"></a><span class="va">PATH=</span><span class="st">"</span><span class="va">$PATH</span><span class="st">:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"</span></span></code></pre></div>
<p>After modifying your shell start up script always run the command <code>source ~/.bash_profile</code> to reload it.</p>
</div>
<div id="useful-tools" class="section level2">
<h2 class="hasAnchor">
<a href="#useful-tools" class="anchor"></a>Useful tools</h2>
<p>Below are useful but not essential software you will like to have on your mac.</p>
<div id="wget-utility" class="section level3">
<h3 class="hasAnchor">
<a href="#wget-utility" class="anchor"></a><a href="https://www.gnu.org/software/wget/">wget</a> utility</h3>
<p>This software is similar to curl that is already on your Mac, it’s also good to have it. This will help you save a lot of time in the future.</p>
<p><strong>Option 1: trouble-free install</strong></p>
<div class="sourceCode" id="cb10"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb10-2"><a href="#cb10-2"></a><span class="ex">curl</span> -O https://raw.githubusercontent.com/rudix-mac/packages/master/10.12/wget-1.18-0.pkg</span>
<span id="cb10-3"><a href="#cb10-3"></a><span class="co"># Go in your Downloads folder double-click on the wget file and follow the instructions</span></span></code></pre></div>
<p><strong>Option 2: from source</strong></p>
<p>Install <a href="http://www.gnutls.org">gnutls</a> dependency</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1"></a><span class="co"># for novice user: copy one line at a time in the Terminal:</span></span>
<span id="cb11-2"><a href="#cb11-2"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb11-3"><a href="#cb11-3"></a><span class="ex">curl</span> -O http://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.18.tar.xz</span>
<span id="cb11-4"><a href="#cb11-4"></a><span class="fu">tar</span> -zxvf gnutls-3.5.18.tar.xz</span>
<span id="cb11-5"><a href="#cb11-5"></a><span class="bu">cd</span> gnutls-3.5.18</span>
<span id="cb11-6"><a href="#cb11-6"></a><span class="ex">./configure</span> --with-included-libtasn1 --without-p11-kit</span>
<span id="cb11-7"><a href="#cb11-7"></a><span class="co">#Forget about the remaining warnings and proceed with `make`</span></span>
<span id="cb11-8"><a href="#cb11-8"></a><span class="fu">make</span></span>
<span id="cb11-9"><a href="#cb11-9"></a><span class="fu">sudo</span> make install</span></code></pre></div>
<p>Now the wget part…</p>
<p>First look for the <em>.tar.gz</em> file with the latest release (currently: wget2-1.99.2.tar.gz) in this <a href="%3Chttp://ftp.gnu.org/gnu/wget/">folder</a>, Modify (if you need to), Copy &amp; Paste the commands below (one line at a time):</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb12-2"><a href="#cb12-2"></a><span class="co"># change the '-x.xx.tar.gz' number below with the latest release version.</span></span>
<span id="cb12-3"><a href="#cb12-3"></a><span class="ex">curl</span> -O http://ftp.gnu.org/gnu/wget/wget2-1.99.2.tar.gz</span>
<span id="cb12-4"><a href="#cb12-4"></a><span class="fu">tar</span> -zxvf wget2-1.99.2.tar.gz</span>
<span id="cb12-5"><a href="#cb12-5"></a><span class="bu">cd</span> wget2-1.99.2</span>
<span id="cb12-6"><a href="#cb12-6"></a><span class="ex">./configure</span></span>
<span id="cb12-7"><a href="#cb12-7"></a><span class="fu">make</span></span>
<span id="cb12-8"><a href="#cb12-8"></a><span class="fu">sudo</span> make install                     <span class="co"># will prompt you to enter your password</span></span>
<span id="cb12-9"><a href="#cb12-9"></a><span class="bu">cd</span> ..                                 <span class="co"># goes up to the enclosing directory</span></span>
<span id="cb12-10"><a href="#cb12-10"></a><span class="fu">wget</span> --help                           <span class="co"># to test installation!</span></span></code></pre></div>
<p>Note:</p>
<p>To remove a folder and downloaded packages use the <code>sudo rm -R</code> command, but be very careful with this command because the content is deleted FOREVER, it doesn’t go in the trash…</p>
<p>Delete the wget folder and package using <code>sudo rm -R wget*</code>.</p>
</div>
<div id="bbedit" class="section level3">
<h3 class="hasAnchor">
<a href="#bbedit" class="anchor"></a><a href="http://www.barebones.com/products/bbedit/index.html">BBEdit</a>
</h3>
<p>This is TextWrangler replacement and is a free text editor that will help you save time. Once installed, go in the <code>Apple Menu bar -&gt; BBEdit -&gt; Install Command Line</code></p>
</div>
<div id="pip" class="section level3">
<h3 class="hasAnchor">
<a href="#pip" class="anchor"></a><a href="https://pip.pypa.io/en/stable/">pip</a>
</h3>
<p>This is a Python installer tool that I highly recommend. To install or upgrade pip, securely download <a href="https://bootstrap.pypa.io/get-pip.py">get-pip.py</a>.</p>
<p>Run this from you Terminal:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb13-2"><a href="#cb13-2"></a><span class="fu">sudo</span> python get-pip.py</span></code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1"></a><span class="ex">pip</span> install -U pip   <span class="co"># to upgrade</span></span></code></pre></div>
<div class="sourceCode" id="cb15"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1"></a><span class="fu">sudo</span> rm -R ~/Downloads/get-pip.py <span class="co"># to remove the downloaded file</span></span></code></pre></div>
</div>
</div>
</div>
<div id="linux" class="section level1">
<h1 class="hasAnchor">
<a href="#linux" class="anchor"></a>Linux</h1>
<p>Make sure you have GCC and CLANG with OpenMP enabled. Several flavors available, check for the proper <a href="http://releases.llvm.org/download.html">link</a></p>
</div>
<div id="install-r" class="section level1">
<h1 class="hasAnchor">
<a href="#install-r" class="anchor"></a>Install <a href="https://cran.r-project.org">R</a>
</h1>
<p>To install R v3.6.3 <strong>“Holding the Windsock”</strong> released on 2020-02-29 download the installer and follow the instructions</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1"></a><span class="co"># for macOS</span></span>
<span id="cb16-2"><a href="#cb16-2"></a><span class="bu">cd</span> Downloads</span>
<span id="cb16-3"><a href="#cb16-3"></a><span class="ex">curl</span> -O https://cran.r-project.org/bin/macosx/el-capitan/base/R-3.6.3.pkg</span></code></pre></div>
<p><strong>To remove R completely from macOS</strong></p>
<div class="sourceCode" id="cb17"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1"></a><span class="fu">sudo</span> rm -rf /Library/Frameworks/R.framework /Applications/R.app \</span>
<span id="cb17-2"><a href="#cb17-2"></a>/usr/bin/R /usr/bin/Rscript</span></code></pre></div>
</div>
<div id="rstudio" class="section level1">
<h1 class="hasAnchor">
<a href="#rstudio" class="anchor"></a>Rstudio</h1>
<p>To download RStudio, check this <a href="https://www.rstudio.com/products/rstudio/download/#download">link</a> and download the installer for your OS.</p>
</div>
<div id="installing-libraries" class="section level1">
<h1 class="hasAnchor">
<a href="#installing-libraries" class="anchor"></a>Installing Libraries</h1>
<p>Below is how I setup most of my computers after a clean macOS install. 1. Start with <strong>devtools</strong> and <strong>tidyverse</strong></p>
<div class="sourceCode" id="cb18"><pre class="downlit">
<span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="kw"><a href="https://rdrr.io/r/base/library.html">require</a></span><span class="op">(</span><span class="st"><a href="https://devtools.r-lib.org/">"devtools"</a></span><span class="op">)</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"devtools"</span><span class="op">)</span> <span class="co"># to install</span>
<span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"tidyverse"</span><span class="op">)</span></pre></div>
<ol start="2" style="list-style-type: decimal">
<li>The gsl package is required by numerous packages and can cause some headaches… Don’t install it from source.</li>
</ol>
<div class="sourceCode" id="cb19"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"gsl"</span><span class="op">)</span></pre></div>
<p>If the console print this: <code>Do you want to install from sources the package which needs compilation? (Yes/no/cancel)</code>. Always aswer <strong>no</strong> unless of course you know what you are doing.</p>
<ol start="3" style="list-style-type: decimal">
<li>Than, I install <strong>grur</strong> and <strong>assigner</strong> my packges with the higher number of dependencies, this way it’s installing automatically 90% of the packages I need (including <strong>radiator</strong>).</li>
</ol>
<div class="sourceCode" id="cb20"><pre class="downlit">
<span class="fu">devtools</span><span class="fu">::</span><span class="fu"><a href="https://devtools.r-lib.org//reference/remote-reexports.html">install_github</a></span><span class="op">(</span><span class="st">"thierrygosselin/grur"</span><span class="op">)</span>
<span class="fu">devtools</span><span class="fu">::</span><span class="fu"><a href="https://devtools.r-lib.org//reference/remote-reexports.html">install_github</a></span><span class="op">(</span><span class="st">"thierrygosselin/assigner"</span><span class="op">)</span></pre></div>
</div>
<div id="makevars-file" class="section level1">
<h1 class="hasAnchor">
<a href="#makevars-file" class="anchor"></a>Makevars file</h1>
<p>For some packages you might have to compile from source and the use of different compiler is sometimes very useful. You need to tell R how to use the compilers. This might change from one package to another. Nothing is simple, you know this by now… All this is done through R’s <strong>Makevars</strong> file located in <code>~/.R/Makevars</code>.</p>
<p>To modify or create the file, the fastest way is to use the package <a href="https://usethis.r-lib.org">usethis</a> (it’s installed automatically with <code>devtools</code>):</p>
<div class="sourceCode" id="cb21"><pre class="downlit">
<span class="fu">usethis</span><span class="fu">::</span><span class="fu"><a href="https://usethis.r-lib.org/reference/edit.html">edit_r_makevars</a></span><span class="op">(</span><span class="op">)</span></pre></div>
<p><strong>Makevars content required:</strong></p>
<div class="sourceCode" id="cb22"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb22-1"><a href="#cb22-1"></a><span class="va">CC=</span>/usr/local/bin/gcc</span>
<span id="cb22-2"><a href="#cb22-2"></a><span class="va">CXX=</span>/usr/local/bin/g++</span>
<span id="cb22-3"><a href="#cb22-3"></a><span class="va">FC=</span>/usr/local/bin/gfortran</span>
<span id="cb22-4"><a href="#cb22-4"></a><span class="va">F77=</span>/usr/local/bin/gfortran</span>
<span id="cb22-5"><a href="#cb22-5"></a><span class="ex">PKG_LIBS</span> = -fopenmp -lgomp</span>
<span id="cb22-6"><a href="#cb22-6"></a><span class="va">PKG_CFLAGS=</span> <span class="ex">-O3</span> -Wall -pipe -pedantic -std=gnu99 -fopenmp</span>
<span id="cb22-7"><a href="#cb22-7"></a><span class="va">PKG_CXXFLAGS=</span>-fopenmp <span class="ex">-std</span>=c++11</span>
<span id="cb22-8"><a href="#cb22-8"></a><span class="va">CFLAGS=</span> <span class="ex">-O3</span> -Wall -pipe -pedantic -std=gnu99 -fopenmp</span>
<span id="cb22-9"><a href="#cb22-9"></a><span class="ex">SHLIB_OPENMP_CFLAGS</span> = -fopenmp</span>
<span id="cb22-10"><a href="#cb22-10"></a><span class="ex">SHLIB_OPENMP_CXXFLAGS</span> = -fopenmp</span>
<span id="cb22-11"><a href="#cb22-11"></a><span class="ex">SHLIB_OPENMP_FCFLAGS</span> = -fopenmp</span>
<span id="cb22-12"><a href="#cb22-12"></a><span class="ex">SHLIB_OPENMP_FFLAGS</span> = -fopenmp</span>
<span id="cb22-13"><a href="#cb22-13"></a><span class="co"># change the nex line according to your computer compiler version (use gcc -v in terminal):</span></span>
<span id="cb22-14"><a href="#cb22-14"></a><span class="va">FLIBS=</span>-L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0/finclude </span>
<span id="cb22-15"><a href="#cb22-15"></a><span class="va">CFLAGS=</span>-mtune=<span class="ex">native</span> -g -O2 -Wall -pedantic -Wconversion</span>
<span id="cb22-16"><a href="#cb22-16"></a><span class="va">CXXFLAGS=</span>-mtune=<span class="ex">native</span> -g -O2 -Wall -pedantic -Wconversion</span></code></pre></div>
</div>
<div id="Installation_problems" class="section level1">
<h1 class="hasAnchor">
<a href="#Installation_problems" class="anchor"></a>Installation problems</h1>
<p>Sometimes you’ll get warnings while installing dependencies required for <em>x</em> package.</p>
<div class="sourceCode" id="cb23"><pre class="downlit">
<span class="co">#Warning: cannot remove prior installation of package ‘stringi’</span></pre></div>
<p>To solve this problem, delete manually the problematic package in the installation folder (on mac: <code>/Library/Frameworks/R.framework/Resources/library</code>) or in the <code>Terminal</code>:</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb24-1"><a href="#cb24-1"></a><span class="fu">sudo</span> rm -R /Library/Frameworks/R.framework/Resources/library/package_name</span>
<span id="cb24-2"><a href="#cb24-2"></a><span class="co"># Changing 'package_name' to the problematic package.</span></span>
<span id="cb24-3"><a href="#cb24-3"></a><span class="co"># Reinstall the package.</span></span></code></pre></div>
<ul>
<li><p>Using the latest version of R, RStudio and packages is recommended. If your heart start pounding just at the thought of having to install a new R version, you should have a look at <a href="https://www.rstudio.com/resources/webinars/managing-package-dependencies-in-r-with-packrat/">packrat</a>.</p></li>
<li><p>Look at the output in R console when you get an error message. If it’s related to one’s of the packages dependencies, try installing it separately before attempting to reinstall the problematic package.</p></li>
</ul>
<div id="error-saying-https-not-supported-or-disabled-in-libcurl" class="section level2">
<h2 class="hasAnchor">
<a href="#error-saying-https-not-supported-or-disabled-in-libcurl" class="anchor"></a>Error saying “https” not supported or disabled in libcurl</h2>
<div id="installing-openssl" class="section level3">
<h3 class="hasAnchor">
<a href="#installing-openssl" class="anchor"></a>Installing <a href="www.openssl.org">OpenSSL</a>
</h3>
<p>Required if GCC compiler is used (TLS backend is then used). Not required if clang is used (securetransport backend is used).</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb25-1"><a href="#cb25-1"></a><span class="co">#In browser</span></span>
<span id="cb25-2"><a href="#cb25-2"></a><span class="ex">https</span>://www.openssl.org/source/openssl-1.1.1.tar.gz</span>
<span id="cb25-3"><a href="#cb25-3"></a></span>
<span id="cb25-4"><a href="#cb25-4"></a><span class="co">#In Terminal</span></span>
<span id="cb25-5"><a href="#cb25-5"></a><span class="bu">cd</span> Downloads</span>
<span id="cb25-6"><a href="#cb25-6"></a><span class="ex">curl</span> -O https://www.openssl.org/source/openssl-1.1.1.tar.gz</span>
<span id="cb25-7"><a href="#cb25-7"></a><span class="fu">tar</span> -zxvf openssl-1.1.1.tar.gz</span>
<span id="cb25-8"><a href="#cb25-8"></a><span class="bu">cd</span> openssl-1.1.1</span>
<span id="cb25-9"><a href="#cb25-9"></a><span class="ex">./config</span></span>
<span id="cb25-10"><a href="#cb25-10"></a><span class="fu">make</span> -j12 <span class="co">#change with your number of CPU</span></span>
<span id="cb25-11"><a href="#cb25-11"></a><span class="fu">make</span> test <span class="co">#long</span></span>
<span id="cb25-12"><a href="#cb25-12"></a><span class="fu">sudo</span> make install</span>
<span id="cb25-13"><a href="#cb25-13"></a><span class="bu">cd</span> ..</span>
<span id="cb25-14"><a href="#cb25-14"></a><span class="fu">sudo</span> rm -R openssl*</span></code></pre></div>
</div>
<div id="installing-curl" class="section level3">
<h3 class="hasAnchor">
<a href="#installing-curl" class="anchor"></a>Installing <a href="https://curl.haxx.se/download">curl</a>
</h3>
<p>Check for the latest release of <a href="https://curl.haxx.se/download">curl</a></p>
<div class="sourceCode" id="cb26"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb26-1"><a href="#cb26-1"></a><span class="co">#Copy/paste in your browser</span></span>
<span id="cb26-2"><a href="#cb26-2"></a><span class="ex">https</span>://curl.haxx.se/download/curl-7.69.0.tar.gz</span>
<span id="cb26-3"><a href="#cb26-3"></a><span class="co"># Terminal</span></span>
<span id="cb26-4"><a href="#cb26-4"></a><span class="bu">cd</span> Downloads</span>
<span id="cb26-5"><a href="#cb26-5"></a><span class="fu">tar</span> -zxvf curl-7.69.0.tar.gz</span>
<span id="cb26-6"><a href="#cb26-6"></a><span class="bu">cd</span> curl-7.69.0</span></code></pre></div>
<p>The next step depends on the compulier used</p>
<p>With <strong>gcc</strong>:</p>
<div class="sourceCode" id="cb27"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb27-1"><a href="#cb27-1"></a><span class="ex">./configure</span> --with-ssl <span class="co"># to enable https via OpenSSL and using GCC</span></span></code></pre></div>
<p>Note: with macOS 10.15 this give me an error <code>configure: error: OpenSSL libs and/or directories were not found where specified!</code></p>
<p>If this is the case, use <strong>clang</strong>:</p>
<div class="sourceCode" id="cb28"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb28-1"><a href="#cb28-1"></a><span class="va">CC=</span><span class="st">"/usr/local/bin/clang"</span></span>
<span id="cb28-2"><a href="#cb28-2"></a><span class="ex">./configure</span> --without-ssl --with-darwinssl <span class="co"># to install via clang</span></span></code></pre></div>
<div class="sourceCode" id="cb29"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb29-1"><a href="#cb29-1"></a><span class="fu">make</span> -j12 <span class="co">#change with your number of CPU</span></span>
<span id="cb29-2"><a href="#cb29-2"></a><span class="fu">sudo</span> make install</span>
<span id="cb29-3"><a href="#cb29-3"></a><span class="bu">cd</span> ..</span>
<span id="cb29-4"><a href="#cb29-4"></a><span class="fu">sudo</span> rm -R curl*</span></code></pre></div>
</div>
</div>
<div id="linux-related-problem" class="section level2">
<h2 class="hasAnchor">
<a href="#linux-related-problem" class="anchor"></a>Linux related problem</h2>
<p>If you have an install problem, the problem might be very computer-specific. e.g. if the problem is related to <code>strataG</code>, <code>copula</code> and/or <code>gsl</code>, try installing <code>libgsl0-dev</code> in the <strong>Terminal</strong> (very easy now with the latest RStudio release!):</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb30-1"><a href="#cb30-1"></a><span class="fu">sudo</span> apt-get install libgsl0-dev</span></code></pre></div>
</div>
<div id="Renviron" class="section level2">
<h2 class="hasAnchor">
<a href="#Renviron" class="anchor"></a>Error saying: <code>Error: vector memory exhausted (limit reached)</code>
</h2>
<p>Check that you have a file called <code>~/.Renviron</code>:</p>
<div class="sourceCode" id="cb31"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/base/files.html">file.exists</a></span><span class="op">(</span><span class="st">"~/.Renviron"</span><span class="op">)</span></pre></div>
<p>If you dont have the file:</p>
<div class="sourceCode" id="cb32"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb32-1"><a href="#cb32-1"></a><span class="co">#In Terminal</span></span>
<span id="cb32-2"><a href="#cb32-2"></a><span class="bu">cd</span> ~</span>
<span id="cb32-3"><a href="#cb32-3"></a><span class="fu">touch</span> .Renviron</span>
<span id="cb32-4"><a href="#cb32-4"></a><span class="fu">sudo</span> nano .Renviron</span></code></pre></div>
<p>Add this to your <code>.Renviron</code> file located in <code>~/.Renviron</code>:</p>
<div class="sourceCode" id="cb33"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb33-1"><a href="#cb33-1"></a><span class="ex">R_MAX_VSIZE</span> = 100Gb </span></code></pre></div>
<p>Use BBEdit or other software that allows you to see hidden files starting with a <strong>dot</strong></p>
</div>
<div id="error-during-package-installation" class="section level2">
<h2 class="hasAnchor">
<a href="#error-during-package-installation" class="anchor"></a>Error during package installation</h2>
<ul>
<li>Problem with <code>string.h</code>, <code>math.h</code> or any other <code>.h</code>
</li>
<li>Problem with <code>vroom</code>
</li>
<li>Problem with <code>rmetasim</code>
</li>
</ul>
<p>An example during <code>vroom</code> installation:</p>
<div class="sourceCode" id="cb34"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb34-1"><a href="#cb34-1"></a><span class="fu">clang</span>++ -std=gnu++11 -I<span class="st">"/Library/Frameworks/R.framework/Resources/include"</span> -DNDEBUG  -I<span class="st">"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"</span> -I<span class="st">"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include"</span> -I/usr/local/include  -Imio/include -DWIN32_LEAN_AND_MEAN -Ispdlog/include -fPIC  -Wall -g -O2 -c gen.cc -o gen.o</span>
<span id="cb34-2"><a href="#cb34-2"></a><span class="fu">clang</span>++ -std=gnu++11 -I<span class="st">"/Library/Frameworks/R.framework/Resources/include"</span> -DNDEBUG  -I<span class="st">"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"</span> -I<span class="st">"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include"</span> -I/usr/local/include  -Imio/include -DWIN32_LEAN_AND_MEAN -Ispdlog/include -fPIC  -Wall -g -O2 -c index_collection.cc -o index_collection.o</span>
<span id="cb34-3"><a href="#cb34-3"></a><span class="ex">/usr/local/bin/clang</span> -I<span class="st">"/Library/Frameworks/R.framework/Resources/include"</span> -DNDEBUG  -I<span class="st">"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include"</span> -I<span class="st">"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/progress/include"</span> -I/usr/local/include   -fPIC  -I/usr/local/include -c localtime.c -o localtime.o</span>
<span id="cb34-4"><a href="#cb34-4"></a><span class="ex">localtime.c</span>:42:10: fatal error: <span class="st">'string.h'</span> file not found</span>
<span id="cb34-5"><a href="#cb34-5"></a><span class="co">#include &lt;string.h&gt;</span></span>
<span id="cb34-6"><a href="#cb34-6"></a>^<span class="ex">~~~~~~~~~</span></span></code></pre></div>
<p><strong>With macOS:</strong></p>
<ul>
<li>version 10.14, do this:</li>
</ul>
<div class="sourceCode" id="cb35"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb35-1"><a href="#cb35-1"></a><span class="fu">sudo</span> installer -pkg \</span>
<span id="cb35-2"><a href="#cb35-2"></a>/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg \</span>
<span id="cb35-3"><a href="#cb35-3"></a>-target /</span></code></pre></div>
<ul>
<li>version <strong>10.15 (Catalina)</strong>: follow the <code>.Makevars</code> <a href="#Makevars_config">configuration</a>
</li>
</ul>
</div>
<div id="error--setmaxglobalsize" class="section level2">
<h2 class="hasAnchor">
<a href="#error--setmaxglobalsize" class="anchor"></a>Error <code>.setMaxGlobalSize</code>
</h2>
<p>Its a problem with a previous version of <code>pbmcapply</code> and it’s interaction with <code>future</code>.</p>
<p><strong>Solution:</strong></p>
<ul>
<li>restart your computer</li>
<li>with a clean desk and session: open RStudio and update your packages</li>
<li>Restart R (<code>RStudio &gt; Session &gt; Restart R</code>)</li>
<li>Re-install my github package generating the error</li>
</ul>
<p><em>Note:</em> if your heart start pounding just at the thought of having to update everything on your computer you should definitely have a look at <a href="https://www.rstudio.com/resources/webinars/managing-package-dependencies-in-r-with-packrat/">packrat</a>: it’s very easy to use.</p>
</div>
<div id="error-in--dynamicclustercall" class="section level2">
<h2 class="hasAnchor">
<a href="#error-in--dynamicclustercall" class="anchor"></a>Error in <code>.DynamicClusterCall</code>
</h2>
<p>If you have a PC and you’re getting this error or closely related error:</p>
<div class="sourceCode" id="cb36"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb36-1"><a href="#cb36-1"></a><span class="co"># Error in .DynamicClusterCall(cl, length(cl), .fun = function(.proc_idx,  :</span></span>
<span id="cb36-2"><a href="#cb36-2"></a><span class="co"># One of the nodes produced an error: Can not open file 'FILE PATH'. The process cannot access the file because it # is being used by another process.</span></span></code></pre></div>
<p><strong>Solution:</strong> Use <code>parallel.core = 1</code> in the function generating the error.</p>
</div>
<div id="error-during-install-when-numerous-of-packages-are-updated" class="section level2">
<h2 class="hasAnchor">
<a href="#error-during-install-when-numerous-of-packages-are-updated" class="anchor"></a>Error during install when numerous of packages are updated:</h2>
<div class="sourceCode" id="cb37"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb37-1"><a href="#cb37-1"></a><span class="co"># Error in get0(oNam, envir = ns) :</span></span>
<span id="cb37-2"><a href="#cb37-2"></a><span class="co"># lazy-load database '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/callr/R/callr.rdb' is corrupt</span></span>
<span id="cb37-3"><a href="#cb37-3"></a><span class="co"># In addition: Warning message:</span></span>
<span id="cb37-4"><a href="#cb37-4"></a><span class="co"># In get0(oNam, envir = ns) : internal error -3 in R_decompress1</span></span></code></pre></div>
<p><strong>Solution:</strong></p>
<ol style="list-style-type: decimal">
<li>restart R</li>
<li>re-install the package that generated this error</li>
</ol>
</div>
<div id="error-with-dyn-load" class="section level2">
<h2 class="hasAnchor">
<a href="#error-with-dyn-load" class="anchor"></a>Error with <code>dyn.load</code>
</h2>
<p>Here is an example below:</p>
<div class="sourceCode" id="cb38"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb38-1"><a href="#cb38-1"></a><span class="ex">Error</span> in dyn.load(file, DLLpath = DLLpath, ...) <span class="bu">:</span> </span>
<span id="cb38-2"><a href="#cb38-2"></a>  <span class="ex">unable</span> to load shared object <span class="st">'/home/rstudio/R/x86_64-pc-linux-gnu-library/3.6/units/libs/units.so'</span>:</span>
<span id="cb38-3"><a href="#cb38-3"></a>  <span class="ex">libudunits2.so.0</span>: cannot open shared object file: No such file or directory</span>
<span id="cb38-4"><a href="#cb38-4"></a><span class="ex">Calls</span>: <span class="op">&lt;</span>Anonymous<span class="op">&gt;</span> ... asNamespace -<span class="op">&gt;</span> loadNamespace -<span class="op">&gt;</span> library.dynam -<span class="op">&gt;</span> dyn.load</span>
<span id="cb38-5"><a href="#cb38-5"></a><span class="ex">Execution</span> halted</span></code></pre></div>
<p><strong>Solution:</strong></p>
<ol style="list-style-type: decimal">
<li>In R, check the output of this command that look for the <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/EnvVar.html">environment variables</a>:</li>
</ol>
<div class="sourceCode" id="cb39"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/base/Sys.getenv.html">Sys.getenv</a></span><span class="op">(</span><span class="st">"LD_LIBRARY_PATH"</span><span class="op">)</span>
<span class="co"># [1]""</span></pre></div>
<p>Note that if the output is not empty, like in the example above, write down the output.</p>
<ol start="2" style="list-style-type: decimal">
<li>Set the new <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/EnvVar.html">environment variables</a> by adding <code>/usr/local/lib/</code> to the output above:</li>
</ol>
<p>When it’s empty:</p>
<div class="sourceCode" id="cb40"><pre class="downlit">
<span class="co"># in R:</span>
<span class="fu"><a href="https://rdrr.io/r/base/Sys.setenv.html">Sys.setenv</a></span><span class="op">(</span>LD_LIBRARY_PATH<span class="op">=</span><span class="st">"/usr/local/lib/"</span><span class="op">)</span>
<span class="co"># For Linux you could use: /usr/local/lib/:/usr/lib64 </span></pre></div>
<p>When it’s not, add at the end, separated by <code><a href="https://rdrr.io/r/base/Colon.html">:</a></code></p>
<div class="sourceCode" id="cb41"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/base/Sys.setenv.html">Sys.setenv</a></span><span class="op">(</span>LD_LIBRARY_PATH<span class="op">=</span><span class="st">"/usr/local/lib64/R/lib::/lib:/usr/local/lib64:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.amzn2.0.1.x86_64/jre/lib/amd64/server:/usr/local/lib/:/usr/lib64"</span><span class="op">)</span></pre></div>
<p><strong>Long-term solution:</strong></p>
<p>Instead of using <code>Sys.setenv</code> each time you have a similar problem, you could add the <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/EnvVar.html">environment variables</a> <code>LD_LIBRARY_PATH</code> to your <code>.Renviron file</code>. <a href="#Renviron">This is discussed in another problem above</a>.</p>
</div>
<div id="error-with-c-stacks-usage" class="section level2">
<h2 class="hasAnchor">
<a href="#error-with-c-stacks-usage" class="anchor"></a>Error with <code>C stacks usage</code>
</h2>
<div class="sourceCode" id="cb42"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb42-1"><a href="#cb42-1"></a>Error<span class="op">:</span><span class="st"> </span>C stack usage  <span class="dv">7971092</span> is too close to the limit</span></code></pre></div>
<p>So far, I haven’t found the cure to this computer-specific problem.</p>
<p><strong>Potential solutions:</strong></p>
<ul>
<li>Make sure you have enough RAM on your computer for the dataset you want to analyze (16GB is the bare minimum these days for small-medium RADseq dataset).</li>
<li>Closing all windows/app running in the background somtimes help.</li>
<li>Updating to the latest version of R, RStudio and libraries.</li>
<li>Not a fan of upgrading to latest version, use <a href="https://rstudio.github.io/packrat/">Packrat</a>.</li>
<li>Follow the guidelines to prepare your computer in this vignette, from the start…</li>
</ul>
</div>
<div id="google-is-your-next-best-friend" class="section level2">
<h2 class="hasAnchor">
<a href="#google-is-your-next-best-friend" class="anchor"></a>Google is your next best friend…</h2>
</div>
</div>
<div id="specific-librairies-installation" class="section level1">
<h1 class="hasAnchor">
<a href="#specific-librairies-installation" class="anchor"></a>Specific librairies installation</h1>
<div id="rmetasim" class="section level2">
<h2 class="hasAnchor">
<a href="#rmetasim" class="anchor"></a><code>rmetasim</code>
</h2>
<div id="download" class="section level3">
<h3 class="hasAnchor">
<a href="#download" class="anchor"></a>Download</h3>
<p>Download the latest github release of Allan Strand’s <strong>rmetasim</strong></p>
<div class="sourceCode" id="cb43"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb43-1"><a href="#cb43-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb43-2"><a href="#cb43-2"></a><span class="fu">wget</span> --no-check-certificate https://github.com/stranda/rmetasim/archive/master.zip</span>
<span id="cb43-3"><a href="#cb43-3"></a><span class="ex">curl</span> -O https://github.com/stranda/rmetasim/archive/master.zip</span>
<span id="cb43-4"><a href="#cb43-4"></a><span class="fu">unzip</span> master.zip</span></code></pre></div>
</div>
<div id="modify-the-number-of-loci-maxloci" class="section level3">
<h3 class="hasAnchor">
<a href="#modify-the-number-of-loci-maxloci" class="anchor"></a>Modify the number of loci: MAXLOCI</h3>
<p>If you want to use more loci during your simulations (default is 10001), you need to modify rmetasim before compiling. With a text editor, modify the <code>const.h</code> file in the <code>src</code> folder: <code>rmetasim-master/src/const.h</code>. Navigate to <strong>lane 33</strong> and change the integer to the desired maximum number of loci. Or do this in the Terminal:</p>
<div class="sourceCode" id="cb44"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb44-1"><a href="#cb44-1"></a><span class="fu">sed</span> -i -e <span class="st">'s/#define MAXLOCI               10001/#define MAXLOCI               20000/g'</span> rmetasim-master/src/const.h</span></code></pre></div>
</div>
<div id="Makevars_config" class="section level3">
<h3 class="hasAnchor">
<a href="#Makevars_config" class="anchor"></a>Makevars configuration</h3>
<p><em>rmetasim</em> requires these Makevars (<code>~/.R/Makevars</code> file) specifications. If you have other lines, comment (#) before compiling <code>rmetasim</code>:</p>
<div class="sourceCode" id="cb45"><pre class="downlit">
<span class="fu">usethis</span><span class="fu">::</span><span class="fu"><a href="https://usethis.r-lib.org/reference/edit.html">edit_r_makevars</a></span><span class="op">(</span><span class="op">)</span></pre></div>
<p><strong>With most OS (including macOS 10.14):</strong></p>
<div class="sourceCode" id="cb46"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb46-1"><a href="#cb46-1"></a><span class="va">CC=</span>/usr/local/bin/clang</span>
<span id="cb46-2"><a href="#cb46-2"></a><span class="va">CC=</span>/usr/local/bin/clang</span>
<span id="cb46-3"><a href="#cb46-3"></a><span class="va">CXX=</span>/usr/local/bin/clang++</span>
<span id="cb46-4"><a href="#cb46-4"></a><span class="va">CXX1X=</span>/usr/local/bin/clang++</span>
<span id="cb46-5"><a href="#cb46-5"></a><span class="va">CXX11=</span>/usr/local/bin/clang++</span>
<span id="cb46-6"><a href="#cb46-6"></a><span class="va">FLIBS=</span>-L/usr/local/lib</span>
<span id="cb46-7"><a href="#cb46-7"></a><span class="va">CFLAGS=</span>-I/usr/local/include</span>
<span id="cb46-8"><a href="#cb46-8"></a><span class="va">LDFLAGS=</span>-L/usr/local/lib</span>
<span id="cb46-9"><a href="#cb46-9"></a><span class="va">CPPFLAGS=</span>-I/usr/local/include</span>
<span id="cb46-10"><a href="#cb46-10"></a><span class="va">SHLIB_OPENMP_CFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb46-11"><a href="#cb46-11"></a><span class="va">SHLIB_OPENMP_FCFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb46-12"><a href="#cb46-12"></a><span class="va">SHLIB_OPENMP_FFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb46-13"><a href="#cb46-13"></a><span class="va">SHLIB_OPENMP_CXXFLAGS=</span> <span class="ex">-fopenmp</span></span></code></pre></div>
<p><strong>macOS 10.15</strong></p>
<p>This latest os requires extra lines:</p>
<div class="sourceCode" id="cb47"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb47-1"><a href="#cb47-1"></a><span class="va">CC=</span>/usr/local/bin/clang</span>
<span id="cb47-2"><a href="#cb47-2"></a><span class="va">CC=</span>/usr/local/bin/clang</span>
<span id="cb47-3"><a href="#cb47-3"></a><span class="va">CXX=</span>/usr/local/bin/clang++</span>
<span id="cb47-4"><a href="#cb47-4"></a><span class="va">CXX1X=</span>/usr/local/bin/clang++</span>
<span id="cb47-5"><a href="#cb47-5"></a><span class="va">FLIBS=</span>-L/usr/local/lib</span>
<span id="cb47-6"><a href="#cb47-6"></a><span class="va">LDFLAGS=</span>-L/usr/local/lib</span>
<span id="cb47-7"><a href="#cb47-7"></a><span class="va">SHLIB_OPENMP_CFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb47-8"><a href="#cb47-8"></a><span class="va">SHLIB_OPENMP_FCFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb47-9"><a href="#cb47-9"></a><span class="va">SHLIB_OPENMP_FFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb47-10"><a href="#cb47-10"></a><span class="va">SHLIB_OPENMP_CXXFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb47-11"><a href="#cb47-11"></a><span class="va">CFLAGS+=</span>-isysroot <span class="ex">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk</span></span>
<span id="cb47-12"><a href="#cb47-12"></a><span class="va">CCFLAGS+=</span>-isysroot <span class="ex">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk</span></span>
<span id="cb47-13"><a href="#cb47-13"></a><span class="va">CXXFLAGS+=</span>-isysroot <span class="ex">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk</span></span>
<span id="cb47-14"><a href="#cb47-14"></a><span class="va">CPPFLAGS+=</span>-isysroot <span class="ex">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk</span></span></code></pre></div>
</div>
<div id="compile" class="section level3">
<h3 class="hasAnchor">
<a href="#compile" class="anchor"></a>Compile</h3>
<div class="sourceCode" id="cb48"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb48-1"><a href="#cb48-1"></a><span class="ex">R</span> CMD INSTALL <span class="st">"rmetasim-master"</span> <span class="co"># Terminal command</span></span>
<span id="cb48-2"><a href="#cb48-2"></a><span class="fu">sudo</span> rm -R rmetasim* <span class="co"># to remove the folders no longer required</span></span></code></pre></div>
</div>
</div>
<div id="xgboost" class="section level2">
<h2 class="hasAnchor">
<a href="#xgboost" class="anchor"></a><code>XGBoost</code>
</h2>
<div id="download-the-github-version" class="section level3">
<h3 class="hasAnchor">
<a href="#download-the-github-version" class="anchor"></a>Download the github version</h3>
<div class="sourceCode" id="cb49"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb49-1"><a href="#cb49-1"></a><span class="co"># terminal</span></span>
<span id="cb49-2"><a href="#cb49-2"></a><span class="bu">cd</span> Downloads</span>
<span id="cb49-3"><a href="#cb49-3"></a><span class="fu">git</span> clone --recursive https://github.com/dmlc/xgboost</span>
<span id="cb49-4"><a href="#cb49-4"></a><span class="bu">cd</span> xgboost</span></code></pre></div>
</div>
<div id="error" class="section level3">
<h3 class="hasAnchor">
<a href="#error" class="anchor"></a>Error?</h3>
<p>If you’re getting this error: <code>"https" not supported or disabled in libcurl</code>, extra steps are required, <a href="#Installation_problems">check the installation problems section</a> to install <code>OpenSSL</code> and <code>curl</code> and enabling <code>https</code> with <code>--with-ssl</code> option.</p>
</div>
<div id="modification" class="section level3">
<h3 class="hasAnchor">
<a href="#modification" class="anchor"></a>Modification</h3>
<p>Modify in a text editor the <code>configure</code> file inside the <code>xgboost/R-package</code> folder:</p>
<div class="sourceCode" id="cb50"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb50-1"><a href="#cb50-1"></a><span class="co"># Go to line 1676</span></span>
<span id="cb50-2"><a href="#cb50-2"></a><span class="co"># change</span></span>
<span id="cb50-3"><a href="#cb50-3"></a><span class="va">ac_pkg_openmp=</span>no</span>
<span id="cb50-4"><a href="#cb50-4"></a><span class="co"># to</span></span>
<span id="cb50-5"><a href="#cb50-5"></a><span class="va">ac_pkg_openmp=</span>yes</span>
<span id="cb50-6"><a href="#cb50-6"></a><span class="co">#save the file under the same name</span></span></code></pre></div>
</div>
<div id="makevars-configuration" class="section level3">
<h3 class="hasAnchor">
<a href="#makevars-configuration" class="anchor"></a>Makevars configuration</h3>
<p><code>XGBoost</code> requires these Makevars specifications. If you have other lines, comment (#) before compiling:</p>
<div class="sourceCode" id="cb51"><pre class="downlit">
<span class="fu">usethis</span><span class="fu">::</span><span class="fu"><a href="https://usethis.r-lib.org/reference/edit.html">edit_r_makevars</a></span><span class="op">(</span><span class="op">)</span></pre></div>
<div class="sourceCode" id="cb52"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb52-1"><a href="#cb52-1"></a><span class="va">CC=</span>/usr/local/bin/gcc</span>
<span id="cb52-2"><a href="#cb52-2"></a><span class="va">CXX=</span>/usr/local/bin/g++</span>
<span id="cb52-3"><a href="#cb52-3"></a><span class="va">CXX11=</span>/usr/local/bin/g++</span>
<span id="cb52-4"><a href="#cb52-4"></a><span class="va">CXX14=</span>/usr/local/bin/g++</span>
<span id="cb52-5"><a href="#cb52-5"></a><span class="va">CXX17=</span>/usr/local/bin/g++</span>
<span id="cb52-6"><a href="#cb52-6"></a><span class="va">SHLIB_OPENMP_CFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb52-7"><a href="#cb52-7"></a><span class="va">SHLIB_OPENMP_FCFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb52-8"><a href="#cb52-8"></a><span class="va">SHLIB_OPENMP_FFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb52-9"><a href="#cb52-9"></a><span class="va">SHLIB_OPENMP_CXXFLAGS=</span> <span class="ex">-fopenmp</span></span>
<span id="cb52-10"><a href="#cb52-10"></a><span class="va">CFLAGS=</span>-g <span class="ex">-O3</span> -Wall -pedantic -std=gnu99 -mtune=native -pipe</span>
<span id="cb52-11"><a href="#cb52-11"></a><span class="va">CXXFLAGS=</span>-g <span class="ex">-O3</span> -Wall -pedantic -std=c++11 -mtune=native -pipe</span>
<span id="cb52-12"><a href="#cb52-12"></a><span class="va">LDFLAGS=</span>-L/usr/local/lib <span class="ex">-Wl</span>,-rpath,/usr/local/lib</span>
<span id="cb52-13"><a href="#cb52-13"></a><span class="va">CPPFLAGS=</span>-I/usr/local/include <span class="ex">-I/usr/local/include</span></span></code></pre></div>
</div>
<div id="compile-1" class="section level3">
<h3 class="hasAnchor">
<a href="#compile-1" class="anchor"></a>Compile</h3>
<div class="sourceCode" id="cb53"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb53-1"><a href="#cb53-1"></a><span class="fu">sudo</span> R CMD INSTALL R-package</span></code></pre></div>
</div>
<div id="test-r-package" class="section level3">
<h3 class="hasAnchor">
<a href="#test-r-package" class="anchor"></a>Test R-package</h3>
<p>You should see a time difference between both runs</p>
<div class="sourceCode" id="cb54"><pre class="downlit">
<span class="kw"><a href="https://rdrr.io/r/base/library.html">require</a></span><span class="op">(</span><span class="va"><a href="https://github.com/dmlc/xgboost">xgboost</a></span><span class="op">)</span>
<span class="va">x</span> <span class="op">&lt;-</span>  <span class="fu"><a href="https://rdrr.io/r/base/matrix.html">matrix</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/stats/Normal.html">rnorm</a></span><span class="op">(</span><span class="fl">100</span><span class="op">*</span><span class="fl">10000</span><span class="op">)</span>, <span class="fl">10000</span>, <span class="fl">100</span><span class="op">)</span>
<span class="va">y</span> <span class="op">&lt;-</span>  <span class="va">x</span> <span class="op">%*%</span> <span class="fu"><a href="https://rdrr.io/r/stats/Normal.html">rnorm</a></span><span class="op">(</span><span class="fl">100</span><span class="op">)</span> <span class="op">+</span> <span class="fu"><a href="https://rdrr.io/r/stats/Normal.html">rnorm</a></span><span class="op">(</span><span class="fl">1000</span><span class="op">)</span>

<span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="op">{</span><span class="va">bst</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/pkg/xgboost/man/xgb.train.html">xgboost</a></span><span class="op">(</span>data <span class="op">=</span> <span class="va">x</span>, label <span class="op">=</span> <span class="va">y</span>, nthread <span class="op">=</span> <span class="fl">1</span>, nround <span class="op">=</span> <span class="fl">100</span>, verbose <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">}</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/system.time.html">system.time</a></span><span class="op">(</span><span class="op">{</span><span class="va">bst</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/pkg/xgboost/man/xgb.train.html">xgboost</a></span><span class="op">(</span>data <span class="op">=</span> <span class="va">x</span>, label <span class="op">=</span> <span class="va">y</span>, nthread <span class="op">=</span> <span class="fl">4</span>, nround <span class="op">=</span> <span class="fl">100</span>, verbose <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">}</span><span class="op">)</span></pre></div>
</div>
</div>
<div id="lightgbm" class="section level2">
<h2 class="hasAnchor">
<a href="#lightgbm" class="anchor"></a><code>LightGBM</code>
</h2>
<p><code>LightGBM</code> requires an OpenMP-enabled compiler. Currently, it doesn’t work well with clang, so make sure you have updated your GCC compiler (instructions above). Additionally, <code>LightGBM</code> requires <a href="https://cmake.org/overview/">CMake</a></p>
<div id="download-and-install-cmake" class="section level3">
<h3 class="hasAnchor">
<a href="#download-and-install-cmake" class="anchor"></a>Download and install CMake</h3>
<div class="sourceCode" id="cb55"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb55-1"><a href="#cb55-1"></a><span class="co">#In browser or using wget in Terminal</span></span>
<span id="cb55-2"><a href="#cb55-2"></a><span class="ex">https</span>://cmake.org/files/v3.12/cmake-3.12.2-Darwin-x86_64.dmg</span>
<span id="cb55-3"><a href="#cb55-3"></a><span class="co"># double-click on the disk image and follow instructions</span></span></code></pre></div>
<p>To add CMake to the PATH:</p>
<div class="sourceCode" id="cb56"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb56-1"><a href="#cb56-1"></a><span class="va">PATH=</span><span class="st">"/Applications/CMake.app/Contents/bin"</span>:<span class="st">"</span><span class="va">$PATH</span><span class="st">"</span></span>
<span id="cb56-2"><a href="#cb56-2"></a><span class="co"># Or, to install symlinks to '/usr/local/bin', run:</span></span>
<span id="cb56-3"><a href="#cb56-3"></a><span class="fu">sudo</span> <span class="st">"/Applications/CMake.app/Contents/bin/cmake-gui"</span> --install</span>
<span id="cb56-4"><a href="#cb56-4"></a><span class="co"># Or, to install symlinks to another directory, run:</span></span>
<span id="cb56-5"><a href="#cb56-5"></a><span class="fu">sudo</span> <span class="st">"/Applications/CMake.app/Contents/bin/cmake-gui"</span> --install=/path/to/bin</span>
<span id="cb56-6"><a href="#cb56-6"></a><span class="co">#Then, run the following commands to install LightGBM:</span></span></code></pre></div>
</div>
<div id="download-and-install-lightgbm" class="section level3">
<h3 class="hasAnchor">
<a href="#download-and-install-lightgbm" class="anchor"></a>Download and Install LightGBM</h3>
<div class="sourceCode" id="cb57"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb57-1"><a href="#cb57-1"></a><span class="bu">cd</span> Downloads</span>
<span id="cb57-2"><a href="#cb57-2"></a><span class="fu">git</span> clone --recursive https://github.com/Microsoft/LightGBM</span>
<span id="cb57-3"><a href="#cb57-3"></a><span class="bu">cd</span> LightGBM</span>
<span id="cb57-4"><a href="#cb57-4"></a><span class="ex">Rscript</span> build_r.R</span>
<span id="cb57-5"><a href="#cb57-5"></a><span class="co"># previous version required running these lines instead</span></span>
<span id="cb57-6"><a href="#cb57-6"></a><span class="co">#cd LightGBM/R-package</span></span>
<span id="cb57-7"><a href="#cb57-7"></a><span class="co">#export CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++</span></span>
<span id="cb57-8"><a href="#cb57-8"></a><span class="co">#R CMD INSTALL --build . --no-multiarch</span></span></code></pre></div>
</div>
</div>
<div id="randomforestsrc" class="section level2">
<h2 class="hasAnchor">
<a href="#randomforestsrc" class="anchor"></a><code>randomForestSRC</code>
</h2>
<p><a href="http://web.ccs.miami.edu/~hishwaran/ishwaran.html">randomForestSRC</a> requires the GCC OpenMP-enabled compiler to run in parallel. See instructions above if not already done.</p>
<div id="makevars-configuration-1" class="section level3">
<h3 class="hasAnchor">
<a href="#makevars-configuration-1" class="anchor"></a>Makevars configuration</h3>
<p>Check that the lines below <strong>are not</strong> commented in your <code>~/.R/Makevars</code> file:</p>
<div class="sourceCode" id="cb58"><pre class="downlit">
<span class="fu">usethis</span><span class="fu">::</span><span class="fu"><a href="https://usethis.r-lib.org/reference/edit.html">edit_r_makevars</a></span><span class="op">(</span><span class="op">)</span></pre></div>
<div class="sourceCode" id="cb59"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb59-1"><a href="#cb59-1"></a><span class="va">CC=</span>/usr/local/bin/gcc</span>
<span id="cb59-2"><a href="#cb59-2"></a><span class="va">CXX=</span>/usr/local/bin/g++</span>
<span id="cb59-3"><a href="#cb59-3"></a><span class="va">CFLAGS=</span>-g <span class="ex">-O3</span> -Wall -pedantic -std=gnu99 -mtune=native -pipe</span>
<span id="cb59-4"><a href="#cb59-4"></a><span class="va">CXXFLAGS=</span>-g <span class="ex">-O3</span> -Wall -pedantic -std=c++11 -mtune=native -pipe</span>
<span id="cb59-5"><a href="#cb59-5"></a><span class="va">PKG_CFLAGS=</span> <span class="ex">-O3</span> -Wall -pipe -pedantic -std=gnu99 -fopenmp</span>
<span id="cb59-6"><a href="#cb59-6"></a><span class="va">PKG_CXXFLAGS=</span>-fopenmp <span class="ex">-std</span>=c++11</span>
<span id="cb59-7"><a href="#cb59-7"></a><span class="va">FC=</span>/usr/local/bin/gfortran</span>
<span id="cb59-8"><a href="#cb59-8"></a><span class="va">F77=</span>/usr/local/bin/gfortran</span>
<span id="cb59-9"><a href="#cb59-9"></a><span class="va">LDFLAGS=</span>-L/usr/local/lib</span>
<span id="cb59-10"><a href="#cb59-10"></a><span class="ex">PKG_LIBS</span> = <span class="st">"-liconv"</span></span></code></pre></div>
</div>
<div id="download-and-install" class="section level3">
<h3 class="hasAnchor">
<a href="#download-and-install" class="anchor"></a>Download and install</h3>
<p>From the Terminal run these steps to download and compile randomForestSRC:</p>
<div class="sourceCode" id="cb60"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb60-1"><a href="#cb60-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb60-2"><a href="#cb60-2"></a><span class="ex">curl</span> -O https://cran.r-project.org/src/contrib/randomForestSRC_2.9.3.tar.gz</span>
<span id="cb60-3"><a href="#cb60-3"></a><span class="fu">tar</span> -zxvf randomForestSRC_2.9.3.tar.gz</span>
<span id="cb60-4"><a href="#cb60-4"></a><span class="bu">cd</span> randomForestSRC</span></code></pre></div>
<p>Make sure you have autoconf installed:</p>
<div class="sourceCode" id="cb61"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb61-1"><a href="#cb61-1"></a><span class="co"># in Terminal</span></span>
<span id="cb61-2"><a href="#cb61-2"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb61-3"><a href="#cb61-3"></a><span class="fu">autoconf</span></span></code></pre></div>
<p>Should output: <code>autoconf: error: no input file</code>, if not, install following the <a href="#useful">steps here</a>.</p>
<div class="sourceCode" id="cb62"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb62-1"><a href="#cb62-1"></a><span class="co"># in Terminal</span></span>
<span id="cb62-2"><a href="#cb62-2"></a><span class="bu">cd</span> ~/Downloads/randomForestSRC</span>
<span id="cb62-3"><a href="#cb62-3"></a><span class="fu">autoconf</span></span>
<span id="cb62-4"><a href="#cb62-4"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb62-5"><a href="#cb62-5"></a><span class="ex">R</span> CMD INSTALL --preclean --clean randomForestSRC</span></code></pre></div>
<p>You want to make sure that this line is printed during execution of the previous command: <code>checking whether OpenMP will work in a package... yes</code> or <code>checking for /usr/local/bin/gcc option to support OpenMP... -fopenmp</code></p>
</div>
</div>
<div id="ranger" class="section level2">
<h2 class="hasAnchor">
<a href="#ranger" class="anchor"></a><code>ranger</code>
</h2>
<p><a href="https://github.com/imbs-hl/ranger">ranger</a> is easy to install.</p>
<div class="sourceCode" id="cb63"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"ranger"</span><span class="op">)</span></pre></div>
</div>
<div id="missranger" class="section level2">
<h2 class="hasAnchor">
<a href="#missranger" class="anchor"></a><code>missRanger</code>
</h2>
<p><a href="https://github.com/mayer79/missRanger">missRanger</a> is also very easy to install.</p>
<div class="sourceCode" id="cb64"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"missRanger"</span><span class="op">)</span></pre></div>
</div>
<div id="miceranger" class="section level2">
<h2 class="hasAnchor">
<a href="#miceranger" class="anchor"></a><code>miceRanger</code>
</h2>
<p><a href="https://github.com/FarrellDay/miceRanger">miceRanger</a> easy to install.</p>
<div class="sourceCode" id="cb65"><pre class="downlit">
<span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html">install.packages</a></span><span class="op">(</span><span class="st">"miceRanger"</span><span class="op">)</span></pre></div>
</div>
<div id="pcamethods" class="section level2">
<h2 class="hasAnchor">
<a href="#pcamethods" class="anchor"></a><code>pcaMethods</code>
</h2>
<p>To install <a href="https://github.com/hredestig/pcaMethods">pcaMethods</a>, from bioconductor:</p>
<div class="sourceCode" id="cb66"><pre class="downlit">
<span class="fu">BiocManager</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/BiocManager/man/install.html">install</a></span><span class="op">(</span><span class="st">"pcaMethods"</span><span class="op">)</span></pre></div>
</div>
<div id="fastsimcoal2" class="section level2">
<h2 class="hasAnchor">
<a href="#fastsimcoal2" class="anchor"></a><code>fastsimcoal2</code>
</h2>
<p>To install <a href="http://cmpg.unibe.ch/software/fastsimcoal2/">fastsimcoal2 v.2.6.0.3</a>, to use in <code><a href="https://thierrygosselin.github.io/grur/reference/simulate_rad.html">grur::simulate_rad</a></code>:</p>
<div id="linux-1" class="section level3">
<h3 class="hasAnchor">
<a href="#linux-1" class="anchor"></a>LINUX</h3>
<div class="sourceCode" id="cb67"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb67-1"><a href="#cb67-1"></a><span class="fu">wget</span> http://cmpg.unibe.ch/software/fastsimcoal2/downloads/fsc26_linux64.zip</span>
<span id="cb67-2"><a href="#cb67-2"></a><span class="fu">unzip</span> fsc26_linux64.zip</span>
<span id="cb67-3"><a href="#cb67-3"></a><span class="fu">sudo</span> mv fsc26_linux64/fsc26 /usr/local/bin/fsc26 <span class="co"># will ask for your computer password</span></span></code></pre></div>
</div>
<div id="macos-1" class="section level3">
<h3 class="hasAnchor">
<a href="#macos-1" class="anchor"></a>MacOS</h3>
<div class="sourceCode" id="cb68"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb68-1"><a href="#cb68-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb68-2"><a href="#cb68-2"></a><span class="ex">curl</span> -O http://cmpg.unibe.ch/software/fastsimcoal2/downloads/fsc26_mac64.zip</span>
<span id="cb68-3"><a href="#cb68-3"></a><span class="fu">unzip</span> fsc26_mac64.zip</span>
<span id="cb68-4"><a href="#cb68-4"></a><span class="fu">sudo</span> mv fsc26_mac64/fsc26 /usr/local/bin/fsc26 <span class="co"># will ask for your computer password</span></span></code></pre></div>
</div>
<div id="common-to-both-os" class="section level3">
<h3 class="hasAnchor">
<a href="#common-to-both-os" class="anchor"></a>Common to both OS:</h3>
<div class="sourceCode" id="cb69"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb69-1"><a href="#cb69-1"></a><span class="fu">sudo</span> chmod 777 /usr/local/bin/fsc26</span>
<span id="cb69-2"><a href="#cb69-2"></a><span class="ex">fsc26</span></span></code></pre></div>
<p>Re-start R and the software fastsimcoal2 will automatically be in your PATH…</p>
</div>
<div id="path-1" class="section level3">
<h3 class="hasAnchor">
<a href="#path-1" class="anchor"></a>PATH</h3>
<p>To see the path of the installation, in the <code>Terminal</code>:</p>
<div class="sourceCode" id="cb70"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb70-1"><a href="#cb70-1"></a><span class="fu">which</span> fsc26</span>
<span id="cb70-2"><a href="#cb70-2"></a><span class="co"># in macOS:</span></span>
<span id="cb70-3"><a href="#cb70-3"></a><span class="co"># /usr/local/bin/fsc26</span></span></code></pre></div>
<p>If that doesn’t work, do:</p>
<div class="sourceCode" id="cb71"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb71-1"><a href="#cb71-1"></a><span class="bu">source</span> ~/.bash_profile</span></code></pre></div>
<p>Remove the files in the folder:</p>
<div class="sourceCode" id="cb72"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb72-1"><a href="#cb72-1"></a><span class="fu">sudo</span> rm -R ~/Downloads/fsc26_mac64*</span></code></pre></div>
</div>
</div>
<div id="colony" class="section level2">
<h2 class="hasAnchor">
<a href="#colony" class="anchor"></a><code>COLONY</code>
</h2>
<p>To install <a href="https://www.zsl.org/science/software/colony">COLONY 30/07/2018, V2.0.6.5</a>:</p>
<div id="macos-2" class="section level3">
<h3 class="hasAnchor">
<a href="#macos-2" class="anchor"></a>MacOS</h3>
<p>The old openmpi version (openmpi-1.6.5) is required, saddly.</p>
<div class="sourceCode" id="cb73"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb73-1"><a href="#cb73-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb73-2"><a href="#cb73-2"></a><span class="ex">curl</span> -O https://download.open-mpi.org/release/open-mpi/v1.6/openmpi-1.6.5.tar.gz</span>
<span id="cb73-3"><a href="#cb73-3"></a><span class="fu">tar</span> -zxvf openmpi-1.6.5.tar.gz</span>
<span id="cb73-4"><a href="#cb73-4"></a><span class="bu">cd</span> openmpi-1.6.5</span>
<span id="cb73-5"><a href="#cb73-5"></a><span class="bu">export</span> <span class="va">TMPDIR=</span>/tmp</span>
<span id="cb73-6"><a href="#cb73-6"></a><span class="ex">./configure</span> F77=gfortran <span class="co">#--prefix=/usr/local -openmp # no longer work for some reason</span></span>
<span id="cb73-7"><a href="#cb73-7"></a><span class="fu">make</span> -j 12</span>
<span id="cb73-8"><a href="#cb73-8"></a><span class="fu">sudo</span> make install</span>
<span id="cb73-9"><a href="#cb73-9"></a><span class="fu">sudo</span> rm -R ~/Downloads/openmpi*</span></code></pre></div>
<p>To download COLONY, follow instructions on Jinliang Wang <a href="https://www.zsl.org/science/software/colony">ZSL website</a>. The file you need to uncompress is named: <code>colony2.mac_.20180730.zip</code>.</p>
</div>
<div id="linux-2" class="section level3">
<h3 class="hasAnchor">
<a href="#linux-2" class="anchor"></a>Linux</h3>
<p>To download COLONY, follow instructions on Jinliang Wang <a href="https://www.zsl.org/science/software/colony">ZSL website</a>. The file you need to uncompress is named: <code>colony2.linux_.20180730.zip</code>.</p>
<p>Several options are available depending on the compiler you have installed.</p>
</div>
</div>
</div>
<div id="useful" class="section level1">
<h1 class="hasAnchor">
<a href="#useful" class="anchor"></a>Useful</h1>
<div id="update-github" class="section level2">
<h2 class="hasAnchor">
<a href="#update-github" class="anchor"></a>Update <a href="http://en.wikipedia.org/wiki/Github">Github</a>
</h2>
<p>macOS Catalina comes with <a href="https://github.com">Github</a>, a Version Control System (VCS), pre-installed. However, the install is in <code>/usr/bin/git</code> which can make it difficult for beginners to update. To change this, run these commands:</p>
<ol style="list-style-type: decimal">
<li>Install <a href="http://www.gnu.org/software/autoconf/">GNU Autoconf</a>
</li>
</ol>
<div class="sourceCode" id="cb74"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb74-1"><a href="#cb74-1"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb74-2"><a href="#cb74-2"></a><span class="fu">wget</span> http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz</span>
<span id="cb74-3"><a href="#cb74-3"></a><span class="ex">curl</span> -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz</span>
<span id="cb74-4"><a href="#cb74-4"></a><span class="fu">tar</span> -xvzf autoconf-latest.tar.gz</span>
<span id="cb74-5"><a href="#cb74-5"></a><span class="bu">cd</span> autoconf-2.69</span>
<span id="cb74-6"><a href="#cb74-6"></a><span class="ex">./configure</span></span>
<span id="cb74-7"><a href="#cb74-7"></a><span class="fu">make</span></span>
<span id="cb74-8"><a href="#cb74-8"></a><span class="fu">sudo</span> make install</span>
<span id="cb74-9"><a href="#cb74-9"></a><span class="bu">cd</span> .. </span>
<span id="cb74-10"><a href="#cb74-10"></a><span class="fu">sudo</span> rm -R ~/Downloads/autoconf-*</span></code></pre></div>
<ol start="2" style="list-style-type: decimal">
<li>Install Github</li>
</ol>
<div class="sourceCode" id="cb75"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb75-1"><a href="#cb75-1"></a><span class="fu">git</span> --version                   <span class="co"># show current git version installed</span></span>
<span id="cb75-2"><a href="#cb75-2"></a><span class="fu">which</span> git                       <span class="co"># returns where is git on your computer</span></span>
<span id="cb75-3"><a href="#cb75-3"></a><span class="bu">cd</span> ~/Downloads</span>
<span id="cb75-4"><a href="#cb75-4"></a><span class="fu">git</span> clone https://github.com/git/git <span class="co"># install the latest Git</span></span>
<span id="cb75-5"><a href="#cb75-5"></a><span class="bu">cd</span> git</span>
<span id="cb75-6"><a href="#cb75-6"></a><span class="fu">make</span> configure</span>
<span id="cb75-7"><a href="#cb75-7"></a><span class="ex">./configure</span></span>
<span id="cb75-8"><a href="#cb75-8"></a><span class="fu">make</span> -j12</span>
<span id="cb75-9"><a href="#cb75-9"></a><span class="fu">sudo</span> make install</span>
<span id="cb75-10"><a href="#cb75-10"></a><span class="bu">cd</span> .. </span>
<span id="cb75-11"><a href="#cb75-11"></a><span class="fu">sudo</span> rm -R ~/Downloads/git/     <span class="co"># remove git folder</span></span>
<span id="cb75-12"><a href="#cb75-12"></a><span class="bu">source</span> ~/.bash_profile          <span class="co"># reload startup script</span></span>
<span id="cb75-13"><a href="#cb75-13"></a><span class="fu">git</span> --version                   <span class="co"># confirmed the version you just installed</span></span>
<span id="cb75-14"><a href="#cb75-14"></a><span class="fu">which</span> git                       <span class="co"># returns /usr/local/bin</span></span></code></pre></div>
</div>
<div id="macos-terminal-from-specific-folder" class="section level2">
<h2 class="hasAnchor">
<a href="#macos-terminal-from-specific-folder" class="anchor"></a>macOS Terminal from specific folder</h2>
<p>In <strong>System Preferences</strong> choose <code>Keyboard -&gt; Shortcuts</code>. From the left panel, choose <strong>Services</strong>. In the right panel, under <strong>Files and Folders</strong>, choose <strong>New Terminal at Folder and/or New Terminal Tab at Folder</strong>. Now you can right-click your track pad or mouse on a folder and choose Services -&gt; New Terminal at Folder!</p>
<p><img src="terminal_folder_shortcut.png" width="660"></p>
</div>
<div id="shortcut-to-folder-path" class="section level2">
<h2 class="hasAnchor">
<a href="#shortcut-to-folder-path" class="anchor"></a>Shortcut to folder path</h2>
<p>Open the Automator application (it’s on all MAC…).</p>
<p><img src="automator.png" width="112"></p>
<div class="sourceCode" id="cb76"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb76-1"><a href="#cb76-1"></a><span class="ex">File</span> -<span class="op">&gt;</span> New (cmd-N)</span>
<span id="cb76-2"><a href="#cb76-2"></a><span class="ex">Choose</span>: Services</span>
<span id="cb76-3"><a href="#cb76-3"></a><span class="ex">Left</span> panel, choose: Library -<span class="op">&gt;</span> Utilities</span>
<span id="cb76-4"><a href="#cb76-4"></a><span class="ex">Middle</span>, choose: Copy to Clipboard and drag it to the right panel</span>
<span id="cb76-5"><a href="#cb76-5"></a><span class="ex">Now</span> you want to have: Service receives selected FILES OR FOLDERS in FINDER<span class="op">&gt;</span></span>
<span id="cb76-6"><a href="#cb76-6"></a><span class="ex">You</span> should have something similar to the image below:</span></code></pre></div>
<p><img src="copy_path.png" width="994"></p>
<div class="sourceCode" id="cb77"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb77-1"><a href="#cb77-1"></a><span class="ex">Save</span> (cmd-S) <span class="ex">or</span> File -<span class="op">&gt;</span> Save service as: copy path to clipboard</span></code></pre></div>
<p>Go in the Finder, select a folder and right click on it you should see ‘copy path to clipboard’ at the bottom or in <strong>Services</strong>.</p>
</div>
</div>
  </div>

  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">

        <nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2>
    </nav>
</div>

</div>



      <footer><div class="copyright">
  <p>Developed by Thierry Gosselin.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>

      </footer>
</div>

  


  </body>
</html>
