[mpich-discuss] MPI static library link problem.

Guo, Yanfei yguo at anl.gov
Tue Jan 3 12:22:05 CST 2017


Hi Anatoly,

It looks like a linking order problem at the first glance. How did you compile and link using the static library?

Yanfei Guo
Postdoctoral Researcher
MCS Division, ANL


On 1/3/17, 8:20 AM, "Anatoly G" <anatolyrishon at gmail.com> wrote:

    Dear MPICH,
    
    
    I use MPICH 3.2 configured (without shared libraries):
    ./configure --prefix=/mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04 --enable-error-checking=runtime --enable-g=dbg CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fpic --enable-threads=runtime --enable-totalview
    --enable-shared=no --disable-fortran
    
    
    
    When I try to compile my program I get linkage errors:
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::File::Create_errhandler(void (*)(MPI::File&, int*, ...))':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:693: undefined reference to `MPIR_Errhandler_set_cxx'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Comm::Create_errhandler(void (*)(MPI::Comm&, int*, ...))':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:704: undefined reference to `MPIR_Errhandler_set_cxx'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Win::Create_errhandler(void (*)(MPI::Win&, int*, ...))':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:714: undefined reference to `MPIR_Errhandler_set_cxx'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Comm::Create_keyval(int (*)(MPI::Comm const&, int, void*, void*, void*, bool&), int (*)(MPI::Comm&, int, void*, void*), void*)':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:510: undefined reference to `MPIR_Keyval_set_proxy'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Datatype::Create_keyval(int (*)(MPI::Datatype const&, int, void*, void*, void*, bool&), int (*)(MPI::Datatype&, int, void*, void*), void*)':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:574: undefined reference to `MPIR_Keyval_set_proxy'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Win::Create_keyval(int (*)(MPI::Win const&, int, void*, void*, void*, bool&), int (*)(MPI::Win&, int, void*, void*), void*)':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:638: undefined reference to `MPIR_Keyval_set_proxy'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/src/binding/cxx/initcxx.cxx:393: undefined reference to `MPIR_Op_set_cxx'
    /mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/lib/libmpicxx.a(initcxx.o): In function `MPI::Comm::Reduce_scatter_block(void const*, void*, int, MPI::Datatype const&, MPI::Op const&) const':
    /mpis/Mpich-3.2/mpich_3.2_config/mpich-3.2/./src/binding/cxx/mpicxx.h:1490: undefined reference to `MPI_Reduce_scatter_block'
    collect2: error: ld returned 1 exit status
    
    
    
    When I configure MPI with shared libraries: 
    ./configure --prefix=/mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04 --enable-error-checking=runtime --enable-g=dbg CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fpic --enable-threads=runtime --enable-totalview --disable-fortran
    
    
    
    my program's build completed correctly.
    
    
    When I used MPICH 3.1 I didn't see these problems.
    Can you please advice?
    
    
    Regards,
    Anatoly.
    
    
    
    

_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list