#!/bin/bash

if [[ (`uname` == Darwin) && ($NOMKL == 0) ]]; then
    export ATLAS=1
    export LDFLAGS="-headerpad_max_install_names $LDFLAGS"
fi

if [ `uname` == Darwin ]; then
    source /localdisk/tools/intel/compilers_and_libraries_16.0.3/mac/bin/compilervars.sh intel64
    export MACOSX_DEPLOYMENT_TARGET=10.10
#    export CPPFLAGS="$CPPFLAGS -Xpreprocessor -qopenmp"
#    export CPPFLAGS="$CPPFLAGS -I$PREFIX/include -qopenmp"
#    export CFLAGS="$CFLAGS -I$PREFIX/include -qopenmp"
#    export CXXFLAGS="$CXXFLAGS -I$PREFIX/include -qopenmp"
#    export LDFLAGS="$LDFLAGS -qopenmp"
    export LDFLAGS="$LDFLAGS -L$PREFIX/lib -Wl,-rpath,$PREFIX/lib -liomp5"
fi

export CC=icc
export CXX=icc

$PYTHON setup.py config_cc --compiler=intelem install 

rm -rf $SP_DIR/scikits
