Bug 245926 - math/openblas: does not build under poudriere on FreeBSD 11.3-RELEASE-p8
Summary: math/openblas: does not build under poudriere on FreeBSD 11.3-RELEASE-p8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2020-04-26 13:03 UTC by Gerard Seibert
Modified: 2021-03-22 16:04 UTC (History)
5 users (show)

See Also:
phd_kimberlite: maintainer-feedback?

Poudriere Build Log For "math/openblas" (8.34 KB, text/plain)
2020-04-26 13:03 UTC, Gerard Seibert
no flags Details
Patch (447 bytes, patch)
2021-03-20 08:14 UTC, Gleb Popov
phd_kimberlite: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerard Seibert 2020-04-26 13:03:11 UTC
Created attachment 213804 [details]
Poudriere Build Log For "math/openblas"

I have tried several times to build this port. Poudriere issues this error message: "has to be built manually: Optimizes for the build machine." A copy of the build log is attached.

FreeBSD scorpio.seibercom.net 11.3-RELEASE-p7 FreeBSD 11.3-RELEASE-p7 #0: Tue Mar 17 08:32:23 UTC 2020     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

~ $ freebsd-version
Comment 1 Rainer Hurling freebsd_committer 2020-04-26 16:48:11 UTC
Hi Gerard,

This is because of the following part in the math/openblas ports Makefile:

.if ! ( ${PORT_OPTIONS:MDYNAMIC_ARCH} && ( ${ARCH} == "amd64" || ${ARCH} == "i386" ) )
MANUAL_PACKAGE_BUILD=   Optimizes for the build machine.

In most cases, _enabling_ OPTION DYNAMIC_ARCH should do the job. 

(Disabling it, the port has to build code optimized for a specific CPU. Poudriere is not able to do this in its default settings.)

Comment 2 Gerard Seibert 2020-04-26 18:11:24 UTC
(In reply to Rainer Hurling from comment #1)

Okay, so what is the recommended way to build this port? "math/suitesparse", "math/py-numpy", and "devel/boost-python-libs" all are skipped by poudriere because the math/openblas port will not build.

This seems like a bug that should have been squashed while ago. This all came about when I tried to install the meta port "x11/kde5"; therefore I doubt that I am the only one experiencing this problem.
Comment 3 Rainer Hurling freebsd_committer 2020-04-26 19:58:58 UTC
(In reply to Gerard Seibert from comment #2)

As I said in comment #1, enabling OPTION DYNAMIC_ARCH in math/openblas should do the job.

You can set/unset options of ports in Poudriere by running "poudriere options ...", before you start with "poudriere bulk ...". 

There are some more ways to set ports options in Poudriere, see 'man 8 poudriere'.
Comment 4 Thierry Thomas freebsd_committer 2020-04-26 20:15:19 UTC
(In reply to Rainer Hurling from comment #3)

Is not PACKAGE_BUILDING set by default in Poudriere?
Comment 5 Rainer Hurling freebsd_committer 2020-04-27 12:23:55 UTC
(In reply to Thierry Thomas from comment #4)

Yes, but even if PACKAGE_BUILDING is set (default), math/openblas does not build, if OPTION DYNAMIC_ARCH is disabled.

I just double checked, at least on my boxes (all 13.0-CURRENT amd64) this seems to be true.
Comment 6 Juraj Lutter freebsd_committer 2020-12-25 17:36:34 UTC
Does this bug still apply? 11.3 is already frozen and not supported.
Comment 7 Rainer Hurling freebsd_committer 2020-12-25 19:39:26 UTC
(In reply to Juraj Lutter from comment #6)
Hi Juraj,

I just tried on Poudriere with HEAD and F114, both with amd64 and i386.

You are right, it builds fine! So the cause for this error does not exist anymore, it seems :)
Comment 8 Gleb Popov freebsd_committer 2021-03-20 08:14:14 UTC
Created attachment 223440 [details]

The problem is still exists and I'm attaching the patch to fix it. The rationale is following:

Blaming the source reveals that this block of code was added 9 years ago, supposedly when the port was created. I believe that most of users were using portmaster/portupgrade to build their ports and poudriere was only used by the package building cluster and FreeBSD developers. The code in question is a safe belt to not allow CPU-specific code to slip into official packages.

However, in 2021 poudriere is a common choice even between non-developers and the whole meaning of MANUAL_PACKAGE_BUILD seems to be changed. I want to build openblas for my CPU only and enabling DYNAMIC_ARCH makes the compilation a lot longer. I believe, removing this check is a right thing to do.
Comment 9 Gleb Popov freebsd_committer 2021-03-22 15:10:21 UTC
Shibisawa-san, can you please describe what you meant by setting "maintainer-feedback" to "+"? You didn't actually gшve any feedback in form of comment.

If you are OK with my patch, set "maintainer-approval" to "+" on the patch itself, not the whole bug.
Comment 10 commit-hook freebsd_committer 2021-03-22 16:01:02 UTC
A commit references this bug:

Author: arrowd
Date: Mon Mar 22 16:00:59 UTC 2021
New revision: 568969
URL: https://svnweb.freebsd.org/changeset/ports/568969

  math/openblas: Allow building in poudriere with DYNAMIC_ARCH=off.

  The removed check was simply a safety belt. Improve option's description to underline that turning it off semantically equals to building with march=native.

  PR:		245926
  Approved by:	Eijiro Shibusawa <phd_kimberlite@yahoo.co.jp> (maintainer)