_Static_assert comes from C11.

src/include/mpir_assert.h does a direct test for C11 support based upon the GCC version, which is unsafe since ICC (and other non-GCC compilers) define these macros.

/* GCC 4.6 added support for _Static_assert:
 * http://gcc.gnu.org/gcc-4.6/changes.html */
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && !defined __cplusplus
#define HAVE_C11__STATIC_ASSERT 1
#endif

MPICH needs to test for _Static_assert properly using configure.  You should file a GitHub issue to track this.

Jeff

On Wed, Jun 13, 2018 at 2:33 PM, Gus Correa <gus@ldeo.columbia.edu> wrote:
Hi MPICH experts

I am trying to build MPICH 3.2.1 with Intel
compilers (icc, ifort).
C++ is disabled.

The configuration step goes well,
but make fails,
after a lot of stuff is compiled,
with the error below (undefined reference to `_Static_assert').

FYI, the OS is Linux Fedora Core 26:

Linux 4.15.17-200.fc26.x86_64 #1 SMP Thu Apr 12 18:28:26 UTC 2018 x86_64 x86_64 GNU/Linux

The Intel compiler version is 12.1.6:
ifort (IFORT) 12.1.6 20120928
icc (ICC) 12.1.6 20120928

The Intel compiler environment is set the standard way
recommended by Intel:

source /path/to/intel/bin/compilervars.sh intel64


Any help is appreciated.
Gus Correa

****** make errror message *************************************
make[2]: Entering directory '/home/sw/mpich/inst/3.2.1/mpich-3.2.1/build_intel-2011.13.367'
  CCLD     src/env/mpivars
lib/.libs/libmpi.a(lib_libmpi_la-ch3_progress.o): In function `MPIDI_CH3I_Shm_send_progress':
../src/mpid/ch3/channels/nemesis/src/ch3_progress.c:(.text+0x1ea2): undefined reference to `_Static_assert'
lib/.libs/libmpi.a(lib_libmpi_la-ch3i_eagernoncontig.o): In function `MPIDI_CH3I_SendNoncontig':
../src/mpid/ch3/channels/nemesis/src/ch3i_eagernoncontig.c:(.text+0x1d3): undefined reference to `_Static_assert'
make[2]: *** [Makefile:19701: src/env/mpivars] Error 1
make[2]: Leaving directory '/home/sw/mpich/inst/3.2.1/mpich-3.2.1/build_intel-2011.13.367'
make[1]: *** [Makefile:38608: all-recursive] Error 1
make[1]: Leaving directory '/home/sw/mpich/inst/3.2.1/mpich-3.2.1/build_intel-2011.13.367'
make: *** [Makefile:10337: all] Error 2
*******************************************************************

_______________________________________________
discuss mailing list     discuss@mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss



--