#!/bin/bash
#module load craype-haswell  # for Gerty
p0=`echo $PE_ENV|tr [:upper:] [:lower:]`

for p in intel gnu cray
do

    module swap PrgEnv-${p0} PrgEnv-$p
    module list
    if [[ $p == intel ]]; then
        cc -qopenmp -o xthi.$p xthi.c
    elif [[ $p == gnu ]]; then
         cc -fopenmp -o xthi.$p xthi.c
    else
        cc -o xthi.$p xthi.c
    fi
    p0=$p
done
