[gmx-developers] AVX build issues on Mac OS

Szilárd Páll szilard.pall at cbr.su.se
Mon Sep 17 01:19:21 CEST 2012


The issue of builds with AVX failing on Mac OS has already come up during
the summer (http://goo.gl/62d28), but I have not found any conclusion on
what the general state of AVX on Mac is. To me it seems that compiling with
gcc-4.x (from Macports) doesn't work because the assembler doesn't
recognize vax instructions.

At the same time, the Apple clang 3.0 crashes with a back-end error when
compiling with GMX_ACCELERATION=AVX_256:

[  0%] Building C object src/gmxlib/CMakeFiles/gmx.dir/3dview.c.o
fatal error: error in backend: Cannot select: 0x7fdf09385410: f32 = fsqrt
0x7fdf09388210 [ORD=321] [ID=34]
  0x7fdf09388210: f32 = fadd 0x7fdf09389e10, 0x7fdf0938c510 [ORD=320]
    0x7fdf09389e10: f32 = fadd 0x7fdf09385b10, 0x7fdf0938a310 [ORD=318]
      0x7fdf09385b10: f32 = fmul 0x7fdf0938a510, 0x7fdf0938a510 [ORD=316]
        0x7fdf0938a510: f32,ch = load 0x10a984a38, 0x7fdf09385710,
0x7fdf09386610<LD4[%1]> [ORD=311] [ID=23]
          0x7fdf09385710: i64 = add 0x7fdf09389110, 0x7fdf09388310
[ORD=310] [ID=19]
            0x7fdf09389110: i64,ch = CopyFromReg 0x10a984a38,
0x7fdf0938c810 [ORD=310] [ID=15]
              0x7fdf0938c810: i64 = Register %vreg114 [ORD=310] [ID=1]
            0x7fdf09388310: i64 = Constant<40> [ORD=310] [ID=2]
          0x7fdf09386610: i64 = undef [ORD=311] [ID=3]

clang 3.1 (from Macports) seems to work fine, though.

This issue might cause a lot of headache for Mac OS users which tend to
upgrade often to new hardware and thus often have AVX support. Therefore, I
suggest that we try to come up with a reasonable solution so to avoid that
people end up with cryptic error messages. We could blacklist in the CMake
AVX code-path the bad compilers, but we'd need to identify which ones are
certainly broken with AVX. To me it seems that clang <=v3.0 is  one of
these, but the gcc issues are probably particular to the Macports

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20120917/7bfb897e/attachment.html>

More information about the gromacs.org_gmx-developers mailing list