#! /bin/bash #+ # NAME: # intel_setup # PURPOSE: # Sets up environment for Intel compilers # CATEGORY: # smei/com/linux # CALLING SEQUENCE: # . $COM/intel_setup # INPUTS: # (none) # CALLED BY: # login # PROCEDURE: # Sets up environment for Intel Fortran and C++ compiler # For version 6 and 7 the directory # /opt/intel/compiler??/ia32/bin (??=60 or 70) # should contain the compilers. # For version 8.0 the Fortran and C++ compilers are in # separate directories /opt/intel_cc_80 and /opt/intel_fc_80 # MODIFICATION HISTORY: # JAN-2003, Paul Hick (UCSD/CASS) # MAY-2004, Paul Hick (UCSD/CASS) # Added setup for version 8.0 compilers. # Added check for existence of env var ARCH. If not defined # it is set to $(uname -m)_$(uname -s) # MAR-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu) # Removed support for all version prior to 9.0 #- version="" if [ -d /zshare ]; then opt=/zshare else opt=/home/$SMEI_ACCOUNT fi xver=100 if [ -d $opt/intel_cc_$xver ]; then version=$opt/intel_cc_$xver bin=$version/bin lib=$version/lib man=$version/man lic=$version/licenses fi if [ -n "$version" ]; then if [ -z "$(echo ":$PATH:" | grep ":$bin:")" ]; then PATH=$PATH:$bin fi if [ -z "$LD_LIBRARY_PATH" ]; then LD_LIBRARY_PATH=$lib elif [ -z "$(echo ":$LD_LIBRARY_PATH:" | grep ":$lib:")" ]; then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib fi if [ -z "$MAN_PATH" ]; then MAN_PATH=$(man -w) fi if [ -z "$MAN_PATH" ]; then MAN_PATH=$man elif [ -z "$(echo ":$MAN_PATH:" | grep ":$man:")" ]; then MAN_PATH=$MAN_PATH:$man fi if [ -z "$INTEL_LICENSE_FILE" ]; then INTEL_LICENSE_FILE=$lic elif [ -z "$(echo ":$INTEL_LICENSE_FILE:" | grep ":$lic:")" ]; then INTEL_LICENSE_FILE=$INTEL_LICENSE_FILE:$lic fi export PATH LD_LIBRARY_PATH MAN_PATH INTEL_LICENSE_FILE fi version="" if [ -d $opt/intel_fc_$xver ]; then version=$opt/intel_fc_$xver bin=$version/bin lib=$version/lib man=$version/man lic=$version/licenses fi if [ -n "$version" ]; then if [ -z "$(echo ":$PATH:" | grep ":$bin:")" ]; then PATH=$PATH:$bin fi if [ -z "$LD_LIBRARY_PATH" ]; then LD_LIBRARY_PATH=$lib elif [ -z "$(echo ":$LD_LIBRARY_PATH:" | grep ":$lib:")" ]; then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib fi if [ -z "$MAN_PATH" ]; then MAN_PATH=$(man -w) fi if [ -z "$MAN_PATH" ]; then MAN_PATH=$man elif [ -z "$(echo ":$MAN_PATH:" | grep ":$man:")" ]; then MAN_PATH=$MAN_PATH:$man fi if [ -z "$INTEL_LICENSE_FILE" ]; then INTEL_LICENSE_FILE=$lic elif [ -z "$(echo ":$INTEL_LICENSE_FILE:" | grep ":$lic:")" ]; then INTEL_LICENSE_FILE=$INTEL_LICENSE_FILE:$lic fi export PATH LD_LIBRARY_PATH MAN_PATH INTEL_LICENSE_FILE fi if [ -n "$(which icc 2> /dev/null)" ]; then VERSION=$(icc -dumpversion 2> /dev/null) # Get rid of trailing white space. VERSION=$(echo $VERSION) if [ -z "$ARCH" ]; then ARCH=$(uname -m)_$(uname -s) fi INTEL_COMPILER="$ARCH"_intel_"$VERSION" export INTEL_COMPILER fi