Compare commits

...

3 Commits
rawhide ... f30

Author SHA1 Message Date
Tom Stellard bf8d0859b8 Enable gating tests 2019-04-25 22:01:35 +00:00
Tom Stellard 0d79d8ca03 Simplify libomp-test package
+ Rename test script to run-lit-tests and move to libexec to match
  llvm-test.
+ Move most of the configuration out of the spec file and into the
  test script and a custom lit config file.
+ Stop testing libomp with gcc.  Most of the complication in the
  spec file was to enable testing with gcc.  A user would have to
  go way out of their way to make libomp work with gcc, so I don't
  think there is much value in keeping the complexity in order to test
  this.
2019-04-25 22:01:25 +00:00
serge-sans-paille 7e0ebadb45 8.0.0 final 2019-03-27 06:35:28 +00:00
8 changed files with 114 additions and 65 deletions

3
.gitignore vendored
View File

@ -10,3 +10,6 @@
/openmp-7.0.0.src.tar.xz
/openmp-7.0.1.src.tar.xz
/openmp-8.0.0rc1.src.tar.xz
/openmp-8.0.0rc2.src.tar.xz
/openmp-8.0.0rc4.src.tar.xz
/openmp-8.0.0.src.tar.xz

12
gating.yaml Normal file
View File

@ -0,0 +1,12 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_testing
rules:
- !PassingTestCaseRule {test_case_name: org.centos.prod.ci.pipeline.allpackages-build.package.test.functional.complete}
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
rules:
- !PassingTestCaseRule {test_case_name: org.centos.prod.ci.pipeline.allpackages-build.package.test.functional.complete}

View File

@ -1,4 +1,4 @@
%global rc_ver 1
#%%global rc_ver 4
%global libomp_srcdir openmp-%{version}%{?rc_ver:rc%{rc_ver}}.src
@ -10,13 +10,14 @@
Name: libomp
Version: 8.0.0
Release: 1%{?rc_ver:.rc%{rc_ver}}%{?dist}.1
Release: 2%{?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}}/%{libomp_srcdir}.tar.xz
Source1: runtest.sh
Source1: run-lit-tests
Source2: lit.fedora.cfg.py
Patch0: 0001-CMake-Make-LIBOMP_HEADERS_INSTALL_PATH-a-cache-varia.patch
@ -80,41 +81,26 @@ cd _build
# 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
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}/libomp.so %{buildroot}%{libomp_testdir}/libgomp.so
# 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}
# 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}
# Install custom fedora config file
cp %{SOURCE2} %{buildroot}%{lit_fedora_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}
# Patch lit config files to load custom fedora config
echo "lit_config.load_config(config, '%{lit_fedora_cfg}')" >> %{buildroot}%{lit_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}
install -m 0755 %{SOURCE1} %{buildroot}%{_datadir}/libomp
# Install test script
install -d %{buildroot}%{_libexecdir}/tests/libomp
install -m 0755 %{SOURCE1} %{buildroot}%{_libexecdir}/tests/libomp
%files
@ -133,8 +119,15 @@ install -m 0755 %{SOURCE1} %{buildroot}%{_datadir}/libomp
%files test
%{_datadir}/libomp
%{_libexecdir}/tests/libomp/
%changelog
* Thu Apr 25 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-2
- Simplify libomp-test package
* Wed Mar 20 2019 sguelton@redhat.com - 8.0.0-1
- 8.0.0 final
* Mon Feb 11 2019 sguelton@redhat.com - 8.0.0-1.rc1
- 8.0.0 Release candidate 1

15
lit.fedora.cfg.py Normal file
View File

@ -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)

59
run-lit-tests Normal file
View File

@ -0,0 +1,59 @@
#!/usr/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"
;;
--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

View File

@ -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 || $?

View File

@ -1 +1 @@
SHA512 (openmp-8.0.0rc1.src.tar.xz) = 987147cdf4fb4eb66978fe1313124768a6a6efab316e7b37a39da550eec2c3ace52d73c3c7aa035e02f1ca6313e01990424b70a68635fdbb9eb06825317dc1b4
SHA512 (openmp-8.0.0.src.tar.xz) = 0fff071c9dbf118bc1908e433d6ce571f47a4f2dbc5bf2d843151889e3414473bb5a9c97dc0b6dc6d1bd9ab0c6e365cae625f97d1b11d5d6ae059fa5a0496cb3

View File

@ -8,4 +8,4 @@
tests:
- libomp-regression-tests:
dir: ./
run: /usr/share/libomp/runtest.sh --threads 8
run: /usr/libexec/tests/libomp/run-lit-tests --threads 8