Bug 276758 - math/openblas: Fails to build with non-default port options
Summary: math/openblas: Fails to build with non-default port options
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 276789
  Show dependency treegraph
 
Reported: 2024-02-01 02:10 UTC by Artyom Davidov
Modified: 2024-02-15 16:53 UTC (History)
1 user (show)

See Also:
phd_kimberlite: maintainer-feedback+


Attachments
Archive with the build log for OpenBlas 0.3.25 (87.15 KB, application/x-gzip)
2024-02-02 00:53 UTC, Artyom Davidov
no flags Details
Proposed patch (1.02 KB, patch)
2024-02-03 00:07 UTC, Artyom Davidov
phd_kimberlite: maintainer-approval+
Details | Diff
Archive with the build log for the proposed patch (658.91 KB, application/x-gzip)
2024-02-03 00:11 UTC, Artyom Davidov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artyom Davidov 2024-02-01 02:10:25 UTC
OpenBlas fails to build with the port options set to:
     AVX=on: Support Advanced Vector Extensions (AVX)
     AVX2=off: Support Advanced Vector Extensions 2 (AVX2)
     DYNAMIC_ARCH=on: Optimize for multiple CPU types, otherwise for this CPU
     INTERFACE64=off: Use 8 byte integers on 64-bit architectures
     OPENMP=off: Use OpenMP for threading

The compilation error is:
dynamic.c:734:15: error: use of undeclared identifier 'gotoblas_SAPPHIRERAPIDS'
             return &gotoblas_SAPPHIRERAPIDS;
                     ^
dynamic.c:1054:20: error: use of undeclared identifier 'gotoblas_SAPPHIRERAPIDS'
  if (gotoblas == &gotoblas_SAPPHIRERAPIDS) return corename[26];
                   ^
2 errors generated.
Comment 1 Artyom Davidov 2024-02-02 00:40:40 UTC
After some testing it turned out that the build fails only with 
AVX=on
AVX2=off
DYNAMIC_ARCH=on

Disabling AVX option or enabling AVX2 option with DYNAMIC_ARCH=on allows port to build successfully.

Some changes were made at upstream code to dynamic.c in the OpenBlas 0.3.26 version, but it seems that OpenBlas 0.3.26 also suffers from this issue.
Comment 2 Artyom Davidov 2024-02-02 00:53:12 UTC
Created attachment 248126 [details]
Archive with the build log for OpenBlas 0.3.25

Attached a full test build log for the OpenBlas version 0.3.25 on a FreeBSD 13.2-RELEASE-p8 amd64 host.
Comment 3 Artyom Davidov 2024-02-03 00:07:41 UTC
Created attachment 248144 [details]
Proposed patch

Added a proposed patch to fix this build issue.

This fix was approved upstream in
https://github.com/OpenMathLib/OpenBLAS/issues/4476
Comment 4 Artyom Davidov 2024-02-03 00:11:24 UTC
Created attachment 248145 [details]
Archive with the build log for the proposed patch

Added a test build log for the proposed patch from a 13.2-RELEASE-p8 amd64 host
Comment 5 Artyom Davidov 2024-02-03 23:42:48 UTC
Some additional information - this patch can be applied to OpenBLAS version 0.3.25 and to the latest version 0.3.26.
We'll have to keep this patch in the ports tree until this bug will be fixed upstream.
Comment 6 Artyom Davidov 2024-02-04 23:09:17 UTC
FYI The proposed patch was included in upstream source code with a https://github.com/OpenMathLib/OpenBLAS/pull/4482

It set to be included in a OpenBLAS 0.3.27 release milestone.

phd_kimberlite@ can you please approve the patch so we can move on on the bug #276789 ?
Comment 7 Artyom Davidov 2024-02-15 16:53:25 UTC
Ping! =)
Any update on this?