#!/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="-bundle -Wl,-search_paths_first -L$(pwd) $LDFLAGS"
fi

$PYTHON setup.py config_cc --compiler=intelem config_fc --fcompiler=intelem build --force install --old-and-unmanageable
$PYTHON setup.py bdist_wheel
cp dist/scipy*.whl ../../
