Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
compiler flag combination prevents ld from finding libraries
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
idiv0
n00b
n00b


Joined: 02 Nov 2014
Posts: 6

PostPosted: Thu Nov 27, 2014 12:33 pm    Post subject: compiler flag combination prevents ld from finding libraries Reply with quote

I'm trying to build sci-biology/mauvealigner. I've located the error and how to get around it but I'm not sure how to edit the Makefile/how to get the ebuild to complete the operation.

Code:
x86_64-pc-linux-gnu-g++ -O2 -funroll-loops -fomit-frame-pointer -ftree-vectorize   -DCOMMAND_LINE  -march=native -O2 -pipe -O2 -funroll-loops -fomit-frame-pointer -ftree-vectorize    -Wl,-O1 -Wl,--as-needed -o mauveAligner mauveAligner.o -L/usr/lib -lMems-1.6 -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_iostreams-mt -lrt -lpthread -lGenome-1.3 -lMUSCLE-3.7   
x86_64-pc-linux-gnu-g++ -O2 -funroll-loops -fomit-frame-pointer -ftree-vectorize   -DCOMMAND_LINE  -march=native -O2 -pipe -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -Wl,-O1 -Wl,--as-needed -o mauveStatic mauveAligner.o -L/usr/lib -lMems-1.6 -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_iostreams-mt -lrt -lpthread -lGenome-1.3 -lMUSCLE-3.7   
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_system-mt
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_filesystem-mt
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_program_options-mt
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_iostreams-mt


The first compile works fine but the second one has issues, even though the same library is being referenced.
So far I've found 2 ways to get it to compile manually:
  • remove the -static flag
  • remove the -mt from the end of the boost libraries, they are symlinks to the same file afterall


Anyone know how I could make changes for the build to go through/how to fix the linker errors?
Back to top
View user's profile Send private message
idiv0
n00b
n00b


Joined: 02 Nov 2014
Posts: 6

PostPosted: Thu Nov 27, 2014 1:07 pm    Post subject: Reply with quote

This is a bit silly.

I forgot about static libraries and how they end in .a.
While libboost_system-mt.so was symlinked to libboost_system.so, there was no link from libboost_system-mt.a to libboost_system.a.

Creating the links caused the build to pass.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum