Also, I recommend you do not name your library libmpi.so, since this name
is already used by Open MPI

Cheers,

Gilles

On Saturday, June 25, 2016, Jeff Squyres (jsquyres) <jsquy...@cisco.com>
wrote:

> On Jun 24, 2016, at 4:39 PM, Richard C. Wagner <drsav...@q.com
> <javascript:;>> wrote:
> >
> > Then I try to compile the library file in 32-bit mode.  The first
> command is:
> >
> > mpicc -fPIC -m32 -c libtest.c
> >
> > Then the second is:
> >
> > mpicc -shared -m32 -o libmpi.so libtest.o
> >
> > As you can see below, compiling the object file works.  But the second
> command, linking libtest.o and writing the shared library, fails.  Can you
> see what's wrong?
> >
> > rwagner@tuxcfd10:~/engrhome/CSU/LibTests$ mpicc -fPIC -m32 -c libtest.c
> > rwagner@tuxcfd10:~/engrhome/CSU/LibTests$ mpicc -shared -m32 -o
> libmpi.so libtest.o
> > /usr/bin/ld: skipping incompatible /usr//lib/libmpi.so when searching
> for -lmpi
> > /usr/bin/ld: skipping incompatible /usr/lib/openmpi/lib/libmpi.so when
> searching for -lmpi
> > /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../libmpi.so when searching for
> -lmpi
> > /usr/bin/ld: skipping incompatible //usr/lib/libmpi.so when searching
> for -lmpi
> > /usr/bin/ld: cannot find -lmpi
> > /usr/bin/ld: cannot find -lhwloc
> > collect2: error: ld returned 1 exit status
> >
> > And for added info, these two commands succeed when I don't use the -m32
> switch.  The library comes out as you'd expect it to, but as a 64-bit
> version.
>
> That means that the Open MPI installed in /usr/lib and /usr/lib/openmpi is
> a 64 bit version.
>
> You need to install a 32 bit version of Open MPI, and compile/link against
> that one.
>
> --
> Jeff Squyres
> jsquy...@cisco.com <javascript:;>
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
>
> _______________________________________________
> users mailing list
> us...@open-mpi.org <javascript:;>
> Subscription: https://www.open-mpi.org/mailman/listinfo.cgi/users
> Link to this post:
> http://www.open-mpi.org/community/lists/users/2016/06/29547.php
>

Reply via email to