title: Errors building R-packages for conda
body: <p>I am having a tough time installing R-packages that are not available in the Anaconda repositories. My attempts so far can be found here <a href="https://stackoverflow.com/questions/36652015/how-to-install-r-packages-not-in-the-conda-repositories">How to install R-packages not in the conda repositories?</a>.</p>
  
  <p>Currently, I am trying to build the R-package <code>rafalib</code> for <code>conda</code> by following the instructions from <a href="https://www.continuum.io/content/conda-data-science" rel="nofollow noreferrer">this article</a> under the heading <em>Building a conda R package</em>.</p>
  
  <p>The first part works fine.</p>
  
  <pre><code>conda skeleton cran rafalib
  </code></pre>
  
  <p>Out:                                                           </p>
  
  <pre><code>Tip: install CacheControl to cache the CRAN metadata
  Fetching metadata from http://cran.r-project.org/
  Writing recipe for rafalib
  Done
  </code></pre>
  
  <p>The build command runs into errors</p>
  
  <pre><code>conda build r-rafalib
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>Removing old build environment
  Removing old work directory
  BUILD START: r-rafalib-1.0.0-r3.2.2_0
  Using Anaconda Cloud api site https://api.anaconda.org
  Fetching package metadata: ......
  Solving package specifications: .
  Error:  Packages missing in current linux-64 channels: 
    - r 3.2.2*
    - r-rcolorbrewer
  </code></pre>
  
  <p>I have <code>r 3.2.2</code>-64bit installed via <code>conda</code> and it runs without problems. I also already have <code>r-colorbrewer</code> installed via <code>conda</code> and I can use that package without issues in R. Why am I getting these errors when trying to build a <code>conda</code> package?</p>
  
  <p>I am on Linux (Antergos, an Arch derivative) with kernel 4.4.5-1-ARCH.</p>
  
  <hr>
  
  <p><strong>UPDATE 2015/04/19</strong></p>
  
  <p>Thanks to <a href="https://stackoverflow.com/a/36653411/2166823">this answer</a>, I found out that I could include the dependencies by building them separately in the same directory as the package I want to install. That didn't work for me, but I also read that I can include a channel in the build command with <code>-c</code>, just as when installing. So now I do:</p>
  
  <pre><code>conda build -c r r-rafalib
  </code></pre>
  
  <p>This gets passed all the dependency problems, but after fetching, extracting and linking packages, it fails. Here is the end of the error message.</p>
  
  <pre><code>Removing old work directory
  Source cache directory is: /home/joel/anaconda2/conda-bld/src_cache
  Downloading source to cache: rafalib_1.0.0.tar.gz
  Downloading http://cran.r-project.org/src/contrib/rafalib_1.0.0.tar.gz
  rafalib_1.0.0. 100% |#######################| Time: 0:00:00   4.87 MB/s
  Success
  Extracting download
  Package: r-rafalib-1.0.0-r3.2.2_0
  source tree in: /home/joel/anaconda2/conda-bld/work/rafalib
  + mv DESCRIPTION DESCRIPTION.old
  + grep -v '^Priority: ' DESCRIPTION.old
  + /home/joel/anaconda2/envs/_build/bin/R CMD INSTALL --build .
  sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
  Command failed: /bin/bash -x -e /home/joel/drafts/r-rafalib/build.sh
  </code></pre>
  
  <p>The error <code>sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook</code> is the same as I encounter when using <code>install.packages()</code> <a href="https://stackoverflow.com/questions/36652015/how-to-install-r-packages-not-in-the-conda-repositories">as reported here</a>.</p>
  
  <p>There is some <a href="https://github.com/ContinuumIO/anaconda-issues/issues/455" rel="nofollow noreferrer">related discussion in this thread</a>. I have tried to get around this error by installing different versions of ncurses, including <a href="https://github.com/MaxNoe/conda-recipes" rel="nofollow noreferrer">this patched version</a>, and I have tried to link the readline libraries, <a href="https://github.com/conda/conda/issues/1679" rel="nofollow noreferrer">as suggested here</a>, but I keep running into the same error. I'm quite lost at this point and any help to solve this would be greatly appreciated.</p>