You are here

/usr/bin/ld: cannot find -lmpi_cxx

3 posts / 0 new
Last post
/usr/bin/ld: cannot find -lmpi_cxx

Hii everyone

m trying to install rosetta2.3 in mpi mode with the command line

scons cxx=gcc mode=release extras=mpi

The installation ends with error
/usr/bin/ld: cannot find -lmpi_cxx
collect2: ld returned 1 exit status
scons: *** [build/src/release/linux/2.6/64/x86/gcc/3.4/mpi/rosetta++/rosetta.release] Error 1
scons: building terminated because of errors.

The path for openmpi/lib , /bin and lib are defined properly in basic.settings and user settings in rosetta++/tools/build . Plzz suggest a solution to it.

thank u

Fri, 2010-05-07 10:41

here is my compiling procedure:

######### compile note for Rosetta 2.3 ##############
# system: Ubuntu 9.10,
# compiler: gcc/g++ 4.1, 4.2, 4.3, 4.4; only 4.1 worked
# other packages: apt-get install scons

## ! tricky: use GCC 4.1 !
because the default /usr/bin/gcc is linked to gcc-4.4 which does not work in compile, a simple way is to LINK /usr/bin/gcc to /usr/bin/gcc-4.1 !

# compile the standard version:
scons -j2 mode=release

the output binary is: build/src/release/linux/2.6/64/x86/gcc/rosetta++/rosetta.release

# compile the MPI version
dependent package: apt-get install mpi-default-bin mpi-default-dev openmpi-bin libopenmpi-dev
be sure that the mpiCC is a wrapper to g++-4.1

by default, rosetta++ is compiled in static mode, so it is required to link all dependent libs:
change the config file "tools/build/basic.settings", at about line 411, change the codes to:
"gcc, mpi" : {
"appends" : {
"defines" : [[ "USEMPI" ],
"libraries" : [[ "mpi", "open-rte", "open-pal", "ibverbs", "rt", "nsl", "util", "m", "dl", "pthread" ],
"overrides" : {
"cc" : "mpicc -Wno-long-long",
"cxx" : "mpiCC -Wno-long-long",

scons -j2 mode=release extras=mpi

the output binary is: build/src/release/linux/2.6/64/x86/gcc/mpi/rosetta++/rosetta.release

Mon, 2010-06-14 01:09

I want to reply to this because I spent a week trying to figure out a similar problem of /usr/bin/ld cannot find -lz. I was trying to build without mpi and all the posts I saw were for mpi and they didn't apply or didn't work, so hopefully this will help. I am running ubuntu 12.0.4 LTS with g++/gcc I think. I found the answer in this blog

it boiled down to me missing the libz-dev (This was under the G++ command line so -l means lib, z = the name -lz) for ubuntu users try this:
if you don't have it install apt-file
sudo apt-get install apt-file
then run apt-file update to log everything
sudo apt-file update
then search for missing libx (libz in my case)
apt-file search libz
it will give you a bunch of libz locations and if you don't see your libx-dev you need to install it
sudo apt-get install libz-dev
(if you hit tab and do a search the archives for libz it doesn't show up do don't count on that working just type this code and it will find the site it's located)

Sorry if this was basic for many people but I am a beginner and I spent a very long time trying to find out how to solve this. Hopefully this will help other beginners as well, and it was a very simple fix. If anyone knows why we shouldn't do this please respond like I said I am just learning a lot of these things. Is this a good fix for all /usr/bin/ld cannot find -llibrary_name?

refer to thread posted for what output should look like if you are missing your lib-dev, their example is libcr

Sun, 2012-09-16 15:30