#!/bin/bash

# source /localdisk/tools/intel/compilers_and_libraries_16.0.3/linux/bin/compilervars.sh intel64

echo "NOMKL: $NOMKL"

if [ `uname` == Darwin ]
then
    if [ $NOMKL == 0 ]; then
        export ATLAS=1
        export LDFLAGS="-headerpad_max_install_names $LDFLAGS"
    fi
    source /localdisk/tools/intel/compilers_and_libraries_16.0.3/mac/bin/compilervars.sh intel64
    LDFLAGS="-undefined dynamic_lookup -bundle -Wl,-search_paths_first -L$(pwd) $LDFLAGS"
fi

$PYTHON setup.py build --force --compiler=intelem --fcompiler=intelem
$PYTHON setup.py install --old-and-unmanageable
