@rem = '--*-Perl-*--
@echo off
if /i "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!perl
#line 15
#
#    Copyright Platform Computing Inc., an IBM company, 1999-2011, 2012
#                          All Rights Reserved.
#
#	$Revision: 5276 $
#
#	Function:	- compile MPI C code
#

#
#  Things we need or want to be specified:
#    - MPI_ROOT  --  we'll try to deduce one if unspecifed
#
#  All this script does is call mpicc with the same ARGV list
#  but with PCMPI_MPICC_EXECED set to 1 so mpicc.bat can know
#  to behave a little differently.
#

$ENV{'PCMPI_MPICC_EXECED'} = 1;

$mpiroot = $ENV{'MPI_ROOT'};
if (!defined($mpiroot)) {
	$mpiroot = "$0";
	$mpiroot =~ s/[^\\]*$//;
	$mpiroot = "${mpiroot}\\..";
}
if ( ! -x "${mpiroot}\\bin\\mpirun.exe" ) {
        $mpiroot="c:\\program files (x86)\\IBM\\Platform Computing\\Platform-MPI";
}
if ( ! -x "${mpiroot}\\bin\\mpirun.exe" ) {
        $mpiroot="c:\\program files\\IBM\\Platform Computing\\Platform-MPI";
}

@args=( "${mpiroot}\\bin\\mpicc.bat", @ARGV );
$rv = system @args;
exit $rv;

__END__
:endofperl
