Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2154 Discussions

boost::mpi linker error by using intel MPI

Nishikawa__Mitsuru
2,157 Views

Dear experts

I confront the problem in linking error using boost::mpi when my executable is linked to my static library (which contains boost::mpi) I constructed.
The error is almost due to undefined reference to such as ompi_mpi_comm_null, which seems types in open mpi.

I know intel MPI is based on MPICH so that referring such a type is strange.

 

Through compiling the library, I used intel compiler (mpiicc & mpiicpc).

If you know how to resolve it, I would appreciate it if you could advice me.

0 Kudos
1 Solution
PrasanthD_intel
Moderator
2,157 Views

Hi Mitsuru,

Regarding your question, two MPI runtimes cannot run at the same time.

Since you are getting OpenMPI dependencies from a 3rd party library, you can try to rebuild it with Intel MPI.

 

Regards

Prasanth

View solution in original post

0 Kudos
8 Replies
dsi-intel_d_
Beginner
2,157 Views

> Through compiling the library, I used intel compiler (mpiicc & mpiicpc).

Which library ? yours or boost ?

Also, how was boost mpi configured ? there are a few bugs and instabilities in Intel's MPI wrapper so the boost mpi configuration can be tricky depending on the Intel's version.

Can you tell us where are the undefined symbols used ? Sometime it's mentioned in the error message.

Alain

0 Kudos
Nishikawa__Mitsuru
2,157 Views

Dear dsi-intel d.          

 

Thank you for your kind reply.

 

> Which library ? yours or boost ?

I intended to compile both by intel MPI compiler (boost ver1.66, intel compiler (mpiicpc) is ver 19.03.199), probably.

 

When building boost::mpi, I just added the below sentence in the to_boost_dir/project-config.jam

> using mpi : mpiicc;

 

In my project, MPI-dependent libraries are

(1) boost mpi library (libboost_mpi.a)

(2) intel MPI library (libmpi_ilp64.a)

(3) my own library (mylib.a, psuedo name), which use boost::mpi

Probably, (1)&(3) are compiled by intel MPI compiler.

open-mpi based symbols just exists in (3) (I confirmed by using "nm" command).

 

If you have some advice, I would appreciate it if you could help me.

 

Kind regards

 

0 Kudos
GouthamK_Intel
Moderator
2,157 Views

Hi Mitsuru,

We have installed Boost MPI in the following manner. 

cd path/to/boost_dir

./bootstrap.sh --prefix=path/to/installation/prefix

which mpiicc

 

Depending on your MPI implementation, some work might be needed to tell Boost which specific MPI option to use. This is done through the using mpi ; directive in the project-config.jam file those general form is (do not forget to leave spaces around : and before ; )

Add the below lines at the end of project-config.jam file

# MPI 

using mpi : /path/bin/mpiicc ;

 

Now add toolset=intel for b2 before building

$ b2 --prefix=/path/boost_install/ toolset=intel install


To compile your program, you will need to add -I/boost/install/path/include option while invoking the compiler.

 

 

By following the above steps we are able to compile and run the application.

If you are still facing the same issue after following the above steps please provide your source code if possible. So that we will investigate more about your issue.

 

Regards

Goutham

0 Kudos
Nishikawa__Mitsuru
2,157 Views

Dear Kuncham, Goutham Kalikrishna Reddy,

 

Thank you for your detailed reply, and I apologize for my delayed response.

As you told me, there is some compilation/installation mismatch of boost mpi in intel compiler.

 

I am willing to check and test as you suggested.

If I confront some problems,

I would appreciate it if you could advice me.

 

Kind regards

0 Kudos
Nishikawa__Mitsuru
2,157 Views

I rebuilt boost mpi according to the previous advice(and confirmed it was built by intel mpi compiler), but still confronted the same error.

 

Here, I noticed that there is openmpi dependent 3rd-party library(vtk). So, I suppose that this caused my linker error.

 

Now, my questions are

(1) can intel mpi library coexist with openmpi middleware? (If so, correct solution is to link openmpi libraries)

(2) If not, is it impossible to use openmpi-dependent library with intel compiler?

(is there some technique? is it inevitable to build the 3rd party library also by intel mpi compiler?)

 

I appreciate your cooperation.

 

Kind regards

 

0 Kudos
GouthamK_Intel
Moderator
2,157 Views

Hi Mitsuru,

If possible, could you please share the source code for which you are facing the issue. So that we will be able to investigate more on the issue. 

Also please do share steps to reproduce, error logs of the output.

If your code requires any third-party libraries, let us know the versions which you have installed. 

 

Regards

Goutham

0 Kudos
PrasanthD_intel
Moderator
2,158 Views

Hi Mitsuru,

Regarding your question, two MPI runtimes cannot run at the same time.

Since you are getting OpenMPI dependencies from a 3rd party library, you can try to rebuild it with Intel MPI.

 

Regards

Prasanth

0 Kudos
PrasanthD_intel
Moderator
2,157 Views

Hi Mitsuru,

We are closing this thread considering your issue got resolved with the given suggestions.

Please raise a new thread for any further queries.

 

Regards

Prasanth

0 Kudos
Reply