Discussion:
mpich2 installation problem
(too old to reply)
george
2010-06-23 10:53:36 UTC
Permalink
Hello,

I am a student and I am taking a ourse on MPI.
I tried to install mpich2 on my laptop so that I can compile and run
programs without having to log in the University Cluster all the time.
I was following the installation instructions and everything seemed fine
until I tried to compile my first program.
It is an example program provided with the mpich2 source code.
The error I am getting is the following:


$ mpicc cpi.c -o cpi
/usr/bin/ld: cannot find -lopa
collect2: ld returned 1 exit status

My programs give me the same error as this one.
Even if they run normally on the University Cluster.

I couldn't find any information on this -lopa option.

Does anyone now how to fix this?

I will see my instructors later today and ask them about my problem but
if it is possible I would like to solve this problem without their help.

Any information on this will be very helpful.
Thank you very much for your time
Michael Hofmann
2010-06-23 16:10:42 UTC
Permalink
Post by george
Hello,
I am a student and I am taking a ourse on MPI.
I tried to install mpich2 on my laptop so that I can compile and run
programs without having to log in the University Cluster all the time.
I was following the installation instructions and everything seemed fine
until I tried to compile my first program.
It is an example program provided with the mpich2 source code.
$ mpicc cpi.c -o cpi
/usr/bin/ld: cannot find -lopa
collect2: ld returned 1 exit status
My programs give me the same error as this one.
Even if they run normally on the University Cluster.
I couldn't find any information on this -lopa option.
"-l..." is an option, that tells the linker (in your case "/usr/bin/ld")
to link the program against a specific library (in your case "libopa").

You can search for the location of the file "libopa.a" in your MPICH2
installation and submit their directory path with option "-L" to the linker:

mpicc -L<directory_of_libopa> cpi.c -o cpi

However, in a proper MPICH2 installation this path should already be
known to "mpicc". So it looks like there is something wrong with your
MPICH2 installation.

Have you installed MPICH2 from source? Some Linux distributions already
have appropriate MPICH2 packages in their repositories that can be used
for developing very well.


Michael
george
2010-06-24 14:47:44 UTC
Permalink
Post by Michael Hofmann
Post by george
Hello,
I am a student and I am taking a ourse on MPI. I tried to install
mpich2 on my laptop so that I can compile and run programs without
having to log in the University Cluster all the time. I was following
the installation instructions and everything seemed fine until I tried
to compile my first program. It is an example program provided with the
$ mpicc cpi.c -o cpi
/usr/bin/ld: cannot find -lopa
collect2: ld returned 1 exit status
My programs give me the same error as this one. Even if they run
normally on the University Cluster.
I couldn't find any information on this -lopa option.
"-l..." is an option, that tells the linker (in your case "/usr/bin/ld")
to link the program against a specific library (in your case "libopa").
You can search for the location of the file "libopa.a" in your MPICH2
mpicc -L<directory_of_libopa> cpi.c -o cpi
However, in a proper MPICH2 installation this path should already be
known to "mpicc". So it looks like there is something wrong with your
MPICH2 installation.
Have you installed MPICH2 from source? Some Linux distributions already
have appropriate MPICH2 packages in their repositories that can be used
for developing very well.
Michael
You were right Michael.
I didn't check the repositories because someone told me that I had to
install it from source.
Anyway, I should have checked first.
It works now.

Thank you very much

Loading...