Skip to content

Compiling on Hamilton

When compiling with GCC 4.9.1 on Hamilton I get the following errors when I have used the standard ./configure:

In file included from /ddn/data/hamilton6/apps/gcc/4.9.1/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/include/immintrin.h:61:0,
                 from vector.h:35,
                 from cache.h:30,
                 from runner.h:30,
                 from engine.h:47,
                 from active.h:27,
                 from swift.h:26,
                 from runner_doiact_vec.c:23:
vector.h: In function 'vec_reciprocal':
/ddn/data/hamilton6/apps/gcc/4.9.1/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/include/fmaintrin.h:63:1: error: inlining failed in call to always_inline '_mm256_fmadd_ps': target specific option mismatch
 _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
 ^
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cluster-Apps/hdf5/gcc/1.8.5/include -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -funroll-loops -march=core2 -mavx2 -pthread -Wall -Wextra -Wno-unused-parameter -Werror -MT libswiftsim_la-dump.lo -MD -MP -MF .deps/libswiftsim_la-dump.Tpo -c dump.c  -fPIC -DPIC -o .libs/libswiftsim_la-dump.o
In file included from cache.h:30:0,
                 from runner.h:30,
                 from engine.h:47,
                 from active.h:27,
                 from swift.h:26,
                 from runner_doiact_vec.c:23:
vector.h:145:23: error: called from here
 #define vec_sub(a, b) _mm256_sub_ps(a, b)
                       ^
vector.h:351:13: note: in expansion of macro 'vec_sub'
   x_inv.v = vec_sub(x_inv.v,

Configuration output:

   Compiler        : gcc -std=gnu99
    - vendor       : gnu
    - version      : 4.9.1
    - flags        :  -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -funroll-loops -march=core2 -mavx2 -pthread -Wall -Wextra -Wno-unused-parameter -Werror
   MPI enabled     : yes
   HDF5 enabled    : yes
    - parallel     : no
   Metis enabled   : no
   FFTW3 enabled   : no
   libNUMA enabled : no
   Using tcmalloc  : no
   Using jemalloc  : no
   CPU profiler    : no

I can fix the issue by changing the -march=core2 flag to -march=core-avx2. So if vectorisation is turned on I think -march=core-avx2 should be used instead of -march=core2. I don't know how to change this in ax_gcc_archflag.m4, is it a simple fix?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information