@echo off
rem Copyright 2007-2021 Intel Corporation.
rem 
rem This software and the related documents are Intel copyrighted materials,
rem and your use of them is governed by the express license under which they
rem were provided to you (License). Unless the License provides otherwise,
rem you may not use, modify, copy, publish, distribute, disclose or transmit
rem this software or the related documents without Intel's prior written
rem permission.
rem 
rem This software and the related documents are provided as is, with no
rem express or implied warranties, other than those that are expressly stated
rem in the License.
Rem Intel(R) MPI Library Build Environment

SET I_MPI_ROOT=%~dp0..\..

if "%1" == "quiet" (
    shift
    goto EXPORTS
) else if "%2" == "quiet" (
    goto EXPORTS
)

title Intel(R) MPI Library 2019 Update 10 for Windows* Target Build Environment for Intel(R) 64 applications

echo.
echo Intel(R) MPI Library 2019 Update 10 for Windows* Target Build Environment for Intel(R) 64 applications
echo Copyright 2007-2021 Intel Corporation.
echo.

:EXPORTS
SET PATH=%I_MPI_ROOT%\intel64\bin\release;%I_MPI_ROOT%\intel64\bin;%PATH%
SET LIB=%I_MPI_ROOT%\intel64\lib\release;%I_MPI_ROOT%\intel64\lib;%LIB%
SET INCLUDE=%I_MPI_ROOT%\intel64\include;%INCLUDE%

if /i "%1"=="-ofi_internal" set I_MPI_OFI_LIBRARY_INTERNAL=%2& shift& shift
if /i "%1"=="--ofi_internal" set I_MPI_OFI_LIBRARY_INTERNAL=%2& shift& shift

if /i "%1"=="debug" (
    goto EXTRA_EXPORTS
)
if /i "%1"=="release" (
    goto EXTRA_EXPORTS
)
goto NO_EXTRA_EXPORTS

:EXTRA_EXPORTS
set PATH=%I_MPI_ROOT%\intel64\bin\%1;%PATH%
set LIB=%I_MPI_ROOT%\intel64\lib\%1;%LIB%

:NO_EXTRA_EXPORTS

if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="0" goto :EOF
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="no" goto :EOF
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="off" goto :EOF
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="disable" goto :EOF
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="" goto SET_LIBFABRIC_PATH
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="1" goto SET_LIBFABRIC_PATH
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="yes" goto SET_LIBFABRIC_PATH
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="on" goto SET_LIBFABRIC_PATH
if /i "%I_MPI_OFI_LIBRARY_INTERNAL%"=="enable" goto SET_LIBFABRIC_PATH

:SET_LIBFABRIC_PATH
set PATH=%I_MPI_ROOT%\intel64\libfabric\bin\utils;%I_MPI_ROOT%\intel64\libfabric\bin;%PATH%

