Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Exclamation MPICH2 error: relocation R_X86_64_32 against `.rodata.str1.8'


    I was installing GROMACS, a molecular dynamics solver with MPI in my server. I have installed mpich2 using --enable-shared option and still I'm getting an error like this:

    [ 6%] Linking CXX shared library ../../lib/libgromacs_mpi.so
    /usr/bin/ld: /usr/local/lib/libmpich.a(allreduce.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/libmpich.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make[2]: *** [lib/libgromacs_mpi.so.1.4.0] Error 1
    make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
    make: *** [all] Error 2

    Can anybody help to solve it?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    14,038
    Just what it said. You need to compile the libraries with the -fPIC flag (PIC == Position Independent Code). Without this you need to use static libraries, otherwise the linker cannot resolve the machine code symbols.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    I installed mpich2 with --enable-shared option and CXXFLAGS='-fPIC' options... Still it doesn't work...

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    14,038
    -->
    My point was that all the interacting libraries need to be rebuilt with these options, not just MPICH2. In any case, what errors are you getting when either linking or executing your code?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •