Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 302839 - sci-libs/blas-atlas-3.9.21 fails to compile with: #error "SSE3 instruction set not enabled"
Summary: sci-libs/blas-atlas-3.9.21 fails to compile with: #error "SSE3 instruction se...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Markus Dittrich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-30 07:55 UTC by David Kredba
Modified: 2011-02-12 15:36 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log gziped (build.log.gz,121.83 KB, application/octet-stream)
2010-01-30 07:58 UTC, David Kredba
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kredba 2010-01-30 07:55:52 UTC
sci-libs/blas-atlas-3.9.21 fails to compile:

libtool: compile:  gcc -DL2SIZE=4194304 -I/var/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/include -I/var/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/..//include -I/var/tmp/portage/sci-libs/blas-atlas-3.9.21/work/ATLAS/gentoo-build/..//include/contrib -DAdd_ -DF77_INTEGER=int -DStringSunStyle -DATL_OS_Linux -DATL_ARCH_Core2 -DATL_CPUMHZ=2504 -DATL_SSE3 -DATL_SSE2 -DATL_SSE1 -DATL_USE64BITS -DATL_GAS_x8664 -DATL_NCPU=4 -DATL_UCLEANM -DATL_UCLEANN -DATL_UCLEANK -O2 -g -ggdb -pipe -m64 -c ATL_cNBmm_b0.c  -fPIC -DPIC -o .libs/ATL_cNBmm_b0.o                                                                                                                                   
In file included from ATL_cNBmm_b0.c:55:                                                                                                                                                                                                     
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/pmmintrin.h:32:3: error: #error "SSE3 instruction set not enabled"                                                                                                                            
ATL_cNBmm_b0.c: In function 'ATL_cJIK80x80x80TN80x80x0_a1_b0':                                                                                                                                                                               
ATL_cNBmm_b0.c:76: error: '__m128' undeclared (first use in this function)                                                                                                                                                                   
ATL_cNBmm_b0.c:76: error: (Each undeclared identifier is reported only once                                                                                                                                                                  
ATL_cNBmm_b0.c:76: error: for each function it appears in.)                                                                                                                                                                                  
ATL_cNBmm_b0.c:76: error: expected ';' before 'c0_0'                                                                                                                                                                                         
ATL_cNBmm_b0.c:77: error: expected ';' before 'c1_0'                                                                                                                                                                                         
ATL_cNBmm_b0.c:79: error: expected ';' before 'temp'                                                                                                                                                                                         
ATL_cNBmm_b0.c:80: error: expected ';' before 'temp0'                                                                                                                                                                                        
ATL_cNBmm_b0.c:81: error: expected ';' before 'temp1'                                                                                                                                                                                        
ATL_cNBmm_b0.c:82: error: expected ';' before 'temp2'                                                                                                                                                                                        
ATL_cNBmm_b0.c:83: error: expected ';' before 'temp3'                                                                                                                                                                                        
ATL_cNBmm_b0.c:95: error: expected ';' before 'A0'                                                                                                                                                                                           
ATL_cNBmm_b0.c:97: error: expected ';' before 'B0'                                                                                                                                                                                           
ATL_cNBmm_b0.c:119: error: 'A0' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:120: error: 'A1' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:121: error: 'A2' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:122: error: 'A3' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:123: error: 'B0' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:124: error: 'c0_0' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:126: error: 'c0_1' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:128: error: 'c0_2' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:130: error: 'c0_3' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:133: error: 'B1' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:134: error: 'c1_0' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:136: error: 'c1_1' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:138: error: 'c1_2' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:140: error: 'c1_3' undeclared (first use in this function)                                                                                                                                                                    
ATL_cNBmm_b0.c:152: error: 'a0' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:155: error: 'a1' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:158: error: 'a2' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:161: error: 'a3' undeclared (first use in this function)                                                                                                                                                                      
ATL_cNBmm_b0.c:712: error: 'temp' undeclared (first use in this function)                                                                                                                                                                    
make[7]: *** [ATL_cNBmm_b0.o] Error 1

Reproducible: Always

Steps to Reproduce:
1.Be ~amd64
2.emerge --oneshot =sci-libs/blas-atlas-3.9.21
3.

Actual Results:  
Fails to compile with: #error "SSE3 instruction set not enabled".

Expected Results:  
Builds and run fine.

Portage 2.1.7.17 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.11-r1, 2.6.32-gentoo-r1-1d x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-r1-1d-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 30 Jan 2010 04:30:01 +0000
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4, 3.1.1-r1
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -g -ggdb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -g -ggdb -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news nostrip parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -g -ggdb -pipe"
GENTOO_MIRRORS="ftp://gentoo.inode.at/source/ ftp://gentoo.mirror.web4u.cz/ "
LDFLAGS="-Wl,-O1"
LINGUAS="cs en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="echo"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo caps cdr cli consolekit cracklib crypt cups cxx dbus djvu dri dts dvd dvdr eds emboss encode evo examples exif extras fam firefox flac fontconfig fontforge fortran gdbm gif gmp gnome gpm gstreamer gtk hal iconv idn ithreads java jpeg jpeg2k kde kerberos lcms ldap libedit libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses nls nptl nptlonly objc objc++ objc-gc odbc ogg openexr opengl openmp pam pch pcre pdf perl png policykit ppds pppd python qt3support qt4 quicktime readline reflection samba sdl session slang spell spl sqlite sse sse2 sse3 ssl startup-notification svg sysfs tcl tcpd threads thunar tiff tk truetype unicode usb utils vorbis x264 xattr xcb xinerama xml xorg xpm xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs en" LIRC_DEVICES="inputlirc" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 David Kredba 2010-01-30 07:58:44 UTC
Created attachment 217901 [details]
Build log gziped
Comment 2 Markus Dittrich (RETIRED) gentoo-dev 2010-02-11 23:55:31 UTC
Thanks for the report, I'll have a look.

Markus
Comment 3 Markus Dittrich (RETIRED) gentoo-dev 2010-02-12 03:39:15 UTC
Could you please try recompiling with "-march=core2"
included in your CFLAGS to make sure gcc enables SSE3.

Thanks,
Markus
Comment 4 David Kredba 2010-02-16 18:15:07 UTC
It works perfectly with -march=core2.

Thank you.
Comment 5 Markus Dittrich (RETIRED) gentoo-dev 2010-02-18 20:14:40 UTC
Great! Unfortunately, I am not quite sure what the best
way to proceed from here is. It seems that without an explicit 
march=core2 gcc is pessimistic and disables SSE3 instructions completely.
Hence, it would definitely be good to add this to your CFLAGS.

I am not sure if there is much I can do about this in terms of
checking within the ebuild. Hence, I'd tend to mark this as fixed 
as is - are there any objections?

Thanks,
Markus
Comment 6 David Kredba 2010-02-19 19:47:11 UTC
No, there are not.

Maybe a little note in ebuild like "if build fails complaining about SSE3 try to ...."? 
To save your time and Bugzilla space.


It seems for me that in time build logic of the original package changed.

I think that working with something like "if there is ssse3 in the /proc/cpuinfo and model name is one of ....... then add -march=xxxxx to the CFLAGS in ebuild will cause more trouble than profit.

Thank you.
Comment 7 Markus Dittrich (RETIRED) gentoo-dev 2010-02-26 02:17:29 UTC
Thanks for the suggestions, David. I'll have to think about what
might be most beneficial to users and might indeed add
a comment to the ebuild.

Thanks again,
Markus
Comment 8 Justin Lecher (RETIRED) gentoo-dev 2010-04-17 09:40:42 UTC
*** Bug 314027 has been marked as a duplicate of this bug. ***
Comment 9 mehrunes 2010-05-19 04:02:46 UTC
(In reply to comment #5)
> Great! Unfortunately, I am not quite sure what the best
> way to proceed from here is. It seems that without an explicit 
> march=core2 gcc is pessimistic and disables SSE3 instructions completely.
is this true for any version of gcc?
> Hence, it would definitely be good to add this to your CFLAGS.
and what if i have amd64?

IMHO i should not set compiler flag to core2 on amd platform. So how can i compile sci-libs/blas-atlas-3.9.21?
Comment 10 cmuelle8 2011-02-12 15:36:52 UTC
You need to tell portage to use march=athlon64-sse3, or better march=native - this happens if you upgrade your AMD CPU from a non-sse3 to a sse3-chip

Use

diff -u      <(export TESTFLAGS="-march=athlon64-sse3"; export OUTPUT=athlon64-sse3; touch $OUTPUT.cc; gcc $TESTFLAGS -fverbose-asm $OUTPUT.cc -S; cat $OUTPUT.s; unset OUTPUT TESTFLAGS; rm -f $OUTPUT.cc)       <(export TESTFLAGS="-march=native"; export OUTPUT=native; touch $OUTPUT.cc; gcc $TESTFLAGS -fverbose-asm $OUTPUT.cc -S; cat $OUTPUT.s; unset OUTPUT TESTFLAGS; rm -f $OUTPUT.cc)


to see the different flags, GCC activates depending on the march flag you set..


SAMPLE OUTPUT from my machine:
--- /dev/fd/63  2011-02-12 16:32:18.130490005 +0100
+++ /dev/fd/62  2011-02-12 16:32:18.130490005 +0100
@@ -1,9 +1,11 @@
-       .file   "athlon64-sse3.cc"
+       .file   "native.cc"
 # GNU C++ (Gentoo 4.4.5 p1.1, pie-0.4.5) version 4.4.5 (x86_64-pc-linux-gnu)
 #      compiled by GNU C version 4.4.5, GMP version 5.0.1, MPFR version 3.0.0-p3.
 # GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
-# angegebene Optionen:  -D_GNU_SOURCE athlon64-sse3.cc -D_FORTIFY_SOURCE=2
-# -march=athlon64-sse3 -fverbose-asm
+# angegebene Optionen:  -D_GNU_SOURCE native.cc -D_FORTIFY_SOURCE=2
+# -march=amdfam10 -mcx16 -msahf -mpopcnt --param l1-cache-size=64 --param
+# l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10
+# -fverbose-asm
 # angeschaltete Optionen:  -falign-loops -fargument-alias
 # -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
 # -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
@@ -18,9 +20,10 @@
 # -ftree-reassoc -ftree-scev-cprop -ftree-switch-conversion
 # -ftree-vect-loop-version -funit-at-a-time -funwind-tables
 # -fvect-cost-model -fverbose-asm -fzero-initialized-in-bss
-# -m128bit-long-double -m3dnow -m64 -m80387 -maccumulate-outgoing-args
-# -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfused-madd -mglibc
-# -mieee-fp -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2 -msse3
+# -m128bit-long-double -m3dnow -m64 -m80387 -mabm
+# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
+# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4 -mpopcnt
+# -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -msse4a
 # -mtls-direct-seg-refs
 
 # Compiler executable checksum: 430874aaeace404ef8c2381e200db136