Bug 161359 - math/gotoblas build fails on "Sandy Bridge" CPU
Summary: math/gotoblas build fails on "Sandy Bridge" CPU
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Carlos J Puga Medina
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 10:50 UTC by Eijiro Shibusawa
Modified: 2014-09-16 17:17 UTC (History)
1 user (show)

See Also:


Attachments
gotoblas-2.1.13.3.4.0_5.diff (987 bytes, patch)
2014-09-15 11:54 UTC, Carlos J Puga Medina
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eijiro Shibusawa 2011-10-07 10:50:07 UTC
math/gotoblas port fails to build the library with following error:
:
gcc46 -O2 -DEXPRECISION -m128bit-long-double -Wall -m64 -DF_INTERFACE_GFORT -fPIC  -DMAX_CPU_NUMBER=1 -DASMNAME=sgemm_oncopy -DASMFNAME=sgemm_oncopy_ -DNAME=sgemm_oncopy_ -DCNAME=sgemm_oncopy -DCHAR_NAME=\"sgemm_oncopy_\" -DCHAR_CNAME=\"sgemm_oncopy\" -DNO_AFFINITY -I.. -UDOUBLE  -UCOMPLEX -c -UDOUBLE -UCOMPLEX ../kernel/x86_64/gemm_ncopy_4.S -o sgemm_oncopy.o
./kernel/x86_64/gemm_ncopy_4.S: Assembler messages:
./kernel/x86_64/gemm_ncopy_4.S:192: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:193: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:194: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:195: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:197: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:345: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:346: Error: invalid operands (*UND* and *ABS* sections) for `*'
./kernel/x86_64/gemm_ncopy_4.S:348: Error: invalid operands (*UND* and *ABS* sections) for `*'
gmake[1]: *** [sgemm_oncopy.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `/work/a/ports/math/gotoblas/work/GotoBLAS2/kernel'
gmake: *** [libs] Error 1
*** Error code 2

Please notice that this problem seems to be caused on a PC with "Sandy Bridge" CPU,
and it may be machine dependent.
For example, my other PC (with "Penryn" CPU) does NOT reproduce the problem.

The infomation about the CPU in dmesg as follows:
> CPU: Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz (2909.81-MHz K8-class CPU)
> Origin = "GenuineIntel"  Id = 0x206a7  Family = 6  Model = 2a  Stepping = 7
> Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
> Features2=0x179ae3bf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,<b24>,AESNI,XSAVE,<b28>>
> AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
> AMD Features2=0x1<LAHF>
It is detected as "PRESCOTT" in Makefile.conf and config.h,
bacause GOTOBLAS2 does not support "Sandy Bridge" CPU.

Fix: 

[Workaround]
Building the port with WITH_DYNAMIC_ARCH knob as the default setting of the port revision 2.1.13_2.
# cd /usr/ports/math/gotoblas
# make WITH_DYNAMIC_ARCH=true install
How-To-Repeat: Please build the port with default setting.
# cd /usr/ports/math/gotoblas
# make rmconfig
# make
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-10-07 10:50:24 UTC
Responsible Changed
From-To: freebsd-ports-bugs->maho

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Carlo Strub freebsd_committer freebsd_triage 2014-08-29 21:40:32 UTC
Back to pool because there is no maintainer.
Comment 3 Thomas Zander freebsd_committer freebsd_triage 2014-09-15 10:53:49 UTC
Assign to maintainer
Comment 4 Carlos J Puga Medina 2014-09-15 11:22:11 UTC
Can you reproduce it after r367888 was committed?
Comment 5 Carlos J Puga Medina 2014-09-15 11:28:23 UTC
(In reply to phd_kimberlite from comment #0)
> math/gotoblas port fails to build the library with following error:
> :
> gcc46 -O2 -DEXPRECISION -m128bit-long-double -Wall -m64 -DF_INTERFACE_GFORT
> -fPIC  -DMAX_CPU_NUMBER=1 -DASMNAME=sgemm_oncopy -DASMFNAME=sgemm_oncopy_
> -DNAME=sgemm_oncopy_ -DCNAME=sgemm_oncopy -DCHAR_NAME=\"sgemm_oncopy_\"
> -DCHAR_CNAME=\"sgemm_oncopy\" -DNO_AFFINITY -I.. -UDOUBLE  -UCOMPLEX -c
> -UDOUBLE -UCOMPLEX ../kernel/x86_64/gemm_ncopy_4.S -o sgemm_oncopy.o
> ./kernel/x86_64/gemm_ncopy_4.S: Assembler messages:
> ./kernel/x86_64/gemm_ncopy_4.S:192: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:193: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:194: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:195: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:197: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:345: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:346: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> ./kernel/x86_64/gemm_ncopy_4.S:348: Error: invalid operands (*UND* and *ABS*
> sections) for `*'
> gmake[1]: *** [sgemm_oncopy.o] Error 1
> gmake[1]: *** Waiting for unfinished jobs....
> gmake[1]: Leaving directory
> `/work/a/ports/math/gotoblas/work/GotoBLAS2/kernel'
> gmake: *** [libs] Error 1
> *** Error code 2
> 
> Please notice that this problem seems to be caused on a PC with "Sandy
> Bridge" CPU,
> and it may be machine dependent.
> For example, my other PC (with "Penryn" CPU) does NOT reproduce the problem.
> 
> The infomation about the CPU in dmesg as follows:
> > CPU: Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz (2909.81-MHz K8-class CPU)
> > Origin = "GenuineIntel"  Id = 0x206a7  Family = 6  Model = 2a  Stepping = 7
> > Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
> > Features2=0x179ae3bf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,<b24>,AESNI,XSAVE,<b28>>
> > AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
> > AMD Features2=0x1<LAHF>
> It is detected as "PRESCOTT" in Makefile.conf and config.h,
> bacause GOTOBLAS2 does not support "Sandy Bridge" CPU.
> 
> Fix: 
> 
> [Workaround]
> Building the port with WITH_DYNAMIC_ARCH knob as the default setting of the
> port revision 2.1.13_2.
> # cd /usr/ports/math/gotoblas
> # make WITH_DYNAMIC_ARCH=true install
> How-To-Repeat: Please build the port with default setting.
> # cd /usr/ports/math/gotoblas
> # make rmconfig
> # make

Note that gotoblas port already has DYNAMIC_ARCH as configuration option for i386 and amd64.
Comment 6 Carlos J Puga Medina 2014-09-15 11:54:50 UTC
Created attachment 147341 [details]
gotoblas-2.1.13.3.4.0_5.diff

Fix DYNAMIC_ARCH as default option for supported archs.
Comment 7 Carlos J Puga Medina 2014-09-15 12:19:29 UTC
% portlint -ac
WARN: Makefile: QUAD_PRECISION appears in PORT_OPTIONS:M, but is not listed in OPTIONS_DEFINE.
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 2 warnings found.

Build logs via redports:

https://redports.org/buildarchive/20140915120746-38525/
Comment 8 commit-hook freebsd_committer freebsd_triage 2014-09-15 14:53:20 UTC
A commit references this bug:

Author: riggs
Date: Mon Sep 15 14:53:13 UTC 2014
New revision: 368267
URL: http://svnweb.freebsd.org/changeset/ports/368267

Log:
  - Use DYNAMIC_ARCH on i386 and amd64 by default
  - Bump PORTREVISION

  PR:		161359
  Submitted by:	phd_kimberlite@yahoo.co.jp
  Patch by:	cpm@fbsd.es (maintainer)

Changes:
  head/math/gotoblas/Makefile
Comment 9 Thomas Zander freebsd_committer freebsd_triage 2014-09-15 15:00:55 UTC
This processor detection seems very bogus. Is there any chance this get resolved upstream?
Comment 10 Carlos J Puga Medina 2014-09-15 15:45:07 UTC
(In reply to Thomas Zander from comment #9)
> This processor detection seems very bogus. Is there any chance this get
> resolved upstream?

Probably, we should report it upstream. In the meantime this fix is enough.
Comment 11 commit-hook freebsd_committer freebsd_triage 2014-09-16 06:00:06 UTC
A commit references this bug:

Author: riggs
Date: Tue Sep 16 05:59:07 UTC 2014
New revision: 368295
URL: http://svnweb.freebsd.org/changeset/ports/368295

Log:
  - Remove unnecessary ${ARCH} wrappers around OPTIONS_DEFAULT_{i386|amd64}

  PR:		161359
  Pointed out by:	jhale

Changes:
  head/math/gotoblas/Makefile
Comment 12 Carlos J Puga Medina 2014-09-16 17:17:48 UTC
Test build via redports:

https://redports.org/buildarchive/20140916170500-54456/

Thanks for your commit, Jason.