#!/bin/bash

echo "NOMKL: $NOMKL"

if [ `uname` == Darwin ]
then
    if [ $NOMKL == 0 ]; then
        export ATLAS=1
        export LDFLAGS="-headerpad_max_install_names $LDFLAGS"
    fi
    #source /opt/intel/compilers_and_libraries_2019.5.281/mac/bin/compilervars.sh intel64
    #export CFLAGS="$CFLAGS -mmacosx-version-min=10.10 -isysroot /opt/MacOSX10.10.sdk"
    #export LDFLAGS="$LDFLAGS -bundle -Wl,-search_paths_first -L$(pwd) -mmacosx-version-min=10.10 -isysroot /opt/MacOSX10.10.sdk"
    #export SDKROOT=/opt/MacOSX10.10.sdk
    #export MACOSX_DEPLOYMENT_TARGET=10.10
    $PYTHON setup.py build --force install --old-and-unmanageable
else
    $PYTHON setup.py config_cc --compiler=intelem config_fc --fcompiler=intelem build --force install --old-and-unmanageable
fi
