[mvapich-discuss] Cannot run test mpirun after install mvapich.

Shaun Rowland rowland at cse.ohio-state.edu
Fri Jul 6 02:08:12 EDT 2007


phan nguyen wrote:
> HI Mat,
> I have another problem with MPICH+infinipath
> 
> This is the error when compiling with my code
> 
> /usr/bin/ld: /ixdata/IX_Software/mvapich/lib/libpmpich++.a(intercepts.o):
> relocation R_X86_64_32S against `a local symbol' can not be used when making
> a shared object; recompile with -fPIC
> /ixdata/IX_Software/mvapich/lib/libpmpich++.a: could not read symbols: Bad
> value
> collect2: ld returned 1 exit status
> 
> I know that this library has to be compiled with -fPIC flag some where in
> the make file, try to add this to the CFLAGS section but still doesn't work.
> Please help

Is your code trying to create its own shared library, or is this the
result of building a standalone program using mpicxx/mpiCC? It seems you
built MVAPICH with static libraries. Does it work if you edit mpicxx and
mpiCC and change the following (it should be line 83, or close):

CXXFLAGS="-I${includedir}/mpi2c++  -fexceptions"

to:

CXXFLAGS="-I${includedir}/mpi2c++  -fexceptions -fPIC"

thus adding -fPIC there? Another option might be to try building MVAPICH
with shared libraries by adding:

--enable-sharedlib

to the configure line in make.mvapich.vapi and then applying the 
following patch to configure:

--- CUT HERE ---
Index: configure
===================================================================
--- configure   (revision 1361)
+++ configure   (working copy)
@@ -6674,6 +6674,7 @@
          # This isn't quite right, but it will work for some systems
          # Export the shared option to the MPI-2-C++ configure
          CXXFLAGS_FOR_SHARED=$CC_SHARED_OPT
+        CXXFLAGS="$CXXFLAGS $CC_SHARED_OPT"
      fi
      if test "$SHAREDKIND" != "ignore" ; then
          # Fortran choices
--- CUT HERE ---

That should result in mpicxx/mpiCC having the same fix as in the static
case I mentioned above. If you could try either of these and let us know
if that works - and also if you are trying to build a shared library
against the static C++ library that's generated, that would be very helpful.
-- 
Shaun Rowland	rowland at cse.ohio-state.edu
http://www.cse.ohio-state.edu/~rowland/


More information about the mvapich-discuss mailing list