Open terjekv opened 4 years ago
When built on the i5 itself, 0.3.7-GCC-8.3.0 produces libopenblas_haswellp-r0.3.7.so
as expected.
Well, I found out why. OpenBLAS with EasyBuild never supported optarch. And it's documented as a special case: https://easybuild.readthedocs.io/en/latest/Controlling_compiler_optimization_flags.html#caveats
For example, the OpenBLAS build system will autodetect the processor architecture in the build host, and will optimize for that processor architecture by default.
If you want a generic OpenBLAS build you will need to tweak the OpenBLAS easyconfig file to define the desired TARGET to use. For this you will need to modify the buildopts easyconfig parameter, for example:
buildopts = 'TARGET=PRESCOTT BINARY=64 ' + threading + ' CC="$CC" FC="$F77"'
I might have to see if there is a way to resolve this somehow in the OpenBLAS EasyBlock, so at least the optarch is adhered to.
This can probably be fixed in the easyblock, indeed. I think the documentation dates from before we had a custom easyblock for OpenBLAS (when we were still using ConfigureMake
).
Same behavior with OpenBLAS-0.3.9-GCC-9.3.0.eb. Using --optarch=march=skylake
compiles with both flags -march=skylake -march=skylake-avx512
. Is there a workaround?
@BerndDoser There is no workaround directly in EasyBuild right now. I have not had time to look at this in a long while, sorry. There is an old WIP here https://github.com/easybuilders/easybuild-easyblocks/pull/1946 that requires a bit of work right now. As such, the options are basically:
1) Build OpenBLAS on a node with the desired architecture, or 2) manually edit https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/o/openblas.py to ensure that TARGET is set to an appropriate arch based on TargetList.txt in the OpenBLAS source.
I really should sit down and work on that PR. Sorry. :-(
OpenBLAS/0.3.7-GCC-8.3.0 built with optarch=GENERIC returns an illegal instruction when used via R on an i5 without avx512. OpenBLAS/0.3.5-GCC-8.2.0-2.31.1 does not suffer from this issue.
Interesting feature here, these are all built on the same host with the same optarch=GENERIC: