On Oct 22, 12:59 pm, Thomas Robitaille <
thomas.robitai...@gmail.com>
wrote:
>
Hi.
> ld: /usr/local/packages/mvapich2-0.98-intel10.1/lib/libmpich.a
> (comm_create_keyval.o): relocation R_X86_64_32 against `MPIR_Process'
> can not be used when making a shared object; recompile with -fPIC
You should use a MPI build with shared libraries... mpi4py can still
work with a static MPI lib, but I really recommend you to not do that.
However, this error comes from the linker, it seems that in your
system it is not possible to use a non-PIC static lib to build a
shared one... So in short, you should:
1) Rebuild MPI with support for shared libraries, then rebuild mpi4py,
all should work out of the box.
2) If for some very important reason you still need to stay with a
static lib MPI build, then rebuild your MPI making sure that -fPIC
flag is passed to the compiler, "./configure CFLAGS=-fPIC ... " is
usually enough (or also "export CFLAGS=-fPIC" before "./
configure ...")... However, I have to insist: you do not want to mix
static libraries and Python extension modules, trust me