From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qAV6CiMnGGBkWwAA0tVLHw (envelope-from ) for ; Mon, 01 Feb 2021 16:06:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uMAmBiMnGGBhHwAAbx9fmQ (envelope-from ) for ; Mon, 01 Feb 2021 16:06:59 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D531C9403E6 for ; Mon, 1 Feb 2021 16:06:58 +0000 (UTC) Received: from localhost ([::1]:33834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bj7-0004gP-PM for larch@yhetil.org; Mon, 01 Feb 2021 11:06:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bhH-0002e8-K7 for guix-devel@gnu.org; Mon, 01 Feb 2021 11:05:03 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:6998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bhF-0006IW-4U for guix-devel@gnu.org; Mon, 01 Feb 2021 11:05:03 -0500 X-IronPort-AV: E=Sophos;i="5.79,392,1602540000"; d="scan'208";a="371754551" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 17:04:58 +0100 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: elaexuotee@wilsonb.com Subject: Re: Installing a wrapper guile script in /bin References: <3EA9135IVLYXR.223U6JDXT4SSS@wilsonb.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Pluvi=C3=B4se?= an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 01 Feb 2021 17:04:58 +0100 In-Reply-To: <3EA9135IVLYXR.223U6JDXT4SSS@wilsonb.com> (elaexuotee@wilsonb.com's message of "Mon, 01 Feb 2021 20:28:34 +0900") Message-ID: <874kivlqol.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.104; envelope-from=ludovic.courtes@inria.fr; helo=mail3-relais-sop.national.inria.fr X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.36 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: D531C9403E6 X-Spam-Score: -2.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: +U4s5rAprsuX Hi! elaexuotee@wilsonb.com skribis: > More specifically, the package I have builds separate libraries for CPUs = with > AVX, AVX2, and no AVX support. Since build-type isn't sufficiently specif= ic to > distinguish such CPU features, I have, so far, opted to just build all th= ree > libs and stuff them under /lib/. > > My idea is to have the linker script check CPU features at runtime (by pa= rsing > /proc/cpuinfo or something) and executing the binary with the parameters = to > load the correct binary. > > Perhaps there is a better overall approach? I wrote about this topic in the past: https://hpc.guix.info/blog/2018/01/pre-built-binaries-vs-performance/ I you=E2=80=99re the upstream author, I recommend using one of the techniqu= es given above to provide so-called =E2=80=9Cfat binaries=E2=80=9D that contai= n several implementations of the performance-sensitive functions; the loader will pick the right implementation when the program starts. If you=E2=80=99re downstream=E2=80=A6 it depends on the specifics. The loa= der is also able to pick a .so from the right lib/ sub-directory depending on the micro-architecture. You can try: LD_DEBUG=3Dfiles your program to see where the loader looks for shared libraries. HTH! Ludo=E2=80=99.