#!/bin/csh
# C Shell script for the Intel(R) Parallel Studio XE 2017 for Linux* OS

set SCRIPTPATH=/s/intelcompilers-2017/amd64_rhel6
set ROOTPATH=/s/intelcompilers-2017/amd64_rhel6
set ITAC_PARAM=""

if ( x"$2" != x"" ) then
    set ITAC_PARAM="$2"
endif

echo "Intel(R) Parallel Studio XE 2017 for Linux*"
echo "Copyright (C) 2009-2016 Intel Corporation. All rights reserved."

if ( x"$1" == x"ia32" ) then
    if ( -f "$SCRIPTPATH/compilers_and_libraries_2017/linux/bin/compilervars.csh" ) then
        source "$SCRIPTPATH/compilers_and_libraries_2017/linux/bin/compilervars.csh" "ia32"
    endif
else
    if ( -f "$SCRIPTPATH/compilers_and_libraries_2017/linux/bin/compilervars.csh" ) then
        source "$SCRIPTPATH/compilers_and_libraries_2017/linux/bin/compilervars.csh" "intel64"
    endif
    if ( -f "$SCRIPTPATH/clck_latest/bin/clckvars.csh" ) then
        source "$SCRIPTPATH/clck_latest/bin/clckvars.csh" 
    endif
endif

if ( -f "$SCRIPTPATH/itac_2017/bin/itacvars.csh" ) then
    source "$SCRIPTPATH/itac_2017/bin/itacvars.csh" "$ITAC_PARAM"
endif

if ( -f "$SCRIPTPATH/vtune_amplifier_xe_2017/amplxe-vars.csh" ) then
    source "$SCRIPTPATH/vtune_amplifier_xe_2017/amplxe-vars.csh" quiet
endif

if ( -f "$SCRIPTPATH/inspector_2017/inspxe-vars.csh" ) then
    source "$SCRIPTPATH/inspector_2017/inspxe-vars.csh" quiet
endif

if ( -f "$SCRIPTPATH/advisor_2017/advixe-vars.csh" ) then
    source "$SCRIPTPATH/advisor_2017/advixe-vars.csh" quiet
endif

set path = ($path "$SCRIPTPATH/bin")

if !($?INTEL_LICENSE_FILE) then
    setenv INTEL_LICENSE_FILE "$ROOTPATH/licenses"
else
    setenv INTEL_LICENSE_FILE "$ROOTPATH/licenses:${INTEL_LICENSE_FILE}"
endif
