[mpich-discuss] MPICH 3.2.1 build error with icc+ifort: undefined reference to `_Static_assert'

Gus Correa gus at ldeo.columbia.edu
Wed Jun 13 20:51:23 CDT 2018


Thank you, Jeff!

Your suggestion made the whole difference.

I tried
#define HAVE_C11__STATIC_ASSERT 0
but the error persisted.
The remainder of the preprocessor directives
seem to check
if the macro HAVE_C11__STATIC_ASSERT is defined,
not if it is non-zero.
Hence, I had to
#undef HAVE_C11__STATIC_ASSERT
after it is defined.

With that the code compiled with my
outdated 2012 ifort and icc.

Many thanks to you and Min for the help.
Gus Correa

On 06/13/2018 07:37 PM, Jeff Hammond wrote:
> You can also just #define HAVE_C11__STATIC_ASSERT 0 in the 
> aforementioned header file to override the bad preprocessor test.
> 
> On Wed, Jun 13, 2018 at 4:36 PM, Jeff Hammond <jeff.science at gmail.com 
> <mailto:jeff.science at gmail.com>> wrote:
> 
>     Why don't you just use a newer ICC?  September 28, 2012 was a long
>     time ago...
> 
>     Jeff
> 
>     On Wed, Jun 13, 2018 at 4:32 PM, Gus Correa <gus at ldeo.columbia.edu
>     <mailto:gus at ldeo.columbia.edu>> wrote:
> 
>         Thank you Jeff and Min!
> 
>         Would you know if MPICH 3.2 has the same issue?
>         I would rather use an older version instead, as long as it builds.
> 
>         Many thanks,
>         Gus Correa
> 
>         On 06/13/2018 06:34 PM, Min Si wrote:
> 
>             I was just creating the issue on MPICH github when Jeff replied.
> 
>             Please use this issue to keep track:
>             https://github.com/pmodels/mpich/issues/3178
>             <https://github.com/pmodels/mpich/issues/3178>
> 
>             Min
>             On 2018/06/13 15:19, Jeff Hammond wrote:
> 
>                 _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
>                 <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 at ldeo.columbia.edu <mailto:gus at ldeo.columbia.edu>
>                 <mailto:gus at ldeo.columbia.edu
>                 <mailto:gus at 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 at mpich.org
>                 <mailto:discuss at mpich.org> <mailto:discuss at mpich.org
>                 <mailto:discuss at mpich.org>>
>                      To manage subscription options or unsubscribe:
>                 https://lists.mpich.org/mailman/listinfo/discuss
>                 <https://lists.mpich.org/mailman/listinfo/discuss>
>                      <https://lists.mpich.org/mailman/listinfo/discuss
>                 <https://lists.mpich.org/mailman/listinfo/discuss>>
> 
> 
> 
> 
>                 -- 
>                 Jeff Hammond
>                 jeff.science at gmail.com <mailto:jeff.science at gmail.com>
>                 <mailto:jeff.science at gmail.com
>                 <mailto:jeff.science at gmail.com>>
>                 http://jeffhammond.github.io/
> 
> 
>                 _______________________________________________
>                 discuss mailing listdiscuss at mpich.org
>                 <mailto:listdiscuss at mpich.org>
>                 To manage subscription options or unsubscribe:
>                 https://lists.mpich.org/mailman/listinfo/discuss
>                 <https://lists.mpich.org/mailman/listinfo/discuss>
> 
> 
> 
> 
>             _______________________________________________
>             discuss mailing list discuss at mpich.org
>             <mailto:discuss at mpich.org>
>             To manage subscription options or unsubscribe:
>             https://lists.mpich.org/mailman/listinfo/discuss
>             <https://lists.mpich.org/mailman/listinfo/discuss>
> 
> 
>         _______________________________________________
>         discuss mailing list discuss at mpich.org <mailto:discuss at mpich.org>
>         To manage subscription options or unsubscribe:
>         https://lists.mpich.org/mailman/listinfo/discuss
>         <https://lists.mpich.org/mailman/listinfo/discuss>
> 
> 
> 
> 
>     -- 
>     Jeff Hammond
>     jeff.science at gmail.com <mailto:jeff.science at gmail.com>
>     http://jeffhammond.github.io/
> 
> 
> 
> 
> -- 
> Jeff Hammond
> jeff.science at gmail.com <mailto:jeff.science at gmail.com>
> http://jeffhammond.github.io/
> 
> 
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
> 

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


More information about the discuss mailing list