Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.3.21 isn't built on M1 #3739

Closed
devcrocod opened this issue Aug 25, 2022 · 4 comments · Fixed by #3749
Closed

Version 0.3.21 isn't built on M1 #3739

devcrocod opened this issue Aug 25, 2022 · 4 comments · Fixed by #3749
Labels
Bug in other software Compiler, Virtual Machine, etc. bug affecting OpenBLAS

Comments

@devcrocod
Copy link

os: macOS
arch: aarch64
C compiler: gcc 11.3.0_1
Fortran compiler: gfortran 11.3.0_1
OpenBLAS version: 0.3.21

make command:

make CC=gcc FC=gfortran HOSTCC=gcc BINARY=64 F_COMPILER=GFORTRAN FEXTRALIB=-lgfortran USE_OPENMP=0 NO_AVX512=1 DYNAMIC_ARCH=1 NUM_THREADS=64

On version 0.3.20, the assembly was successful. When updating the library to 0.3.21, I got the following error:

In file included from ../common.h:133,
                 from ../kernel/arm64/../arm/iamin.c:37:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
In file included from ../common.h:133,
                 from ../kernel/arm64/../arm/imax.c:38:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
In file included from ../common.h:133,
                 from ../kernel/arm64/../arm/min.c:37:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
In file included from ../common.h:133,
                 from ../kernel/arm64/iamax_thunderx2t99.c:28:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
In file included from ../common.h:133,
                 from ../kernel/arm64/../arm/max.c:37:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
In file included from ../common.h:133,
                 from ../kernel/arm64/../arm/amin.c:37:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
In file included from ../common.h:133,
                 from ../kernel/arm64/../arm/imin.c:36:
/opt/homebrew/Cellar/gcc/11.3.0_1/lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed/math.h:68:5: error: #error "Unsupported value of __FLT_EVAL_METHOD__."
   68 | #   error "Unsupported value of __FLT_EVAL_METHOD__."
      |     ^~~~~
make[5]: *** [isamin_k_NEOVERSEN2.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [smax_k_NEOVERSEN2.o] Error 1
make[5]: *** [isamax_k_NEOVERSEN2.o] Error 1
make[5]: *** [smin_k_NEOVERSEN2.o] Error 1
make[5]: *** [ismax_k_NEOVERSEN2.o] Error 1
make[5]: *** [samin_k_NEOVERSEN2.o] Error 1
make[5]: *** [ismin_k_NEOVERSEN2.o] Error 1
@martin-frbg
Copy link
Collaborator

hm, looks like 11.3 may not be recent enough to build Neoverse N2 kernels.
if you need DYNAMIC_ARCH and cannot upgrade gcc, it should be possible to work around this by adding DYNAMIC_LIST="ARMV8 VORTEX" (and whatever other cpus you need except the N2)

@martin-frbg
Copy link
Collaborator

Actually this looks like a GCC build/packaging error, something similar was reported against the macports build of gcc-11 several months ago here: https://trac.macports.org/ticket/63072 (predating the addition of Neoverse N2 in OpenBLAS), with comments claiming that __FLT_EVAL_METHOD__ is supposed to be defined by the compiler itself, to one of the values supported in math.h (which seem to be -1,0,1 or 2, there is/was a similar issue with LLVM discussed at https://www.mail-archive.com/[email protected]/msg267040.html)
(Unfortunately the macports ticket appears to have been pretty much abandoned in an unsolved state)

@martin-frbg martin-frbg added the Bug in other software Compiler, Virtual Machine, etc. bug affecting OpenBLAS label Aug 29, 2022
@martin-frbg
Copy link
Collaborator

Reproduced with the homebrew gcc@11 on M1 - gcc@12 (currently 12.1.0) does not have this program, but here the compile fails for the NeoverseN2 simatcopy_cn kernel with a spurious assembler error "instruction requires sve" despite the -march=armv8.5a+sve+sve2+bf16 . Assembler is from XCode/LLVM (and homebrew binutils does not contain an alternative).

@martin-frbg
Copy link
Collaborator

I can get it to build with gcc-11 as well if I drop the SVE capability from the -march features string. This should do for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug in other software Compiler, Virtual Machine, etc. bug affecting OpenBLAS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants