[mvapich-discuss] How to set link libraries and flags

Jonathan Perkins perkinjo at cse.ohio-state.edu
Wed Mar 26 20:40:23 EDT 2014


Hello Daniel.

Your observation about mpicc --show is consistent with the shared
library requirements of mvapich2.  I believe the other libraries may
be needed by OpenFOAM.  Since you're compiling cplusplus code I
believe that you will need the following -lmpichcxx, -lopa, and -lmpl.

The following is a snippet of the mpi.h file (before configure
processes it).  To answer your question about MPICH_SKIP_MPICXX, I
believe that you want to set this if you're using the c++ compiler but
don't want to use the c++ bindings.

#if defined(__cplusplus)
}
/* Add the C++ bindings */
/*
   If MPICH_SKIP_MPICXX is defined, the mpicxx.h file will *not* be included.
   This is necessary, for example, when building the C++ interfaces.  It
   can also be used when you want to use a C++ compiler to compile C code,
   and do not want to load the C++ bindings.  These definitions can
   be made by the C++ compilation script
 */
#if !defined(MPICH_SKIP_MPICXX)
/* mpicxx.h contains the MPI C++ binding.  In the mpi.h.in file, this
   include is in an autoconf variable in case the compiler is a C++
   compiler but MPI was built without the C++ bindings */
@INCLUDE_MPICXX_H@
#endif
#endif

On Wed, Mar 26, 2014 at 3:22 PM, Daniel WEI <lakeat at gmail.com> wrote:
> Dear List,
>
> Newbie here. I am compiling a CFD open source code OpenFOAM (c++) on my
> school's intel XEON NON Blocking Infiniban Mellanox HBA cluster. I am using
> mvapich2's latest SVN snapshot, should be mvapich2-2.0.
>
> My questions are,
> 1. What does flag "DMPICH_SKIP_MPICXX" mean? When should I use it?
> 2. Which libraries of the following should be linked with when compiling my
> code,
>
> --------------------------------
> -lmpich
> -lmpichcxx
> -lopa
> -lmpl
> -lrt
> -lpthread
> --------------------------------
>
> I saw "mpicc -show" only gives "-lmpich -lopa -lmpl". Then should only these
> three be linked? librt and libpthread are not in mvapich2/lib folder, should
> they be linked?  libmpichcxx is in the mvapich2/lib folder, should it be
> linked since I am compiling a C++ code?
>
> My mvapich2 is configures with:
>
> --------------------------------
> $ mpiname -a
> MVAPICH2 2.0b unreleased development copy ch3:mrail
>
> Compilation
> CC: icc -m64 -fPIC   -g -DNDEBUG -DNVALGRIND -O2
> CXX: icpc -m64 -fPIC  -g -DNDEBUG -DNVALGRIND -O2
> F77: gfortran -L/lib -L/lib   -g -O2
> FC: ifort   -g -O2
>
> Configuration
> --prefix=/afs/crc.nd.edu/user/z/zwei1/OpenFOAM/ThirdParty-2.3.0/platforms/linux64Icc/mvapich2-2.0
> CC=icc FC=ifort CXX=icpc --with-device=ch3:mrail --with-rdma=gen2
> --enable-g=dbg --enable-shared --enable-debuginfo --without-psm
> --disable-checkerrors --enable-embedded-mode
> --------------------------------
>
>
> Thanks a lot,
> Daniel
>
> _______________________________________________
> mvapich-discuss mailing list
> mvapich-discuss at cse.ohio-state.edu
> http://mailman.cse.ohio-state.edu/mailman/listinfo/mvapich-discuss
>



-- 
Jonathan Perkins
http://www.cse.ohio-state.edu/~perkinjo


More information about the mvapich-discuss mailing list