I am attempting to compile a simple MPI program for native execution on Xeon Phi. I can successfully compile for the host using mpiicc, but when I add the -mmic flag it seems to hang for quite a while and then I get:
/opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpiicc: line 116: /opt/intel/compilers_and_libraries_2016.0.109/linux/mpi/intel64/bin/mpiicc: Argument list too long
Line 116 of mpiicc below is exec mpiicc "$@". Looking at the code, I suspect this is getting caught in a recursive loop as it calls mpiicc again with the same argument list. Being so basic I don't doubt it is an environment problem, but looking at this I don't understand how it was supposed to work.
# Recognize the '-mmic' compiler switch.
for arg in "$@" ; do
{
if [ "${arg}" = "-mmic" ] ; then
. ${prefix}/mic/bin/mpivars.sh
if [ -n "$VT_ROOT" ]; then
if [ -f "$VT_ROOT/mic/bin/itacvars.sh" ]; then
. "$VT_ROOT/mic/bin/itacvars.sh"""
fi
fi
exec mpiicc "$@"
fi
}
Thanks in advance.
B