#84 Linking error?

Issue #84 resolved
Former user created an issue

Hello everyone! Hope I am not duplicating, but as far as I could tell other issues are slightly different or it may well be, that my extremely limited knowledge in C++ denies me from drawing useful insight from answers that have already been given.
In either case, I could really use help solving this linking error at “make” step of installing metabat2 in a server with user only rights.

Here is the block of code, where things start to get bad:

Building CXX object src/CMakeFiles/metabat2.dir/metabat2.cpp.o
Linking CXX executable metabat2
CMakeFiles/metabat2.dir/metabat2.cpp.o: In function 'output_bins(std::unordered_map<int, std::vector<int, std::allocator<int> >, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int> > > > >&) [clone ._omp_cpyfn.14]':metabat2.cpp:(.text+0x1625): undefined reference to 'std::vector <int, std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&)'
collect2: error: ld returned 1 exit status
src/CMakeFiles/metabat2.dir/build.make:102: recipe for target 'src/metabat2' failed
make [2]: *** [src/metabat2] Error 1
CMakeFiles/Makefile2:204: recipe for target 'src/CMakeFiles/metabat2.dir/all failed
make [1]: *** [src/CMakeFiles/metabat2.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

I have just updated the cmake, and other dependencies are fine.

I would very much appreciate your input, as I have been stuck with this for a couple of days now, and I betafraid those metagenomic assemblies won’t bin themselves!

Cheers

Artur

Comments (4)

  1. Rob Egan

    Hi Artur,

    That is odd. It looks like OpenMP is failing to build a linkable object, so perhaps multiple compilers are being used for some reason. What is your platform, compiler and version?

    Please attach the full log from the cmake and make commands.

    Thanks,

    Rob

  2. Former user Account Deleted reporter

    Hi, Rob, thanks for getting back to me!
    I work on Debian 9. I am not sure how exactly to answer your compiler question, so I’ll just give you the versions of the tools in the requirement:

    boost 1.62

    python 2/3

    cmake 3.8.2

    g++/gcc 6.3.0

    no intel, no llvm

    Unfortunately I am sick and am working from home through a remote access client, and I can’t copy the text from there (text you’re seeing I rewrote)
    If screenshots work for you, here they are:

  3. Rob Egan

    Thanks for this.

    So I don’t have gcc 6.3.0 installed anywhere, but I can confirm that it builds okay for 6.5.0 and that it does NOT build for gcc 5.4.0, albeit with a different error message than you are observing but indicating the same area of the code and usage of a newly introduced private variable. I just pushed a fix 376f5b88676f which allows gcc 5.4.0 to compile and work. I believe 4.9 should also still work, though in my environment boost fails to link with that regression because of glibc regression on my OS.

    Can you please try the latest commit and let me know if that helps?

    -Rob

  4. Log in to comment