Closed jowodo closed 1 year ago
This is expected and explained in the section entitled "Disabling the SSE, AVX and FMA code paths" in the INSTALL document:
Disabling the SSE, AVX and FMA code paths
------------------------------------------------------------------------
MrBayes will use SSE, AVX and FMA instructions to speed up computations
on CPUs that support these instruction sets, if the compiler supports
it. These code paths are however optional, and if you suspect a bug in
part of this code, you may use "--disable-sse", "--disable-avx" and/or
"--disable-fma" to disable it when running the "configure" script.
Note however, that disabling SSE will also disable AVX and FMA, and
disabling AVX will also disable FMA.
Note also that disabling these accelerated code paths will not remove
the "-msse" (etc.) compiler flags. These compiler flags affects what
instructions the compiler is allowed to generate, not what code path is
chosen for compilation.
What this says is that --disable-avx
(and --disable-sse
) option will disable the compilation of the code that uses explicit AVX (or SSE) vector instructions. If the system on which the code is being compiled supports AVX, the compilation may still enable the -mavx
(or similar) compiler options, even if --disable-avx
is used (because this configuration option is used solely to disable the specially optimised code paths).
Thanks for the hint and sorry for not searching the documentation first. Is there a possibility to compile without AVX2 on AVX2 supporting machines, though? Editing the Makefile doesn't work as mentioned in the original post. Doesn't make use the Makefile as configuration file?
Thanks a lot!
Thanks for the hint and sorry for not searching the documentation first. Is there a possibility to compile without AVX2 on AVX2 supporting machines, though? Editing the Makefile doesn't work as mentioned in the original post. Doesn't make use the Makefile as configuration file?
Thanks a lot!
Editing the Makefile works, but you will have to edit the correct Makefile. The Makefile in the src
subdirectory is the one used when the executable is compiled.
sed -i.bak '/^SIMD_FLAGS/ s/-mavx2//' src/Makefile
Thanks a lot! Of course I have to edit the correct Makefile 😄
I had to add some sed
expressions like -e '/^CPUEXT_FLAGS/ s/-mrdrnd//'
. Now it works!
What is the current observed behaviour?
Compile on AVX2 capable machine:
Execute on AVX incapable machine:
Even after removing
-mavx2
from theMakefile
mb
is compiled with-mavx2
flag:What is the expected/wanted behaviour?
Compile without `-mavx2 flag
Would you be able to compile and run MrBayes to test fixes to this bug?
git
and how to compile MrBayes.What is the environment that you run MrBayes in?
Version: 3.2.7a Features: SSE readline Host type: x86_64-unknown-linux-gnu (CPU: x86_64) Compiler: gnu 8.5.0