<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Hi <span style="color:rgb(0,0,0);font-size:12.8px">Yanfei</span><span style="color:rgb(0,0,0);font-size:12.8px"> ,</span></div><div><br></div><div>Test file attached.</div><div><br></div>compile command:<div>/mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/bin/mpicxx -c -ftemplate-depth-200 -Wall -Wno-reorder -Wno-comment -Wno-unknown-pragmas -Wno-unused -Wno-non-virtual-dtor -W -fPIC -g -O2 -I/mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/include -o ./mpi_hello_world.o ./mpi_hello_world.cpp -MMD </div><div><br></div><div>link command:</div><div>/mpis/Mpich-3.2/mpich-3.2/Ubuntu14.04/bin/mpicxx -L/usr/lib/x86_64-linux-gnu/ -L/usr/lib/ -Wl,-rpath=/usr/lib -lcurses -lnsl -lpthread -ldl -lrt -rdynamic -o ./mpi_hello_world ./mpi_hello_world.o -L/usr/lib/x86_64-linux-gnu/ -lpthread<br><div><br></div></div><div><u>mpich-3.1</u></div><div>compile and link pass without any warning or errors.<u><br></u></div><div><br></div><div><u>mpich-3.2</u><br></div><div><ul><li>Program pass compile and link.<br></li><li>if you will remove comment from line with MPI_Recv, <b>link will fail</b>.<br></li></ul></div><div><br></div><div>Please advice,</div><div>Anatoly.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 3, 2017 at 8:22 PM, Guo, Yanfei <span dir="ltr"><<a href="mailto:yguo@anl.gov" target="_blank">yguo@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Anatoly,<br>
<br>
It looks like a linking order problem at the first glance. How did you compile and link using the static library?<br>
<br>
Yanfei Guo<br>
Postdoctoral Researcher<br>
MCS Division, ANL<br>
<div><div class="h5"><br>
<br>
On 1/3/17, 8:20 AM, "Anatoly G" <<a href="mailto:anatolyrishon@gmail.com">anatolyrishon@gmail.com</a>> wrote:<br>
<br>
    Dear MPICH,<br>
<br>
<br>
    I use MPICH 3.2 configured (without shared libraries):<br>
    ./configure --prefix=/mpis/Mpich-3.2/<wbr>mpich-3.2/Ubuntu14.04 --enable-error-checking=<wbr>runtime --enable-g=dbg CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fpic --enable-threads=runtime --enable-totalview<br>
    --enable-shared=no --disable-fortran<br>
<br>
<br>
<br>
    When I try to compile my program I get linkage errors:<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::File::Create_errhandler(<wbr>void (*)(MPI::File&, int*, ...))':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:693: undefined reference to `MPIR_Errhandler_set_cxx'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Comm::Create_errhandler(<wbr>void (*)(MPI::Comm&, int*, ...))':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:704: undefined reference to `MPIR_Errhandler_set_cxx'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Win::Create_errhandler(<wbr>void (*)(MPI::Win&, int*, ...))':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:714: undefined reference to `MPIR_Errhandler_set_cxx'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Comm::Create_keyval(int (*)(MPI::Comm const&, int, void*, void*, void*, bool&), int (*)(MPI::Comm&, int, void*, void*), void*)':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:510: undefined reference to `MPIR_Keyval_set_proxy'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Datatype::Create_keyval(<wbr>int (*)(MPI::Datatype const&, int, void*, void*, void*, bool&), int (*)(MPI::Datatype&, int, void*, void*), void*)':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:574: undefined reference to `MPIR_Keyval_set_proxy'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Win::Create_keyval(int (*)(MPI::Win const&, int, void*, void*, void*, bool&), int (*)(MPI::Win&, int, void*, void*), void*)':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:638: undefined reference to `MPIR_Keyval_set_proxy'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/src/binding/<wbr>cxx/initcxx.cxx:393: undefined reference to `MPIR_Op_set_cxx'<br>
    /mpis/Mpich-3.2/mpich-3.2/<wbr>Ubuntu14.04/lib/libmpicxx.a(<wbr>initcxx.o): In function `MPI::Comm::Reduce_scatter_<wbr>block(void const*, void*, int, MPI::Datatype const&, MPI::Op const&) const':<br>
    /mpis/Mpich-3.2/mpich_3.2_<wbr>config/mpich-3.2/./src/<wbr>binding/cxx/mpicxx.h:1490: undefined reference to `MPI_Reduce_scatter_block'<br>
    collect2: error: ld returned 1 exit status<br>
<br>
<br>
<br>
    When I configure MPI with shared libraries:<br>
    ./configure --prefix=/mpis/Mpich-3.2/<wbr>mpich-3.2/Ubuntu14.04 --enable-error-checking=<wbr>runtime --enable-g=dbg CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fpic --enable-threads=runtime --enable-totalview --disable-fortran<br>
<br>
<br>
<br>
    my program's build completed correctly.<br>
<br>
<br>
    When I used MPICH 3.1 I didn't see these problems.<br>
    Can you please advice?<br>
<br>
<br>
    Regards,<br>
    Anatoly.<br>
<br>
<br>
<br>
<br>
<br>
</div></div>______________________________<wbr>_________________<br>
discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
</blockquote></div><br></div>