From 48d0f1b5fdfc1f2d6e6be67ff61dbbe96d16ec30 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 6 Mar 2017 20:39:02 +0100 Subject: sys-libs/libomp: Bump to 4.0.0rc3 --- sys-libs/libomp/Manifest | 2 +- ...-link-latomic-to-provide-atomics-when-ava.patch | 94 ++++++++++++++++++++++ sys-libs/libomp/libomp-4.0.0_rc2.ebuild | 72 ----------------- sys-libs/libomp/libomp-4.0.0_rc3.ebuild | 79 ++++++++++++++++++ 4 files changed, 174 insertions(+), 73 deletions(-) create mode 100644 sys-libs/libomp/files/4.0.0/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch delete mode 100644 sys-libs/libomp/libomp-4.0.0_rc2.ebuild create mode 100644 sys-libs/libomp/libomp-4.0.0_rc3.ebuild (limited to 'sys-libs') diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest index 5e3987a849ab..d2ad231e822a 100644 --- a/sys-libs/libomp/Manifest +++ b/sys-libs/libomp/Manifest @@ -2,4 +2,4 @@ DIST openmp-3.7.1.src.tar.xz 2026988 SHA256 9a702e20c247014f6de8c45b738c6ea586ec DIST openmp-3.8.1.src.tar.xz 2009572 SHA256 68fcde6ef34e0275884a2de3450a31e931caf1d6fda8606ef14f89c4123617dc SHA512 406e9077817c50bcd58dd50bd334258ebf4b81c3ecce830ae1f427bd7c1fc9376b63fdeb3459c953c341becde82d83be18069bfcd34cbaeee6f1478267c0b2bc WHIRLPOOL b733b7f8f965be86af49af5b02892ec8aacaafe00d310a21c8cc0155f1699da66d1c8aa7709eb230810c4ff68f63896d5a7548777c100ca91a8af998922bdca0 DIST openmp-3.9.0.src.tar.xz 2257596 SHA256 df88f90d7e5b5e9525a35fa2e2b93cbbb83c4882f91df494e87ee3ceddacac91 SHA512 030432bb10d86016f0f1c4f4d8b25f78acdb4aed33c604baf07c825bbcc6198306f2f71a3e56030f20864a92ab0187357aff94d34e47f7166991faf539c0104d WHIRLPOOL 7bfb362c0f087d3867c8cab04ebba23c8e6337d34ddcdfeda1cbe960611eacf1e4356e99bf4d6316b60c9f4b9f9fb23eecdb346feaae72b9cd168ee0aa3cca2a DIST openmp-3.9.1.src.tar.xz 2031588 SHA256 d23b324e422c0d5f3d64bae5f550ff1132c37a070e43c7ca93991676c86c7766 SHA512 80924a6f9765f634d24d7b0aa036d92c912dbd8e067487a14bdd03b4c587fdfc92e83eb29926bfa637ef45be3f133a924f77ab12099ea3706c18e9c42774708b WHIRLPOOL b6ec75d4f9d2b86bb8e2927791cb46e61ff8657fc21f9e0ba9893d81d3382522aca330564f3156c1fbbf765de0499e875e41e11199abe2da8ed1bef057d5e8d8 -DIST openmp-4.0.0rc2.src.tar.xz 2039312 SHA256 d7a927c0a7b0c0572e0c1e316a1bf2b7fbc398418fa411bcb34e7b7d53811715 SHA512 bb53c34861dcb5df52fd079dc816b507302210a3b4ab33d815d01b7d581a233280c10cfaa4ae2039591c4d73a375326b96f3bae142540b4a8041a655139053ae WHIRLPOOL d5d4dba9462737263b39663d12afad1f1c5cacc892fa5914834b12d11815fdd57a7d23669462915cfbc2117d70c283eef4f6193184991bb10dfc1ebc4a54fcb2 +DIST openmp-4.0.0rc3.src.tar.xz 2039416 SHA256 9692a8f8b2344b65afe2374959d02430515a29ff3420552f1c1b94cc663c85eb SHA512 19d289ba040950151131374c83b330a4a2e1501deb0a1dccba0e30cc59e8a48bb28642047c4a1dfa18ddda392c340873707af42976c6f7ce177d2b5383c17373 WHIRLPOOL 98ed954ab77c38f235e0254a32c16be78ded4e61710f96e52bbeb370a84219c1f763042c9d83298f99560086532211cde5e747d2fad385f58f04a7ad5fcb8b65 diff --git a/sys-libs/libomp/files/4.0.0/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch b/sys-libs/libomp/files/4.0.0/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch new file mode 100644 index 000000000000..688175583269 --- /dev/null +++ b/sys-libs/libomp/files/4.0.0/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch @@ -0,0 +1,94 @@ +From 7bd70635240f69fcd4da4d98a4aca8aaa779dd11 Mon Sep 17 00:00:00 2001 +From: Michal Gorny +Date: Fri, 24 Feb 2017 22:15:24 +0000 +Subject: [PATCH] [test] Try to link -latomic to provide atomics when available + +When using -rtlib=libgcc, the fallback implementation of __atomic_* +builtins is provided via libatomic (included in GCC). However, neither +GCC itself nor clang link libatomic implicitly, and it seems that GCC +upstream expects projects to link it explicitly as necessary. + +Since compiler-rt provides __atomic_* builtins directly in the main +library, check if they are provided by the default libraries first. +If they are not, check if -latomic is available to provide them +and add explicit -latomic for tests in this case. + +This fixes unresolved __atomic_load() references when running openmp +tests on i386 with libgcc backend. + +Differential Revision: https://reviews.llvm.org/D30083 + +git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@296183 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + runtime/test/CMakeLists.txt | 13 +++++++++++++ + runtime/test/lit.cfg | 2 ++ + runtime/test/lit.site.cfg.in | 2 +- + 3 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/runtime/test/CMakeLists.txt b/runtime/test/CMakeLists.txt +index 8162855..88c02c8 100644 +--- a/runtime/test/CMakeLists.txt ++++ b/runtime/test/CMakeLists.txt +@@ -1,6 +1,7 @@ + # CMakeLists.txt file for unit testing OpenMP Library + include(FindPythonInterp) + include(CheckTypeSize) ++include(CheckFunctionExists) + include(CheckLibraryExists) + + if(NOT PYTHONINTERP_FOUND) +@@ -11,6 +12,17 @@ endif() + + # Some tests use math functions + check_library_exists(m sqrt "" LIBOMP_HAVE_LIBM) ++# When using libgcc, -latomic may be needed for atomics ++# (but when using compiler-rt, the atomics will be built-in) ++# Note: we can not check for __atomic_load because clang treats it ++# as special built-in and that breaks CMake checks ++check_function_exists(__atomic_load_1 LIBOMP_HAVE_BUILTIN_ATOMIC) ++if(NOT LIBOMP_HAVE_BUILTIN_ATOMIC) ++ check_library_exists(atomic __atomic_load_1 "" LIBOMP_HAVE_LIBATOMIC) ++else() ++ # not needed ++ set(LIBOMP_HAVE_LIBATOMIC 0) ++endif() + + macro(pythonize_bool var) + if (${var}) +@@ -25,6 +37,7 @@ pythonize_bool(LIBOMP_OMPT_SUPPORT) + pythonize_bool(LIBOMP_OMPT_BLAME) + pythonize_bool(LIBOMP_OMPT_TRACE) + pythonize_bool(LIBOMP_HAVE_LIBM) ++pythonize_bool(LIBOMP_HAVE_LIBATOMIC) + + set(LIBOMP_TEST_CFLAGS "" CACHE STRING + "Extra compiler flags to send to the test compiler") +diff --git a/runtime/test/lit.cfg b/runtime/test/lit.cfg +index 7f18da4..bef61d4 100644 +--- a/runtime/test/lit.cfg ++++ b/runtime/test/lit.cfg +@@ -52,6 +52,8 @@ config.test_cflags = config.test_openmp_flag + \ + libs = "" + if config.has_libm: + libs += " -lm" ++if config.has_libatomic: ++ libs += " -latomic" + + # Allow XFAIL to work + config.target_triple = [ ] +diff --git a/runtime/test/lit.site.cfg.in b/runtime/test/lit.site.cfg.in +index 448132e..b0d57ce 100644 +--- a/runtime/test/lit.site.cfg.in ++++ b/runtime/test/lit.site.cfg.in +@@ -12,7 +12,7 @@ config.hwloc_library_dir = "@LIBOMP_HWLOC_LIBRARY_DIR@" + config.using_hwloc = @LIBOMP_USE_HWLOC@ + config.has_ompt = @LIBOMP_OMPT_SUPPORT@ and @LIBOMP_OMPT_BLAME@ and @LIBOMP_OMPT_TRACE@ + config.has_libm = @LIBOMP_HAVE_LIBM@ ++config.has_libatomic = @LIBOMP_HAVE_LIBATOMIC@ + + # Let the main config do the real work. + lit_config.load_config(config, "@LIBOMP_BASE_DIR@/test/lit.cfg") +- +-- +2.12.0 + diff --git a/sys-libs/libomp/libomp-4.0.0_rc2.ebuild b/sys-libs/libomp/libomp-4.0.0_rc2.ebuild deleted file mode 100644 index 1ff6114e8f15..000000000000 --- a/sys-libs/libomp/libomp-4.0.0_rc2.ebuild +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -: ${CMAKE_MAKEFILE_GENERATOR:=ninja} -# (needed due to CMAKE_BUILD_TYPE != Gentoo) -CMAKE_MIN_VERSION=3.7.0-r1 -PYTHON_COMPAT=( python2_7 ) - -inherit cmake-multilib python-any-r1 - -DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" -HOMEPAGE="http://openmp.llvm.org" -SRC_URI="http://www.llvm.org/pre-releases/${PV/_//}/openmp-${PV/_/}.src.tar.xz" - -# Additional licenses: -# - MIT-licensed Intel code, -# - LLVM Software Grant from Intel. - -LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" -IUSE="hwloc ompt test" - -RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )" -# tests: -# - dev-python/lit provides the test runner -# - sys-devel/llvm provide test utils (e.g. FileCheck) -# - sys-devel/clang provides the compiler to run tests -DEPEND="${RDEPEND} - dev-lang/perl - test? ( - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - sys-devel/llvm - >=sys-devel/clang-3.9.0 - )" - -S=${WORKDIR}/openmp-${PV/_/}.src - -# least intrusive of all -CMAKE_BUILD_TYPE=RelWithDebInfo - -python_check_deps() { - has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -pkg_setup() { - use test && python-any-r1_pkg_setup -} - -multilib_src_configure() { - local libdir="$(get_libdir)" - local mycmakeargs=( - -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}" - -DLIBOMP_USE_HWLOC=$(usex hwloc) - -DLIBOMP_OMPT_SUPPORT=$(usex ompt) - # do not install libgomp.so & libiomp5.so aliases - -DLIBOMP_INSTALL_ALIASES=OFF - # disable unnecessary hack copying stuff back to srcdir - -DLIBOMP_COPY_EXPORTS=OFF - -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")" - ) - cmake-utils_src_configure -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake-utils_src_make check-libomp -} diff --git a/sys-libs/libomp/libomp-4.0.0_rc3.ebuild b/sys-libs/libomp/libomp-4.0.0_rc3.ebuild new file mode 100644 index 000000000000..ebb233b08e06 --- /dev/null +++ b/sys-libs/libomp/libomp-4.0.0_rc3.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +: ${CMAKE_MAKEFILE_GENERATOR:=ninja} +# (needed due to CMAKE_BUILD_TYPE != Gentoo) +CMAKE_MIN_VERSION=3.7.0-r1 +PYTHON_COMPAT=( python2_7 ) + +inherit cmake-multilib python-any-r1 + +DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" +HOMEPAGE="http://openmp.llvm.org" +SRC_URI="http://www.llvm.org/pre-releases/${PV/_//}/openmp-${PV/_/}.src.tar.xz" + +# Additional licenses: +# - MIT-licensed Intel code, +# - LLVM Software Grant from Intel. + +LICENSE="|| ( UoI-NCSA MIT ) MIT LLVM-Grant" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +IUSE="hwloc ompt test" + +RDEPEND="hwloc? ( sys-apps/hwloc:0=[${MULTILIB_USEDEP}] )" +# tests: +# - dev-python/lit provides the test runner +# - sys-devel/llvm provide test utils (e.g. FileCheck) +# - sys-devel/clang provides the compiler to run tests +DEPEND="${RDEPEND} + dev-lang/perl + test? ( + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + sys-devel/llvm + >=sys-devel/clang-3.9.0 + )" + +S=${WORKDIR}/openmp-${PV/_/}.src + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +python_check_deps() { + has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + use test && python-any-r1_pkg_setup +} + +src_prepare() { + # fix atomic tests with gcc + eapply "${FILESDIR}"/4.0.0/0001-test-Try-to-link-latomic-to-provide-atomics-when-ava.patch + + eapply_user +} + +multilib_src_configure() { + local libdir="$(get_libdir)" + local mycmakeargs=( + -DLIBOMP_LIBDIR_SUFFIX="${libdir#lib}" + -DLIBOMP_USE_HWLOC=$(usex hwloc) + -DLIBOMP_OMPT_SUPPORT=$(usex ompt) + # do not install libgomp.so & libiomp5.so aliases + -DLIBOMP_INSTALL_ALIASES=OFF + # disable unnecessary hack copying stuff back to srcdir + -DLIBOMP_COPY_EXPORTS=OFF + -DLIBOMP_TEST_COMPILER="$(type -P "${CHOST}-clang")" + ) + cmake-utils_src_configure +} + +multilib_src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + + cmake-utils_src_make check-libomp +} -- cgit v1.2.3-65-gdbad