From dab324426cdfe67961d635e3b636305ae4f15afa Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 5 Nov 2019 14:39:46 -0500 Subject: [PATCH] import libomp-8.0.1-1.module+el8.1.0+3866+6be7f4d8 --- .gitignore | 2 +- .libomp.metadata | 2 +- ...-bugs.llvm.org-show_bug.cgi-id-39970.patch | 195 ------------------ SOURCES/lit.fedora.cfg.py | 15 ++ SOURCES/run-lit-tests | 63 ++++++ SOURCES/runtest.sh | 33 --- SPECS/libomp.spec | 78 ++++--- 7 files changed, 115 insertions(+), 273 deletions(-) delete mode 100644 SOURCES/0001-Fix-for-https-bugs.llvm.org-show_bug.cgi-id-39970.patch create mode 100644 SOURCES/lit.fedora.cfg.py create mode 100644 SOURCES/run-lit-tests delete mode 100644 SOURCES/runtest.sh diff --git a/.gitignore b/.gitignore index 29f1303..d250ad4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/openmp-7.0.1.src.tar.xz +SOURCES/openmp-8.0.1.src.tar.xz diff --git a/.libomp.metadata b/.libomp.metadata index d2294eb..1093828 100644 --- a/.libomp.metadata +++ b/.libomp.metadata @@ -1 +1 @@ -3b931dcafbe6e621c9d99617235fd63f222c2ba2 SOURCES/openmp-7.0.1.src.tar.xz +64fc83d7ba5be944835961827acad93fd36a9c0c SOURCES/openmp-8.0.1.src.tar.xz diff --git a/SOURCES/0001-Fix-for-https-bugs.llvm.org-show_bug.cgi-id-39970.patch b/SOURCES/0001-Fix-for-https-bugs.llvm.org-show_bug.cgi-id-39970.patch deleted file mode 100644 index 97eea6f..0000000 --- a/SOURCES/0001-Fix-for-https-bugs.llvm.org-show_bug.cgi-id-39970.patch +++ /dev/null @@ -1,195 +0,0 @@ -From ce4337afad70fcf57f6b9afc84203497586f91b8 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Wed, 12 Dec 2018 10:12:57 -0800 -Subject: [PATCH] Fix for https://bugs.llvm.org/show_bug.cgi?id=39970 - -Summary: -Some tests require more than 1 thread to pass. The patch checks max threads, and if iti is 1 then sets number of threads to more than one. - -Exceptions: -ompt/misc/api_calls_places.c - broke the standard requirement, fixed this; -worksharing/for/omp_doacross.c - could not reproduce the failure, increased the number of threads just in case. - -Reviewers: jlpeyton, hbae, tlwilmar - -Subscribers: openmp-commits, tstellar - -Differential Revision: https://reviews.llvm.org/D55598 ---- - runtime/test/api/omp_in_parallel.c | 5 +++++ - runtime/test/flush/omp_flush.c | 5 +++++ - runtime/test/ompt/misc/api_calls_places.c | 2 +- - runtime/test/parallel/omp_nested.c | 2 ++ - runtime/test/tasking/omp_task.c | 3 +++ - runtime/test/tasking/omp_taskyield.c | 3 +++ - runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c | 3 ++- - runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c | 3 ++- - runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c | 3 ++- - runtime/test/worksharing/for/omp_doacross.c | 2 ++ - 10 files changed, 27 insertions(+), 4 deletions(-) - -diff --git a/runtime/test/api/omp_in_parallel.c b/runtime/test/api/omp_in_parallel.c -index d09313e..5e9e635 100644 ---- a/runtime/test/api/omp_in_parallel.c -+++ b/runtime/test/api/omp_in_parallel.c -@@ -30,6 +30,11 @@ int main() - int i; - int num_failed=0; - -+ // the test requires more than 1 thread to pass -+ omp_set_dynamic(0); // disable dynamic adjustment of threads -+ if (omp_get_max_threads() == 1) -+ omp_set_num_threads(2); // set 2 threads if no HW resources available -+ - for(i = 0; i < REPETITIONS; i++) { - if(!test_omp_in_parallel()) { - num_failed++; -diff --git a/runtime/test/flush/omp_flush.c b/runtime/test/flush/omp_flush.c -index 3fd3cdf..95a406d 100644 ---- a/runtime/test/flush/omp_flush.c -+++ b/runtime/test/flush/omp_flush.c -@@ -36,6 +36,11 @@ int main() - int i; - int num_failed=0; - -+ // the test requires more than 1 thread to pass -+ omp_set_dynamic(0); // disable dynamic adjustment of threads -+ if (omp_get_max_threads() == 1) -+ omp_set_num_threads(2); // set 2 threads if no HW resources available -+ - for (i = 0; i < REPETITIONS; i++) { - if(!test_omp_flush()) { - num_failed++; -diff --git a/runtime/test/ompt/misc/api_calls_places.c b/runtime/test/ompt/misc/api_calls_places.c -index ad338a7..3385c9c 100644 ---- a/runtime/test/ompt/misc/api_calls_places.c -+++ b/runtime/test/ompt/misc/api_calls_places.c -@@ -42,7 +42,7 @@ int main() { - int omp_nums[omp_nums_size]; - omp_get_partition_place_nums(omp_nums); - print_list("omp_get_partition_place_nums", omp_nums_size, omp_nums); -- int ompt_nums_size = ompt_get_partition_place_nums(0, NULL); -+ int ompt_nums_size = ompt_get_partition_place_nums(0, omp_nums); - int ompt_nums[ompt_nums_size]; - ompt_get_partition_place_nums(ompt_nums_size, ompt_nums); - print_list("ompt_get_partition_place_nums", ompt_nums_size, ompt_nums); -diff --git a/runtime/test/parallel/omp_nested.c b/runtime/test/parallel/omp_nested.c -index 8b78088..d2d5b08 100644 ---- a/runtime/test/parallel/omp_nested.c -+++ b/runtime/test/parallel/omp_nested.c -@@ -12,6 +12,8 @@ int test_omp_nested() - #ifdef _OPENMP - if (omp_get_max_threads() > 4) - omp_set_num_threads(4); -+ if (omp_get_max_threads() < 2) -+ omp_set_num_threads(2); - #endif - - int counter = 0; -diff --git a/runtime/test/tasking/omp_task.c b/runtime/test/tasking/omp_task.c -index c534abe..5703225 100644 ---- a/runtime/test/tasking/omp_task.c -+++ b/runtime/test/tasking/omp_task.c -@@ -43,6 +43,9 @@ int main() - int i; - int num_failed=0; - -+ if (omp_get_max_threads() < 2) -+ omp_set_num_threads(8); -+ - for(i = 0; i < REPETITIONS; i++) { - if(!test_omp_task()) { - num_failed++; -diff --git a/runtime/test/tasking/omp_taskyield.c b/runtime/test/tasking/omp_taskyield.c -index 5bb6984..7f85413 100644 ---- a/runtime/test/tasking/omp_taskyield.c -+++ b/runtime/test/tasking/omp_taskyield.c -@@ -49,6 +49,9 @@ int main() - int i; - int num_failed=0; - -+ if (omp_get_max_threads() < 2) -+ omp_set_num_threads(8); -+ - for(i = 0; i < REPETITIONS; i++) { - if(!test_omp_taskyield()) { - num_failed++; -diff --git a/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c b/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c -index bb538d1..987a5c0 100644 ---- a/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c -+++ b/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c -@@ -66,6 +66,7 @@ run_loop( - int ub; // Chunk upper bound. - int st; // Chunk stride. - int rc; -+ int nthreads = omp_get_num_threads(); - int tid = omp_get_thread_num(); - int gtid = __kmpc_global_thread_num(&loc); - int last; -@@ -134,7 +135,7 @@ run_loop( - printf("Error with iter %d, %d, err %d\n", cur, max, ++err); - // Update maximum for the next chunk. - if (last) { -- if (!no_chunk && cur > ch) -+ if (!no_chunk && cur > ch && nthreads > 1) - printf("Error: too big last chunk %d (%d), tid %d, err %d\n", - (int)cur, ch, tid, ++err); - } else { -diff --git a/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c b/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c -index d137831..5dfaf24 100644 ---- a/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c -+++ b/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c -@@ -74,6 +74,7 @@ run_loop( - int ub; // Chunk upper bound. - int st; // Chunk stride. - int rc; -+ int nthreads = omp_get_num_threads(); - int tid = omp_get_thread_num(); - int gtid = __kmpc_global_thread_num(&loc); - int last; -@@ -144,7 +145,7 @@ run_loop( - if (!last && cur % ch) - printf("Error with chunk %d, %d, ch %d, tid %d, err %d\n", - chunk, (int)cur, ch, tid, ++err); -- if (last && !no_chunk && cur > ch) -+ if (last && !no_chunk && cur > ch && nthreads > 1) - printf("Error: too big last chunk %d (%d), tid %d, err %d\n", - (int)cur, ch, tid, ++err); - if (cur < max) -diff --git a/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c b/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c -index 4cb15d6..d76046b 100644 ---- a/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c -+++ b/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c -@@ -67,6 +67,7 @@ run_loop( - int ub; // Chunk upper bound. - int st; // Chunk stride. - int rc; -+ int nthreads = omp_get_num_threads(); - int tid = omp_get_thread_num(); - int gtid = __kmpc_global_thread_num(&loc); - int last; -@@ -135,7 +136,7 @@ run_loop( - printf("Error with iter %d, %d, err %d\n", cur, max, ++err); - // Update maximum for the next chunk. - if (last) { -- if (!no_chunk && cur > ch) -+ if (!no_chunk && cur > ch && nthreads > 1) - printf("Error: too big last chunk %d (%d), tid %d, err %d\n", - (int)cur, ch, tid, ++err); - } else { -diff --git a/runtime/test/worksharing/for/omp_doacross.c b/runtime/test/worksharing/for/omp_doacross.c -index 4187112..3644306 100644 ---- a/runtime/test/worksharing/for/omp_doacross.c -+++ b/runtime/test/worksharing/for/omp_doacross.c -@@ -51,6 +51,8 @@ int test_doacross() { - int main(int argc, char **argv) { - int i; - int num_failed = 0; -+ if (omp_get_max_threads() < 2) -+ omp_set_num_threads(4); - for (i = 0; i < REPETITIONS; i++) { - if (!test_doacross()) { - num_failed++; --- -1.8.3.1 - diff --git a/SOURCES/lit.fedora.cfg.py b/SOURCES/lit.fedora.cfg.py new file mode 100644 index 0000000..10d1f1f --- /dev/null +++ b/SOURCES/lit.fedora.cfg.py @@ -0,0 +1,15 @@ +import tempfile + +compiler = '%(libomp_compiler)s' % lit_config.params +config.test_filecheck = '%(bindir)s/FileCheck' % lit_config.params +config.omp_header_directory = '%(includedir)s' % lit_config.params +config.libomp_obj_root = tempfile.mkdtemp() +config.library_dir = '%(libdir)s' % lit_config.params +test_root = '%(libomp_test_root)s' % lit_config.params + +# Lit will default to the compiler used to build openmp, which is gcc, but we +# want to run the tests using clang. +config.test_compiler_features = ['clang'] +config.test_c_compiler = 'clang' +config.test_cxx_compiler = 'clang++' +lit_config.load_config(config, '%(libomp_test_root)s/lit.cfg' % lit_config.params) diff --git a/SOURCES/run-lit-tests b/SOURCES/run-lit-tests new file mode 100644 index 0000000..f7e908e --- /dev/null +++ b/SOURCES/run-lit-tests @@ -0,0 +1,63 @@ +#!/usr/bin/bash + +set -e + +usage() { + echo "usage: `basename $0` [OPTIONS]" + echo " --threads NUM The number of threads to use for running tests." +} + + +threads_arg='' + +while [ $# -gt 0 ]; do + case $1 in + --threads) + shift + threads_arg="--threads $1" + ;; + --multilib-arch) + shift + ARCH=$1 + ;; + * ) + echo "unknown option: $1" + echo "" + usage + exit 1 + ;; + esac + shift +done + + +set -xe + +if [ -z "$ARCH" ]; then + ARCH=`rpm --eval '%_arch'` +fi + +case $ARCH in + arm) + ;& + i686) + LIB_DIR="/usr/lib/" + ;; + *) + LIB_DIR="/usr/lib64/" + ;; +esac + +BIN_DIR="/usr/bin/" +INCLUDE_DIR="/usr/include/" + +lit $threads_arg -v \ + --config-prefix $ARCH \ + -Dlibomp_compiler=clang \ + -Dbindir=$BIN_DIR \ + -Dlibdir=$LIB_DIR \ + -Dincludedir=$INCLUDE_DIR \ + -Dlibomp_test_root=/usr/share/libomp/src/runtime/test \ + /usr/share/libomp/src/runtime/test + +exit 0 diff --git a/SOURCES/runtest.sh b/SOURCES/runtest.sh deleted file mode 100644 index 1e66f29..0000000 --- a/SOURCES/runtest.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -usage() { - echo "usage: `basename $0` [OPTIONS]" - echo " --threads NUM The number of threads to use for running tests." -} - - -threads_arg='' - -while [ $# -gt 0 ]; do - case $1 in - --threads) - shift - threads_arg="--threads $1" - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - - -set -x - -lit $threads_arg -v --config-prefix clang /usr/share/libomp/src/runtime/test -fail=$? -lit $threads_arg -v --config-prefix gcc /usr/share/libomp/src/runtime/test -exit $fail || $? diff --git a/SPECS/libomp.spec b/SPECS/libomp.spec index 095533d..25a28bd 100644 --- a/SPECS/libomp.spec +++ b/SPECS/libomp.spec @@ -1,25 +1,25 @@ +#%%global rc_ver 2 +%global libomp_srcdir openmp-%{version}%{?rc_ver:rc%{rc_ver}}.src + + %ifarch ppc64le %global libomp_arch ppc64 %else %global libomp_arch %{_arch} %endif -%ifnarch i686 -%global enable_test_pkg 1 -%endif - Name: libomp -Version: 7.0.1 -Release: 1%{?dist} +Version: 8.0.1 +Release: 1%{?rc_ver:.rc%{rc_ver}}%{?dist} Summary: OpenMP runtime for clang License: NCSA URL: http://openmp.llvm.org -Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/openmp-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz -Source1: runtest.sh +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-%{rc_ver}}/%{libomp_srcdir}.tar.xz +Source1: run-lit-tests +Source2: lit.fedora.cfg.py Patch0: 0001-CMake-Make-LIBOMP_HEADERS_INSTALL_PATH-a-cache-varia.patch -Patch1: 0001-Fix-for-https-bugs.llvm.org-show_bug.cgi-id-39970.patch BuildRequires: cmake BuildRequires: elfutils-libelf-devel @@ -43,12 +43,10 @@ Requires: clang-devel%{?isa} = %{version} %description devel OpenMP header files. -%if 0%{?enable_test_pkg} - %package test Summary: OpenMP regression tests -Requires: libomp%{?isa} = %{version} -Requires: libomp-devel%{?isa} = %{version} +Requires: %{name}%{?isa} = %{version} +Requires: %{name}-devel%{?isa} = %{version} Requires: clang Requires: llvm Requires: gcc @@ -58,8 +56,6 @@ Requires: python3-lit %description test OpenMP regression tests -%endif - %prep %autosetup -n openmp-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1 @@ -82,13 +78,11 @@ cd _build %install %make_install -C _build -%if 0%{?enable_test_pkg} - # Test package setup %global libomp_srcdir %{_datadir}/libomp/src/ %global libomp_testdir %{libomp_srcdir}/runtime/test/ -%global gcc_lit_cfg %{buildroot}%{libomp_testdir}/gcc.site.cfg -%global clang_lit_cfg %{buildroot}%{libomp_testdir}/clang.site.cfg +%global lit_cfg %{libomp_testdir}/%{_arch}.site.cfg.py +%global lit_fedora_cfg %{_datadir}/libomp/lit.fedora.cfg.py install -d %{buildroot}%{libomp_srcdir}/runtime cp -R runtime/test %{buildroot}%{libomp_srcdir}/runtime @@ -97,33 +91,22 @@ cp -R runtime/src %{buildroot}%{libomp_srcdir}/runtime # Add symlinks to the libomp headers/library so gcc can find them. ln -s %{_libdir}/clang/%{version}/include/omp.h %{buildroot}%{libomp_testdir}/omp.h ln -s %{_libdir}/clang/%{version}/include/ompt.h %{buildroot}%{libomp_testdir}/ompt.h +ln -s %{_libdir}/clang/%{version}/include/omp-tools.h %{buildroot}%{libomp_testdir}/omp-tools.h ln -s %{_libdir}/libomp.so %{buildroot}%{libomp_testdir}/libgomp.so -# Generic test config -echo "import tempfile" > %{gcc_lit_cfg} -cat _build/runtime/test/lit.site.cfg >> %{gcc_lit_cfg} -sed -i 's~\(config.test_filecheck = \)""~\1"%{_libdir}/llvm/FileCheck"~' %{gcc_lit_cfg} -sed -i 's~\(config.omp_header_directory = \)"[^"]\+"~\1"%{_includedir}"~' %{gcc_lit_cfg} -sed -i 's~\(config.libomp_obj_root = \)"[^"]\+"~\1tempfile.mkdtemp()[1]~' %{gcc_lit_cfg} -sed -i 's~\(lit_config.load_config(config, \)"[^"]\+"~\1"%{libomp_testdir}/lit.cfg"~' %{gcc_lit_cfg} +# Generate lit config files. Strip off the last line that initiates the +# test run, so we can customize the configuration. +head -n -1 _build/runtime/test/lit.site.cfg >> %{buildroot}%{lit_cfg} -# GCC config -# test_compiler_features was already populated with gcc information if gcc was used -# to compile libomp. -sed -i 's~\(config.test_c_compiler = \)"[^"]\+"~\1"%{_bindir}/gcc"~' %{gcc_lit_cfg} -sed -i 's~\(config.test_cxx_compiler = \)"[^"]\+"~\1"%{_bindir}/g++"~' %{gcc_lit_cfg} -sed -i 's~\(config.library_dir = \)"[^"]\+"~\1"%{libomp_testdir}"~' %{gcc_lit_cfg} +# Install custom fedora config file +cp %{SOURCE2} %{buildroot}%{lit_fedora_cfg} -# Clang config -cp %{gcc_lit_cfg} %{clang_lit_cfg} -sed -i 's~\(config.test_compiler_features = \)\[[^\[]\+]~\1["clang"]~' %{clang_lit_cfg} -sed -i 's~\(config.test_c_compiler = \)"[^"]\+"~\1"%{_bindir}/clang"~' %{clang_lit_cfg} -sed -i 's~\(config.test_cxx_compiler = \)"[^"]\+"~\1"%{_bindir}/clang++"~' %{clang_lit_cfg} -sed -i 's~\(config.library_dir = \)"[^"]\+"~\1"%{_libdir}"~' %{clang_lit_cfg} +# Patch lit config files to load custom fedora config +echo "lit_config.load_config(config, '%{lit_fedora_cfg}')" >> %{buildroot}%{lit_cfg} -install -m 0755 %{SOURCE1} %{buildroot}%{_datadir}/libomp - -%endif +# Install test script +install -d %{buildroot}%{_libexecdir}/tests/libomp +install -m 0755 %{SOURCE1} %{buildroot}%{_libexecdir}/tests/libomp %files %{_libdir}/libomp.so @@ -135,15 +118,24 @@ install -m 0755 %{SOURCE1} %{buildroot}%{_datadir}/libomp %files devel %{_libdir}/clang/%{version}/include/omp.h %ifnarch %{arm} +%{_libdir}/clang/%{version}/include/omp-tools.h %{_libdir}/clang/%{version}/include/ompt.h %endif -%if 0%{?enable_test_pkg} %files test %{_datadir}/libomp -%endif +%{_libexecdir}/tests/libomp/ %changelog +* Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1 +- 8.0.1 release + +* Thu Jun 13 2019 sguelton@redhat.com - 8.0.1-0.1.rc2 +- 8.0.1rc2 Release + +* Mon Apr 29 2019 sguelton@redhat.com - 8.0.0-1 +- 8.0.0 Release + * Fri Dec 14 2018 Tom Stellard - 7.0.1-1 - 7.0.1 Release