Opened 4 years ago

Closed 3 years ago

#61643 closed defect (fixed)

OpenBLAS @0.3.12 +gcc9: Build error: "always_inline function '_mm256_loadu_ps' requires target feature 'avx', but would be inlined into function 'ssum_k' that is compiled without support for 'avx'"

Reported by: anowacki (Andy Nowacki) Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: michaelld (Michael Dickens), anowacki (Andy Nowacki)
Port: OpenBLAS

Description

Trying to build OpenBLAS @0.3.12 +gcc9 on a MacPro 6.1 (macOS 10.14.6, Xcode 11.3.1) leads to errors in the build complaining that AVX features cannot be inlined into functions compiled without AVX support:

:info:build /usr/bin/clang -c -O3 -DMAX_STACK_ALLOC=2048 -DEXPRECISION -Wall -m64 -DF_INTERFACE_GFOR
T -fPIC -DNO_AVX512 -DSMP_SERVER -DMAX_CPU_NUMBER=12 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUIL
D_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"1\" -msse3 -mssse3 -msse4.1 -UASMNAME -
UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_strmm_iutncopy -DASMFNAME=_strmm_iutnco
py_ -DNAME=strmm_iutncopy_ -DCNAME=strmm_iutncopy -DCHAR_NAME=\"strmm_iutncopy_\" -DCHAR_CNAME=\"str
mm_iutncopy\" -DNO_AFFINITY -I.. -UDOUBLE  -UCOMPLEX -Wno-uninitialized -UDOUBLE -UCOMPLEX -UOUTER -
ULOWER -UUNIT generic/trmm_utcopy_16.c -o strmm_iutncopy.o
:info:build ../kernel/x86_64/../arm/sum.c:69:17: error: always_inline function '_mm256_setzero_ps' r
equires target feature 'avx', but would be inlined into function 'ssum_k' that is compiled without s
upport for 'avx'
:info:build                 v_f32 vsum0 = v_zero_f32();
:info:build                               ^
:info:build ../kernel/x86_64/../arm/../simd/intrin_avx.h:59:20: note: expanded from macro 'v_zero_f3
2'
:info:build #define v_zero_f32 _mm256_setzero_ps

Likewise for the attempted inlining of _mm256_add_ps. _mm256_loadu_ps, and so on.

My machine only supports AVX1 according to {sysctl}.

I haven't yet tried OpenBLAS-devel.

Logfile attached.

Attachments (2)

main.log (1.5 MB) - added by anowacki (Andy Nowacki) 4 years ago.
Log file for build of OpenBLAS @0.3.12 +gcc9
main.2.log (1.5 MB) - added by anowacki (Andy Nowacki) 4 years ago.
Log file for build of OpenBLAS @0.3.12 +gcc9 +native

Change History (9)

Changed 4 years ago by anowacki (Andy Nowacki)

Attachment: main.log added

Log file for build of OpenBLAS @0.3.12 +gcc9

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: NicosPavlov removed
Owner: set to NicosPavlov
Status: newassigned

comment:2 Changed 4 years ago by kencu (Ken)

for buildbot purposes, the openblas Portfile tries to estimate your machines likely capabilities. It doesn't work 100%, but nearly so.

try building the native variant to allow openblas to self-configure:

sudo port clean openblas
sudo port -v install openblas +native

comment:3 Changed 4 years ago by anowacki (Andy Nowacki)

Thank you for the suggestion—I didn't realise what +native was for!

Unfortunately I get the same error even with port install openblas +gcc9 +native:

/usr/bin/clang -c -O3 -DMAX_STACK_ALLOC=2048 -DEXPRECISION -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DNO_AVX512 -DSMP_SERVER -DMAX_CPU_NUMBER=12 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"1\" -msse3 -mssse3 -msse4.1 -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_strmm_iutncopy -DASMFNAME=_strmm_iutncopy_ -DNAME=strmm_iutncopy_ -DCNAME=strmm_iutncopy -DCHAR_NAME=\"strmm_iutncopy_\" -DCHAR_CNAME=\"strmm_iutncopy\" -DNO_AFFINITY -I.. -UDOUBLE  -UCOMPLEX -Wno-uninitialized -UDOUBLE -UCOMPLEX -UOUTER -ULOWER -UUNIT generic/trmm_utcopy_16.c -o strmm_iutncopy.o
../kernel/x86_64/../arm/sum.c:69:17: error: always_inline function '_mm256_setzero_ps' requires target feature 'avx', but would be inlined into function 'ssum_k' that is compiled without support for 'avx'
                v_f32 vsum0 = v_zero_f32();
                              ^
../kernel/x86_64/../arm/../simd/intrin_avx.h:59:20: note: expanded from macro 'v_zero_f32'
#define v_zero_f32 _mm256_setzero_ps
                   ^
../kernel/x86_64/../arm/sum.c:70:17: error: always_inline function '_mm256_setzero_ps' requires target feature 'avx', but would be inlined into function 'ssum_k' that is compiled without support for 'avx'

Might this be related to trying to use GCC9 (since I already have it installed)?

Changed 4 years ago by anowacki (Andy Nowacki)

Attachment: main.2.log added

Log file for build of OpenBLAS @0.3.12 +gcc9 +native

comment:4 Changed 4 years ago by anowacki (Andy Nowacki)

Cc: anowacki added

comment:5 Changed 4 years ago by kencu (Ken)

maybe due to gcc9. try not forcing gcc9 and see what happens.

comment:6 Changed 4 years ago by anowacki (Andy Nowacki)

Allowing a GCC10 build worked, and OpenBLAS installed without building from source—thanks for that suggestion too.

However, it did require rebuilding

 py37-matplotlib @3.3.0+cairo+gtk3+tkinter+webagg
 py37-gdal @3.1.0
 gmt4 @4.5.18+gdal+triangle
 gmt5 @5.4.5+gdal+nonfree+pcre

since these were built with GCC9.

This solves my issue for now, but presumably the non-default GCC version variants are expected to work, and it seems at least the +gcc9 variant did work until recently: I was upgrading from OpenBLAS @0.3.10_1+gcc9+lapack+native. I guess that means the error must have been introduced at some point since that version was the most recent.

comment:7 Changed 3 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

OpenBLAS is at 0.3.15 and about to be upgraded to 0.3.16. This issue is about 0.3.12, which is somewhat old now. I'm closing this as "fixed" since it probably has been in the interim. If anybody has this issue still, please update us with the new build log and we'll see what we can do.

Note: See TracTickets for help on using tickets.