Bug 207287 - math/openblas fails to build on AMD cpus
Summary: math/openblas fails to build on AMD cpus
Status: Closed DUPLICATE of bug 209412
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 mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-17 20:38 UTC by Beeblebrox
Modified: 2019-09-16 10:24 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (phd_kimberlite)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Beeblebrox 2016-02-17 20:38:17 UTC
Latest version (openblas-0.2.14) fails to build with DYNAMIC_ARCH enabled (which is needed in poudriere). Fails at tests stage, tail of poudriere log:

OPENBLAS_NUM_THREADS=2 ./xzcblat3 < zin3
 cblas_zgemm  PASSED THE TESTS OF ERROR-EXITS
 cblas_zhemm  PASSED THE TESTS OF ERROR-EXITS
 cblas_zsymm  PASSED THE TESTS OF ERROR-EXITS
 cblas_ztrmm  PASSED THE TESTS OF ERROR-EXITS
At line 1433 of file c_zblat3.f
Fortran runtime error: Bad unit number in statement
TESTS OF THE COMPLEX*16        LEVEL 3 BLAS

 THE FOLLOWING PARAMETER VALUES WILL BE USED:
   FOR N                   0     1     2     3     5     9    35
   FOR ALPHA          ( 0.0, 0.0)  ( 1.0, 0.0)  ( 0.7,-0.9)  
   FOR BETA           ( 0.0, 0.0)  ( 1.0, 0.0)  ( 1.3,-1.1)  

 ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN   16.00

 COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED

 RELATIVE MACHINE PRECISION IS TAKEN TO BE  2.2E-16


 cblas_zgemm  PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS ( 27783 CALLS)
 cblas_zgemm  PASSED THE ROW-MAJOR    COMPUTATIONAL TESTS ( 27783 CALLS)


 cblas_zhemm  PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (  1764 CALLS)
 cblas_zhemm  PASSED THE ROW-MAJOR    COMPUTATIONAL TESTS (  1764 CALLS)


 cblas_zsymm  PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (  1764 CALLS)
 cblas_zsymm  PASSED THE ROW-MAJOR    COMPUTATIONAL TESTS (  1764 CALLS)


 ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******
                       EXPECTED RESULT                    COMPUTED RESULT
       1  (   0.346653    ,  -0.292707    )  (   0.346653    ,      -Infinity)
 ******* cblas_ztrmm  FAILED ON CALL NUMBER:
Makefile:71: recipe for target 'all3' failed
gmake[2]: *** [all3] Error 2
Comment 1 Beeblebrox 2016-02-18 08:29:01 UTC
Correction: The problem is not limited to the DYNAMIC_ARCH option. Build fails even if option is disabled and port is built natively.
Comment 2 Cy Schubert freebsd_committer 2016-04-30 13:14:34 UTC
I'm seeing the following failure on a machine with an AMD CPU:

 Test of subprogram number  9            ZDSCAL
                                    ----- PASS -----

 Test of subprogram number 10            IZAMAX
                                    ----- PASS -----
rm -f ?BLAT2.SUMM
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat2 < ./sblat2.dat
rm -f ?BLAT3.SUMM
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./sblat3 < ./sblat3.dat
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./dblat2 < ./dblat2.dat
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./dblat3 < ./dblat3.dat
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./cblat2 < ./cblat2.dat
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./cblat3 < ./cblat3.dat
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./zblat3 < ./zblat3.dat
OMP_NUM_THREADS=1 OMP_NUM_THREADS=1 ./zblat2 < ./zblat2.dat
Assertion failed: (stack_check == 0x7fc01234), function ztrmv_, file ztrmv.c, line 265.

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x2D3345B7
#1  0x2D334B9E
#2  0x7FFFFFFFF192
Makefile:26: recipe for target 'level2' failed
gmake[2]: *** [level2] Abort trap (core dumped)
gmake[2]: Leaving directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.2.18/test'
Makefile:113: recipe for target 'tests' failed
gmake[1]: *** [tests] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/math/openblas/work/OpenBLAS-0.2.18'
*** Error code 2

Stop.
make: stopped in /usr/ports/math/openblas
====>> Cleaning up wrkdir
===>  Cleaning for openblas-0.2.18,1
build of math/openblas ended at Sat Apr 30 01:36:19 PDT 2016
build time: 00:46:44
!!! build failure encountered !!!


It builds fine on a system with an Intel CPU.
Comment 3 Cy Schubert freebsd_committer 2016-04-30 17:41:06 UTC
The only workaround I see for this is to add MAKE_ARGS=MAX_STACK_ALLOC=0. AFAIK this is only required for AMD Barcelona and Bulldozer hardware.
Comment 4 Beeblebrox 2017-01-01 15:48:53 UTC
blas-3.5.0_3 builds fine - no errors. I think you can close this PR.
Comment 5 Cy Schubert freebsd_committer 2017-01-01 18:22:04 UTC
That was addressed by r416576, however the commit is not a permanent fix. Upline still needs to address this.0.2.19 was released in September.
Comment 6 Cy Schubert freebsd_committer 2017-01-01 18:33:58 UTC
DUP of PR 209412.
Comment 7 commit-hook freebsd_committer 2019-09-09 11:16:16 UTC
A commit references this bug:

Author: kib
Date: Mon Sep  9 11:15:14 UTC 2019
New revision: 352056
URL: https://svnweb.freebsd.org/changeset/base/352056

Log:
  Make snprintf(3) and vscanf(3) definitions available under appropriate
  POSIX visibility.

  Reported by:	jbeich
  Reviewed by:	jilles
  PR:	207287
  MFC after:	1 week

Changes:
  head/include/stdio.h
Comment 8 commit-hook freebsd_committer 2019-09-16 06:14:05 UTC
A commit references this bug:

Author: kib
Date: Mon Sep 16 06:13:29 UTC 2019
New revision: 352379
URL: https://svnweb.freebsd.org/changeset/base/352379

Log:
  MFC r352056:
  Make snprintf(3) and vscanf(3) definitions available under appropriate
  POSIX visibility.

  PR:	207287

Changes:
_U  stable/12/
  stable/12/include/stdio.h
Comment 9 commit-hook freebsd_committer 2019-09-16 06:23:08 UTC
A commit references this bug:

Author: kib
Date: Mon Sep 16 06:22:54 UTC 2019
New revision: 352382
URL: https://svnweb.freebsd.org/changeset/base/352382

Log:
  MFC r352056:
  Make snprintf(3) and vscanf(3) definitions available under appropriate
  POSIX visibility.

  PR:	207287

Changes:
_U  stable/11/
  stable/11/include/stdio.h
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-16 10:24:29 UTC
comment 7 comment 8 and comment 9 don't appear to be related to this issue (typo?)

While I'm here, actually close this as a duplicate of bug 209412 (see comment 6)

*** This bug has been marked as a duplicate of bug 209412 ***