<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div><span style="color:rgb(0,0,0);font-size:12.8px">Hi </span><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><br></div><div><br></div><div>It works.<br></div>Thank you very much. <div>I should review my compile / link flags.<br></div><div><br></div><div>Regards,</div><div>Anatoly.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 4, 2017 at 10:38 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>
I tried you example and cannot reproduce the problem. I saw your compile and link command has many options that are redundant. mpicxx will give the essential options for compile and link with MPICH (see `mpicxx –show`).<br>
<br>
Can you try compile and link it with simple options (like the following commands)?<br>
<br>
mpicxx –o mpi_hello_world.o –c mpi_hello_world.cpp<br>
mpicxx –o mpi_hello_world mpi_hello_world.o<br>
<span class=""><br>
Yanfei Guo<br>
Postdoctoral Researcher<br>
MCS Division, ANL<br>
<br>
<br>
</span><span class="">On 1/4/17, 2:12 AM, "Anatoly G" <<a href="mailto:anatolyrishon@gmail.com">anatolyrishon@gmail.com</a>> wrote:<br>
<br>
Hi Yanfei ,<br>
<br>
<br>
Test file attached.<br>
<br>
<br>
compile command:<br>
/mpis/Mpich-3.2/mpich-3.2/<wbr>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/<wbr>Ubuntu14.04/include -o ./mpi_hello_world.o ./mpi_hello_world.cpp<br>
-MMD<br>
<br>
<br>
link command:<br>
/mpis/Mpich-3.2/mpich-3.2/<wbr>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>
<br>
<br>
<br>
mpich-3.1<br>
compile and link pass without any warning or errors.<br>
<br>
<br>
<br>
mpich-3.2<br>
<br>
<br>
</span> * Program pass compile and link.<br>
<br>
* if you will remove comment from line with MPI_Recv, link will fail.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
Please advice,<br>
Anatoly.<br>
<br>
<br>
<br>
<br>
On Tue, Jan 3, 2017 at 8:22 PM, Guo, Yanfei<br>
<<a href="mailto:yguo@anl.gov">yguo@anl.gov</a>> wrote:<br>
<br>
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>
<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>
<br>
<br>
______________________________<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>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<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></div></div></blockquote></div><br></div>