title: Building own package for conda gcc and binutils issue
body: <p>This post summarize my painful but finally successful (just by chance) way to build own conda package for the 
  netgen meshing tool with Python interface. I found the <a href="https://github.com/tpaviot/netgen-conda" rel="nofollow noreferrer">recipe</a> for the netgen build due to tpaviot.
  After cloning the repository into 'netgen-conda' folder I ran:</p>
  
  <p><code>conda build netgen-conda/netgen-6.2-dev</code></p>
  
  <p>Which reports "Unsatisfiable dependencies": 'oce', 'gcc-5', 'binutils'. 
  So I tried to install these packages myself. Unfortunately the documentation do not emphasize the important fact that 'conda build' use its own temporary environment so it doesn't matter what you have installed <a href="https://stackoverflow.com/questions/44346018/conda-build-ignoring-my-activated-environment">(see)</a>. Nevertheless even installing 'gcc-5' together with 'binutils' manually turns out to be nearly impossible. </p>
  
  <p>Hint for other newbies: Lot of my problems disappear after I learned details <a href="https://conda.io/docs/user-guide/tasks/manage-channels.html" rel="nofollow noreferrer">about channels</a>. </p>
  
  <p>First try was installing 'gcc-5' with 'binutils' from the 'salford_systems' channel <a href="https://anaconda.org/salford_systems/gcc-5" rel="nofollow noreferrer">suggested by anaconda</a>:</p>
  
  <p><code>conda install -c salford_systems binutils gcc-5</code></p>
  
  <p>But it results in:
  <code>
  ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'salford_systems::gcc-5-5.3.0-0'.
  LinkError: post-link script failed for package salford_systems::gcc-5-5.3.0-0
  running your command again with</code>-v<code>will provide additional information
  location of failed script: /home/jb/miniconda3/envs/test/bin/.gcc-5-post-link.sh
  </code></p>
  
  <p>Using verbose output ('-v') provides no more info. I was also confused by the fact that the script does not exist on the given path (probably automatically deleted).
  With current experience I admit that the reason of problem can be dug out from the '-vv' output (<a href="https://github.com/ContinuumIO/anaconda-issues/issues/4615" rel="nofollow noreferrer">reported issue</a>). After some trying I found that only way to 
  install both is to first install 'gcc-5' into a clean environment and then install 'binutils'. Since 'conda build' installs everything 
  from scratch and there is no way to specify order of installed packages I was stuck. </p>
  
  <p>Another issue that puzzled me is the 'conda build' long prefix hack. For unknown reason they use extremely long prefix for an auxiliary folder
  which result in various kind of issues. I have faced to three such problems:</p>
  
  <ol>
  <li>As is usual today, I have encrypted HOME causing a known issue.</li>
  <li>Using a workaround '--croot /tmp' prevents creating the hard links from '/tmp' into 'HOME/miniconda3' since they are on different filesystems.
     There is a fallback to use the copy. I even thought that the fallback doesn't work for a while, but it worked, just making the build running longer.</li>
  <li>Trying to install 'gcc' (4.x) from 'default' channel complained about too short prefix. So ultimate workaroud was to set the length of the prefix manually 
     '--prefix-length 70'.</li>
  </ol>
  
  <p>Finally, I found that the dependency on 'binutils' is not necessary and successfully build the package with:</p>
  
  <p><code>
  conda build --prefix-length 70  -c salford_systems -c conda-forge -c dlr-sc netgen-conda/netgen-6.2-dev
  </code></p>
  
  <p>Summary (of open questions):</p>
  
  <ul>
  <li>Conda channels introduce a new kind of dependency hell already forgotten when using 'apt-get'. Is there a way to figure out what is a canonical channel for a package.</li>
  <li>Does anyone succeed to build with combination 'gcc-5' and 'binutils'? </li>
  <li>There is still lack of documentation about internal conda mechanisms and error messages do not provide clue to the problem. </li>
  <li>Conda-build use a problematic prefix hack and lack ability to control order of installed packages. Does anybody know the reason for this hack?</li>
  </ul>