Blob Blame History Raw

set -exo pipefail

CLANG_VERSION=`rpm --queryformat="%{version}" -q clang`
LIBOMP_DEPENDENCIES="libomp libomp-devel"

# Ensure clang depends on the correct clang-libs version
rpm -q --requires clang | grep "clang-libs.* = ${CLANG_VERSION}"

# Check that weak dependencies are correct. The versions of these should be the same
# as clang's to guarantee the ABI compatibility, and that version should be actually
# installed as well.
for lomp_dep in $LIBOMP_DEPENDENCIES; do
    rpm -q --recommends clang-libs | grep "${lomp_dep}.* = ${CLANG_VERSION}"
    [[ "$(rpm --queryformat="%{version}" -q ${lomp_dep})" == "${CLANG_VERSION}" ]]

# Perform a sanity test to ensure everything works as expected
clang -fopenmp openmp-compile-link-test.c

./a.out | grep "Num Threads: 1"