ilastik/ilastik-conda-recipes

Ubuntu 14.04 installing our package GCC fails to compile "Hello World"

chaubold opened this issue · 4 comments

@ilastikdev and I tried to use conda on Ubuntu 14.04 to get a development environment set up to compile pgmlink, and it took a while until we noticed why we could not install GCC. To try this on your own, do the following:

conda create -n foobar -c ilastik ilastik-everything
conda install -c ilastik gcc

Which leads to the following error:

/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
Installation failed: gcc is not able to compile a simple 'Hello, World' program.
Error: Error: post-link failed for: gcc-4.8.2.99-linux_portable

Interestingly, installing GCC in a new environment sometimes works, but not always (we didn't find a pattern yet). But specifying CPLEX_ROOT_DIR=/your/path in the same command line as conda create fixes the problem, then it always succeeds (which is the way of installing the cplex-shared package that needs GCC).

Meaning: the instructions in the README do not work on Ubuntu if you want to be able to compile C++ projects against the conda environment.

It took me a while, but I see what happened. Long story short: There is already a fix for this issue in my PR to conda-recipes (conda-archive/conda-recipes#279), but I apparently forgot to incorporate that fix into our binary package in the ilastik binstar channel.

I just repackaged gcc-4.8.2.99 and uploaded it to our channel. You should be good to go.

BTW, the reason it failed for you is that you are installing gcc into your root conda environment. With today's fix, it will work, but I think it's generally a bad idea to install stuff to your root environment.

Interestingly, installing GCC in a new environment sometimes works, but not always (we didn't find a pattern yet).

It will work whenever typing which gcc from your environment (before installation, of course) returns /usr/bin/gcc, and it will probably fail otherwise. Check your PATH.

the instructions in the README do not work on Ubuntu if you want to be able to compile C++ projects against the conda environment.

I don't think the README ever says to install gcc to the root environment, so I think we're okay. In any case, it should work now.

Hmmm, BTW, it looks like conda isn't smart enough to recognize that I bumped the build number for our gcc package -- it's just looking at the tarball file name, which I didn't change. To get the new version, you will need to use the --force flag:

conda install -c ilastik gcc --force

Oh excuse me, I forgot to put the source activate foobar line in the first post. I did not install gcc in my conda root environment ever, it did fail in the foobar environment. Anyway, thanks for the fix.

Hmm, then I may be wrong about the failure mechanism. Anyway, I was able to reproduce your error on a fresh Ubuntu 14.04 VM, and the error goes away now.

BTW, if you ever attempt to install gcc and ilastik using only ONE call to conda, there is a small chance you'll be hit with conda/conda-build#401 (which affects any package containing a post-install script).

Therefore, always install gcc separately, as you did above.

# NO:
conda install -c ilastik ilastik-everything gcc

# YES:
conda install -c ilastik ilastik-everything
conda install -c ilastik gcc