def _check_for_openmp():
    """Check  whether the default compiler supports OpenMP.
    This routine is adapted from pynbody // yt.
    """
    import distutils.sysconfig
    import tempfile
    import shutil

    tmpdir = tempfile.mkdtemp(prefix='probreg')
    compiler = os.environ.get(
      'CC', distutils.sysconfig.get_config_var('CC'))
    if compiler is None:
        return False
    compiler = compiler.split()[0]

    # Attempt to compile a test script.
    # See http://openmp.org/wp/openmp-compilers/
    tmpfile = os.path.join(tmpdir, 'check_openmp.c')
    with open(tmpfile, 'w') as f:
        f.write('''
#include <omp.h>
#include <stdio.h>
int main() {
    #pragma omp parallel
    printf("Hello from thread %d", omp_get_thread_num());
}
''')

    try:
        with open(os.devnull, 'w') as fnull:
            exit_code = subprocess.call([compiler, '-fopenmp', '-o%s'
                                         % os.path.join(tmpdir, 'check_openmp'),
                                         tmpfile],
                                        stdout=fnull, stderr=fnull)
    except OSError:
        exit_code = 1
    finally:
        shutil.rmtree(tmpdir)

    if exit_code == 0:
        print ('Continuing your build using OpenMP...\n')
        return True
    return False
Check  whether the default compiler supports OpenMP.
    This routine is adapted from pynbody // yt.
    
setup.py