From ac62af341a3583d7a88bca69aa072b2e88171414 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mar 20 2020 14:52:14 +0000 Subject: Add test to check that clang can find the libomp header and libraries --- diff --git a/libomp/openmp-compile-link-test.c b/libomp/openmp-compile-link-test.c new file mode 100644 index 0000000..a2b6004 --- /dev/null +++ b/libomp/openmp-compile-link-test.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) { + int nthreads = omp_get_num_threads(); + printf("Num Threads: %d\n", nthreads); + return 0; +} diff --git a/libomp/runtest.sh b/libomp/runtest.sh new file mode 100755 index 0000000..f07dbbc --- /dev/null +++ b/libomp/runtest.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -exo pipefail + +clang -fopenmp openmp-compile-link-test.c + +./a.out | grep "Num Threads: 1" diff --git a/tests-libomp.yml b/tests-libomp.yml new file mode 100644 index 0000000..17def2e --- /dev/null +++ b/tests-libomp.yml @@ -0,0 +1,19 @@ +- hosts: localhost + pre_tasks: + # We want to make sure libomp is not already present on the system to ensure + # that clang pulls in the correct libomp dependencies when it is installed. + - name: Uninstall libomp + package: + name: "{{ item }}" + state: absent + with_items: + - libomp + - libomp-devel + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - clang + tests: + - libomp