From patchwork Tue Apr 7 11:15:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1267370 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=pRGICktr; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48xPwY1QWjz9sSr for ; Tue, 7 Apr 2020 21:15:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9D2BE22128; Tue, 7 Apr 2020 11:15:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N+CwcuD7cKSz; Tue, 7 Apr 2020 11:15:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 5063620439; Tue, 7 Apr 2020 11:15:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id F000B1BF844 for ; Tue, 7 Apr 2020 11:15:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EC78C87ED2 for ; Tue, 7 Apr 2020 11:15:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7o9CxMUtIJWf for ; Tue, 7 Apr 2020 11:15:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id 09A5D87EBA for ; Tue, 7 Apr 2020 11:15:49 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id h11so1116611plk.7 for ; Tue, 07 Apr 2020 04:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6kh9vjUcc7UbiBXkEMeBnXaCNKghKw7ie/iR6uSjFOw=; b=pRGICktrQnha2pCaWhs0q3CQcQQLp94MpedeCekIm5J12TP7ANWAU3UD9KXcmMnOO/ dOvFUbSwQsDjU5w+gj3OOWx6+lq2KSkBGSTXn4ryDmXAephGxrCmpLojPLdZ6qAmR/EC OJBhyFc5GCKt3z8uVn67ViAyBhjV3b0LYzHCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6kh9vjUcc7UbiBXkEMeBnXaCNKghKw7ie/iR6uSjFOw=; b=CFMpOduK6+nkDjZOOKWqSgFRX5UVDGsPLauV2TZoYvgZZt1yTqQoMm5cA2kPfI0uKY 0HT6Yc/f1XYcg0woAUtL5hGdwr8h5dVvpKyzg+Yi4DmCKICuOrjC7T4mXPy5Lua30DKe Vk9GD4hQXNfAjNThjCxJFU/zt3utiO8YPZMhYrubVhmUW5krj4eZXOXNKCkK4xXP6gWI SUSRn58/rLl1bCZbDx+Sdr9h4bFEY9xtWKYNWz86AzWxkZqgFx9fzjBTdmEbsS2MO2Pd nwJaGde/14GU+em6teu/jA75jBm/Ek5mec1gvHo1MqPP0Fyt+QHNRYHACECz8nApzetG aafQ== X-Gm-Message-State: AGi0PuYQfiHWhyQGiRJZJNF8DIWWN6AuGe+6mNZKc/xQ10jsHt+2WYAe BMft4S50cm9R59nNOQGBMAIgAgGiUyM= X-Google-Smtp-Source: APiQypKFngzDEmfdN4o3AedDO3qgd0f4eEHGaCPEVnwv2QJ9bslBmDvANVxgVGRYozdDZ5N6kACR7g== X-Received: by 2002:a17:90a:868b:: with SMTP id p11mr2270707pjn.34.1586258148403; Tue, 07 Apr 2020 04:15:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:79b0:3a91:34a5:abd7]) by smtp.gmail.com with ESMTPSA id e187sm13788802pfe.50.2020.04.07.04.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 04:15:47 -0700 (PDT) From: Jagan Teki To: buildroot@buildroot.org Date: Tue, 7 Apr 2020 16:45:12 +0530 Message-Id: <20200407111515.21131-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407111515.21131-1-jagan@amarulasolutions.com> References: <20200407111515.21131-1-jagan@amarulasolutions.com> Subject: [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Esben Haabendal , Jagan Teki , Suniel Mahesh , linux-amarula@amarulasolutions.com, "Yann E . MORIN" , Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Esben Haabendal Inorder to build the numpy distutils extension packages like python-scipy, python-numba, it require an explicit pkg-config path fixup for npymath.ini. This pkg-config path fixup would update the prefix path of npymath.ini with actual target staging area where numpy core was built, so-that numpy distutils extension packages would explicitly link this config path for their package environment. Without this extension packages cannot find -lnpymath since it uses host libraries (like libnpymath.a). So, attach the post install staging hook with pkg-config path fixup for npymath.ini. Signed-off-by: Esben Haabendal Signed-off-by: Jagan Teki --- Changes for v8: - none Changes for v7: - rephrase commit and comments of fixup npymath.ini package/python-numpy/python-numpy.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/python-numpy/python-numpy.mk b/package/python-numpy/python-numpy.mk index 3f0df7a640..4d2e852b43 100644 --- a/package/python-numpy/python-numpy.mk +++ b/package/python-numpy/python-numpy.mk @@ -32,6 +32,21 @@ define PYTHON_NUMPY_CONFIGURE_CMDS echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg endef +# Fixup the npymath.ini prefix path with actual target staging area where +# numpy core was built. Without this, target builds using numpy distutils +# extensions like python-scipy, python-numba cannot find -lnpymath since +# it uses host libraries (like libnpymath.a). +# So, the numpy distutils extension packages would explicitly link this +# config path for their package environment. +PYTHON_NUMPY_STAGING_DIR = $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy +PYTHON_NUMPY_NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_STAGING_DIR)/core/lib/npy-pkg-config +define PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES + sed -e '/^pkgdir=/d' \ + -e '/^prefix=/i pkgdir=$(PYTHON_NUMPY_STAGING_DIR)/core' \ + -i $(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)/npymath.ini +endef +PYTHON_NUMPY_POST_INSTALL_STAGING_HOOKS += PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES + # Some package may include few headers from NumPy, so let's install it # in the staging area. PYTHON_NUMPY_INSTALL_STAGING = YES