1

LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch

Distributor ID: Ubuntu

Description: Ubuntu 18.04.3 LTS

Release: 18.04

Codename: bionic

Conda install of gcc results in the following:

    (base) userA@server:~$ conda install -c anaconda gcc

    Collecting package metadata (current_repodata.json): done
    Solving environment: done

    ## Package Plan ##

      environment location: /home/userA/anaconda3

      added / updated specs:
        - gcc


    The following NEW packages will be INSTALLED:

      cloog              anaconda/linux-64::cloog-0.18.0-0
      gcc                anaconda/linux-64::gcc-4.8.5-7
      isl                anaconda/linux-64::isl-0.12.2-0


    Proceed ([y]/n)? y

    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    ERROR conda.core.link:_execute(700): An error occurred while installing package 'anaconda::gcc-4.8.5-7'.
    Rolling back transaction: done

    LinkError: post-link script failed for package anaconda::gcc-4.8.5-7
    location of failed script: /home/userA/anaconda3/bin/.gcc-post-link.sh
    ==> script messages <==
    <None>
    ==> script output <==
    stdout: Installation failed: gcc is not able to compile a simple 'Hello, World' program.

    stderr: ln: failed to create symbolic link '/home/userA/anaconda3/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crt1.o': File exists
    ln: failed to create symbolic link '/home/userA/anaconda3/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crti.o': File exists
    ln: failed to create symbolic link '/home/userA/anaconda3/lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crtn.o': File exists
    /home/userA/anaconda3/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory

    return code: 1

    ()

Please advise. Happy to provide any additional helpful information.

***EDITED (most recent first):

OUTPUT of conda list | grep -E '(gmp|mpc|mpfr)

(base) userA@server:~$ conda list | grep -E '(gmp|mpc|mpfr)'
gmp                       6.1.2                hb3b607b_0    anaconda
gmpy2                     2.0.8            py37h10f8cd9_2
mpc                       1.1.0                h10f8cd9_1    anaconda
mpfr                      4.0.1                hdf1c602_3    anaconda
clebe
  • 61
  • 1
  • 8
  • Please add the output of `conda list | grep -E '(gmp|mpc|mpfr)'` to the question. Specifically, those are dependencies of `gcc` that seem to already be satisfied in your env, so we should know whence they came. Likely you need to ensure those are also installed from `anaconda` channel. – merv Oct 31 '19 at 22:34
  • 1
    Thanks @merv, just added the requested output – clebe Oct 31 '19 at 23:37
  • Okay, that actually looks fine. So a couple ways to go: 1) Try inspecting the `cc1` binary having the library problem with `ldd`; it should be found under `/home/userA/anaconda3/pkgs/gcc-4.8.5-7/...`. 2) Figure out the `crt1.o: File exists` error. Does it really already exist? That would imply you've already installed gcc v 4.8.5, but possibly a different build - or maybe installed but crashed. I'd probably start with (2). Also, does creating a new env with `gcc` work? and if it does, do you really need `gcc` in your **base**? – merv Nov 01 '19 at 01:11
  • @merv strange things going on over here. I tried creating a new env with gcc and got the error that gcc is not available in my current available channels. One of my channels is https://repo.anaconda.com/pkgs/main/linux-64, which includes gcc. Not sure what to make of that – clebe Nov 01 '19 at 18:29
  • Might be [on the **free** channel](https://stackoverflow.com/a/58220935/570918). – merv Nov 01 '19 at 18:36
  • @merv crt1.o is indeed present, the result of previous gcc failed install. I tried deleting the gcc directory from anaconda, to go for a fresh install. The heart of the issue seems to be here: `stderr: /home/userA/anaconda3/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory` – clebe Nov 01 '19 at 18:36
  • Is `/home/userA/anaconda3/lib/libmpfr.so.4` not there? Perhaps you need to force reinstall `mpfr`. – merv Nov 01 '19 at 18:39
  • @merv apparently gcc is no longer relevant in Anaconda v5 (which does not include libmpfr.so.4 in Ubuntu 18.04), should instead be installed as gcc_linux-64. It looks like I have some other issues going on with that install of gcc, that will require a separate question. Thanks for the help!! – clebe Nov 01 '19 at 19:10

1 Answers1

5

conda install gcc is no longer relevant in Anaconda v5, which prefers conda install gcc_linux-64

Anaconda v5 in Ubuntu 18.04 supports libmpfr.so.6 but not libmpfr.so.4, hence the issues with finding libmpfr.so.4

clebe
  • 61
  • 1
  • 8