From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 808C6158041 for ; Sun, 3 Mar 2024 04:01:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 818EAE2A01; Sun, 3 Mar 2024 04:01:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4B19AE2A01 for ; Sun, 3 Mar 2024 04:01:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3D53433BDC5 for ; Sun, 3 Mar 2024 04:01:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5EA5E14EF for ; Sun, 3 Mar 2024 04:00:58 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1709438413.58d080c1bad9b1c0d307f2cf2d0251d60025efb1.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/lapack/, sci-libs/lapack/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-libs/lapack/files/lapack-3.12.0-correct-64bit-interface.patch sci-libs/lapack/lapack-3.12.0-r1.ebuild X-VCS-Directories: sci-libs/lapack/files/ sci-libs/lapack/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 58d080c1bad9b1c0d307f2cf2d0251d60025efb1 X-VCS-Branch: master Date: Sun, 3 Mar 2024 04:00:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c6485e09-f11e-42b4-ab7a-ab37e3f2f1b5 X-Archives-Hash: 35b9605adb1ebc12109bcd043487e0e7 commit: 58d080c1bad9b1c0d307f2cf2d0251d60025efb1 Author: Eli Schwartz gmail com> AuthorDate: Sun Mar 3 03:47:31 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Mar 3 04:00:13 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58d080c1 sci-libs/lapack: backport 64-bit API fix detected by LTO warnings https://github.com/Reference-LAPACK/lapack/issues/990#issuecomment-1973258284 Bug: https://bugs.gentoo.org/878891 Signed-off-by: Eli Schwartz gmail.com> Signed-off-by: Sam James gentoo.org> .../lapack-3.12.0-correct-64bit-interface.patch | 38 +++++++ sci-libs/lapack/lapack-3.12.0-r1.ebuild | 115 +++++++++++++++++++++ 2 files changed, 153 insertions(+) diff --git a/sci-libs/lapack/files/lapack-3.12.0-correct-64bit-interface.patch b/sci-libs/lapack/files/lapack-3.12.0-correct-64bit-interface.patch new file mode 100644 index 000000000000..c9c9479f4522 --- /dev/null +++ b/sci-libs/lapack/files/lapack-3.12.0-correct-64bit-interface.patch @@ -0,0 +1,38 @@ +From 26db2da3eb84856d997e05caf9904a6b56eac1e8 Mon Sep 17 00:00:00 2001 +From: Simon Maertens +Date: Wed, 29 Nov 2023 14:30:30 +0000 +Subject: [PATCH] Fixed Fortran compiler flags check for nagfor compiler and + usage in CBLAS target + +--- + CBLAS/CMakeLists.txt | 4 ++++ + CMAKE/CheckLAPACKCompilerFlags.cmake | 1 + + 2 files changed, 5 insertions(+) + +diff --git a/CBLAS/CMakeLists.txt b/CBLAS/CMakeLists.txt +index c276f7da3d..b01d795af9 100644 +--- a/CBLAS/CMakeLists.txt ++++ b/CBLAS/CMakeLists.txt +@@ -14,6 +14,10 @@ if(CMAKE_Fortran_COMPILER) + FortranCInterface_HEADER(${LAPACK_BINARY_DIR}/include/cblas_mangling.h + MACRO_NAMESPACE "F77_" + SYMBOL_NAMESPACE "F77_") ++ ++ # Check for any necessary platform specific compiler flags ++ include(CheckLAPACKCompilerFlags) ++ CheckLAPACKCompilerFlags() + endif() + if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND) + message(WARNING "Reverting to pre-defined include/cblas_mangling.h") +diff --git a/CMAKE/CheckLAPACKCompilerFlags.cmake b/CMAKE/CheckLAPACKCompilerFlags.cmake +index ecb5009ae5..653b817583 100644 +--- a/CMAKE/CheckLAPACKCompilerFlags.cmake ++++ b/CMAKE/CheckLAPACKCompilerFlags.cmake +@@ -177,6 +177,7 @@ elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" ) + endif() + + # Suppress compiler banner and summary ++ include(CheckFortranCompilerFlag) + check_fortran_compiler_flag("-quiet" _quiet) + if( _quiet AND NOT ("${CMAKE_Fortran_FLAGS}" MATCHES "[-/]quiet") ) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -quiet") diff --git a/sci-libs/lapack/lapack-3.12.0-r1.ebuild b/sci-libs/lapack/lapack-3.12.0-r1.ebuild new file mode 100644 index 000000000000..3a8b93eb620a --- /dev/null +++ b/sci-libs/lapack/lapack-3.12.0-r1.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Some additional tests are run if Python is found +PYTHON_COMPAT=( python3_{10..11} ) +inherit cmake flag-o-matic fortran-2 python-any-r1 + +DESCRIPTION="BLAS, CBLAS, LAPACK, LAPACKE reference implementations" +HOMEPAGE="https://www.netlib.org/lapack/" +SRC_URI="https://github.com/Reference-LAPACK/lapack/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos" +# TODO: static-libs 64bit-index +IUSE="lapacke deprecated doc eselect-ldso test" +RESTRICT="!test? ( test )" + +RDEPEND=" + !app-eselect/eselect-cblas + virtual/fortran + eselect-ldso? ( + >=app-eselect/eselect-blas-0.2 + >=app-eselect/eselect-lapack-0.2 + ) + doc? ( app-doc/blas-docs ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig + test? ( ${PYTHON_DEPS} ) +" + +PATCHES=( + # fix -Werror=lto-type-mismatch caused by a bug that breaks + # the 64-bit interface for cblas + # https://github.com/Reference-LAPACK/lapack/issues/990#issuecomment-1973258284 + # https://bugs.gentoo.org/878891 + "${FILESDIR}"/lapack-3.12.0-correct-64bit-interface.patch +) + +pkg_setup() { + fortran-2_pkg_setup + use test && python-any-r1_pkg_setup +} + +src_configure() { + local mycmakeargs=( + -DCBLAS=ON + -DLAPACKE=$(usex lapacke) + -DBUILD_DEPRECATED=$(usex deprecated) + -DBUILD_SHARED_LIBS=ON + -DBUILD_TESTING=$(usex test) + -DLAPACK_TESTING_USE_PYTHON=$(usex test) + # Breaks cross + -DTEST_FORTRAN_COMPILER=OFF + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + use eselect-ldso || return + # Create private lib directory for eselect::blas (ld.so.conf) + dodir /usr/$(get_libdir)/blas/reference + dosym -r /usr/$(get_libdir)/libblas.so /usr/$(get_libdir)/blas/reference/libblas.so + dosym -r /usr/$(get_libdir)/libblas.so.3 /usr/$(get_libdir)/blas/reference/libblas.so.3 + dosym -r /usr/$(get_libdir)/libcblas.so /usr/$(get_libdir)/blas/reference/libcblas.so + dosym -r /usr/$(get_libdir)/libcblas.so.3 /usr/$(get_libdir)/blas/reference/libcblas.so.3 + + # Create private lib directory for eselect::lapack (ld.so.conf) + dodir /usr/$(get_libdir)/lapack/reference + dosym -r /usr/$(get_libdir)/liblapack.so /usr/$(get_libdir)/lapack/reference/liblapack.so + dosym -r /usr/$(get_libdir)/liblapack.so.3 /usr/$(get_libdir)/lapack/reference/liblapack.so.3 +} + +pkg_postinst() { + use eselect-ldso || return + + local me=reference libdir=$(get_libdir) + # check eselect-blas + eselect blas add ${libdir} "${EPREFIX}"/usr/${libdir}/blas/${me} ${me} + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2) + if [[ ${current_blas} == ${me} || -z ${current_blas} ]]; then + eselect blas set ${libdir} ${me} + elog "Current eselect: BLAS ($libdir) -> [${current_blas}]." + else + elog "Current eselect: BLAS ($libdir) -> [${current_blas}]." + elog "To use blas [${me}] implementation, you have to issue (as root):" + elog "\t eselect blas set ${libdir} ${me}" + fi + + # check eselect-lapack + eselect lapack add ${libdir} "${EPREFIX}"/usr/${libdir}/lapack/${me} ${me} + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2) + if [[ ${current_lapack} == ${me} || -z ${current_lapack} ]]; then + eselect lapack set ${libdir} ${me} + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]." + else + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]." + elog "To use lapack [${me}] implementation, you have to issue (as root):" + elog "\t eselect lapack set ${libdir} ${me}" + fi +} + +pkg_postrm() { + use eselect-ldso || return + + eselect blas validate + eselect lapack validate +}