bsc-performance-tools / extrae

Instrumentation framework to generate execution traces of the most used parallel runtimes.
https://tools.bsc.es/extrae
GNU Lesser General Public License v2.1
63 stars 40 forks source link

Extrae doesn't build with GCC versions >= 14 #115

Open valentin-seitz opened 4 months ago

valentin-seitz commented 4 months ago

As GCC 14 promoted some warnings into errors, it is currently not possible to compile Extrae with GCC versions >= 14.

To reproduce this error, configure the latest version of Extrae(v.4.2.0) with:

./configure --without-mpi --without-unwind --without-papi --without-binutils

while using the GCC version:

[valentin@machine]$ gcc --version
gcc (GCC) 14.1.1 20240522

The error I get running make is:

make[4]: Entering directory '/../build/src/merger'
  CC       paraver/libmpi2prv_la-pthread_prv_semantics.lo
../../../src/merger/paraver/pthread_prv_semantics.c: In function 'pthread_Call':
../../../src/merger/paraver/pthread_prv_semantics.c:100:77: error: passing argument 4 of 'Translate_pthread_Operation' from incompatible pointer type [-Wincompatible-pointer-types]
  100 |                 Translate_pthread_Operation (EvType, EvValue?1:0, &nEvType, &nEvValue);
      |                                                                             ^~~~~~~~~
      |                                                                             |
      |                                                                             UINT64 * {aka long unsigned int *}
In file included from ../../../src/merger/paraver/pthread_prv_semantics.c:37:
../../../src/merger/paraver/pthread_prv_events.h:35:29: note: expected 'long long unsigned int *' but argument is of type 'UINT64 *' {aka 'long unsigned int *'}
   35 |         unsigned long long *out_evtvalue);
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
../../../src/merger/paraver/pthread_prv_semantics.c:102:73: error: passing argument 4 of 'Translate_pthread_Operation' from incompatible pointer type [-Wincompatible-pointer-types]
  102 |                 Translate_pthread_Operation (EvType, EvValue, &nEvType, &nEvValue);
      |                                                                         ^~~~~~~~~
      |                                                                         |
      |                                                                         UINT64 * {aka long unsigned int *}
../../../src/merger/paraver/pthread_prv_events.h:35:29: note: expected 'long long unsigned int *' but argument is of type 'UINT64 *' {aka 'long unsigned int *'}
   35 |         unsigned long long *out_evtvalue);
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
make[4]: *** [Makefile:1241: paraver/libmpi2prv_la-pthread_prv_semantics.lo] Error 1

Looking at the GCC release notes the incompatible-pointer-types warning are now promoted to a error, stopping the compilation: https://gcc.gnu.org/gcc-14/porting_to.html#incompatible-pointer-types

This is espescially problematic, since a lot of distributions tend to ship the newest compilers like e.g. archlinux or Ubuntu. So Extrae will not be buildable in those distributions without downloading an older compiler

emercadal commented 2 months ago

Thanks for reporting this. It is indeed an issue that we need to look at. In the meantime, could you use the -Wno-error=incompatible-pointer-types CFLAG?

valentin-seitz commented 2 months ago

Doing CFLAGS="-Wno-error=incompatible-pointer-types" ./configure --without-mpi --without-unwind --without-papi --without-binutils will lead to:

common/mpi2out.c: In function 'merger_post':
common/mpi2out.c:1444:25: error: implicit declaration of function 'Address2Info_Initialize'; did you mean 'AddressCollector_Initialize'? [-Wimplicit-function-declaration]
 1444 |                         Address2Info_Initialize (get_merge_ExecutableFileName());
      |                         ^~~~~~~~~~~~~~~~~~~~~~~
      |                         AddressCollector_Initialize

after a make

Using CFLAGS="-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration" ./configure --without-mpi --without-unwind --without-papi --without-binutils works for me and extrae builds :)

giordano commented 1 week ago

For what is worth, I had to use "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration -Wno-error=int-conversion" to build extrae 4.1.2 with gcc 14.2 (and I added those flags to the Spack recipe: https://github.com/spack/spack/pull/47407)