1

I have compiled mpich 3.2 with gcc 4.8.3 on centos. Everything seems to be fine. Then I wrote a simple test program,

#include "mpi.h"
int main(int argc,char **argv)
{}

and use the mpic++ to compile. Then errors return,

/home/setups/mpich-3.2/build/lib/libmpi.so: undefined reference to _intel_fast_memcpy' /home/setups/mpich-3.2/build/lib/libmpi.so: undefined reference to__intel_sse2_strncmp' /home/setups/mpich-3.2/build/lib/libmpi.so: undefined reference to _intel_fast_memset' /home/setups/mpich-3.2/build/lib/libmpi.so: undefined reference to__intel_sse2_strlen'

What exactly goes wrong? I'm so confused that the error seems to be related with intel compilers, but I use gcc to compile mpich by the command,

./configure --prefix=/home/setups/mpich-3.2/build/ CC=gcc CXX=gcc F77=gfortran FC=gfortran

I have added /home/setups/mpich-3.2/build/bin to PATH and /home/setups/mpich-3.2/build/lib to LD_LIBRARY_PATH

mpicc -v shows:

mpicc for MPICH version 3.2
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/setups/gcc-4.8.3/build/libexec/gcc/x86_64-unknown-linux-gnu/4.8.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/setups/gcc-4.8.3/build --with-gmp=/home/setups/gmp-6.1.2/build --with-mpfr=/home/setups/mpfr-3.1.5/build --with-mpc=/home/setups/mpc-1.0.3/build --disable-multilib
Thread model: posix
gcc version 4.8.3 (GCC)
5
  • 1
    How do you setup your paths? What does mpicc -v print? What does which mpicc print? How did you configure mpich? Commented Apr 3, 2017 at 17:37
  • CXX is the program to compile C++ files and in your case g++ Commented Apr 3, 2017 at 19:02
  • @VladimirF I added the path to mpicc in PATH. mpicc -v seems to be fine. I have added the output of mpicc -v in my quesion. Commented Apr 4, 2017 at 2:49
  • @Arash Do you mean I should use CXX=g++ in the configure? I tried but the problem is not solved. Commented Apr 4, 2017 at 2:56
  • Take a look at the config.log file in the same folder that you run the ./configure script. Look for anything intel related in the log file. Also look for errors/warnings. Commented Apr 4, 2017 at 5:05

2 Answers 2

0

You might find your solution at the open-mpi.org site and their faq for building MPI. For example, item 17.

A common mistake when building Open MPI with the Intel compiler suite is to accidentally specify the Intel C compiler as the C++ compiler. Specifically, recent versions of the Intel compiler renamed the C++ compiler "icpc" (it used to be "icc", the same as the C compiler). Users accustomed to the old name tend to specify "icc" as the C++ compiler, which will then cause a failure late in the Open MPI build process because a C++ code will be compiled with the C compiler. Bad Things then happen. The solution is to be sure to specify that the C++ compiler is "icpc", not "icc". For example:

https://www.open-mpi.org/faq/?category=building

Sign up to request clarification or add additional context in comments.

Comments

0

/home/setups/mpich-3.2/build/lib/libmpi.so: undefined reference to _intel_fast_memcpy'

This strongly suggests an Intel compiler was used to build mpich.

That can happen is gcc/g++/gfortran is not in your PATH or if your environment points to the Intel compiler (e.g. CC=icc or CXX=icpc or FC=ifort).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.