ucx icon indicating copy to clipboard operation
ucx copied to clipboard

UCX fails to compile with GCC-15

Open NHOrus opened this issue 9 months ago • 4 comments

Describe the bug

GCC-15 defaults to C23. It made illegal some constructs that are used in ucx are made illegal, for example K&R-style empty function parameters are now interpreted as void and meant that there are no parameters, passing such functions to call sites result in incompatible pointer types compilation error.

Steps to Reproduce

make -j8 --shuffle

  • using ucx-1.13.1, but problem code still present in 1.18.0
configure: =========================================================
configure: UCX build configuration:
configure:         Build prefix:   /usr
configure:    Configuration dir:   /etc/ucx
configure:   Preprocessor flags:   -DCPU_FLAGS="" -I${abs_top_srcdir}/src -I${abs_top_builddir} -I${abs_top_builddir}/src
configure:           C compiler:   x86_64-pc-linux-gnu-gcc -g -Wall -funwind-tables -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch -Wno-pointer-sign -Werror-implicit-function-declaration -Wno-format-zero-length -Wnested-externs -Wshadow -Werror=declaration-after-statement
configure:         C++ compiler:   x86_64-pc-linux-gnu-g++ -g -Wall -funwind-tables -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch
configure:         Multi-thread:   disabled
configure:         NUMA support:   enabled
configure:            MPI tests:   disabled
configure:          VFS support:   no
configure:        Devel headers:   no
configure: io_demo CUDA support:   no
configure:             Bindings:   < >
configure:          UCS modules:   < >
configure:          UCT modules:   < cma >
configure:         CUDA modules:   < >
configure:         ROCM modules:   < >
configure:           IB modules:   < >
configure:          UCM modules:   < >
configure:         Perf modules:   < >
configure: =========================================================

Setup and versions

  • Gentoo x86_64
    • Linux nho-laptop 6.14.0-gentoo # 1 SMP PREEMPT Tue Mar 25 12:58:44 MSK 2025 x86_64 AMD Ryzen 7 5700U with Radeon Graphics AuthenticAMD GNU/Linux

Additional information (depending on the issue)

See Gentoo bug https://bugs.gentoo.org/944992

NHOrus avatar Mar 28 '25 16:03 NHOrus

@NHOrus can you pls check if the failure still exists on UCX main branch? Also, any change there is a public docker image with the gentoo system used in the build?

yosefe avatar Mar 29 '25 15:03 yosefe

Will try. Sadly, I do not know of any such image. Fastest way to reproduce such would be to get stage3 tarball, make a container out of it, enable binary host for downloading of binary packages, install binary package of gcc-15 with ACCEPT_KEYWORDS="**" emerge -av1G sys-devel/gcc:15 and set it as default compiler. Or get https://hub.docker.com/r/gentoo/stage3 and then install binary package of gcc-15. Then emerge ucx.

NHOrus avatar Mar 29 '25 15:03 NHOrus

Question: Should we as distro use ./configure or ./contrib/configure-release ? Instead of autogen we are using our own set of invocations for autotools, tailored for distro.

NHOrus avatar Mar 29 '25 15:03 NHOrus

Commit d58d2ae24b9e8498775a2ad0806f1421828fa935 fails to build with:

arch/x86_64/cpu.c:502:5: error: conflicting types for 'ucs_arch_get_cpu_flag' due to enum/integer mismatch; have 'int(void)' [-Werror=enum-int-mismatch]
  502 | int ucs_arch_get_cpu_flag()
      |     ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/nho/workshop/ucx/src/ucs/arch/cpu.h:105,
                 from arch/x86_64/cpu.c:15:
/home/nho/workshop/ucx/src/ucs/arch/x86_64/cpu.h:51:16: note: previous declaration of 'ucs_arch_get_cpu_flag' with type 'ucs_cpu_flag_t(void)' {aka 'enum ucs_cpu_flag(void)'}
   51 | ucs_cpu_flag_t ucs_arch_get_cpu_flag() UCS_F_NOOPTIMIZE;
      |                ^~~~~~~~~~~~~~~~~~~~~

NHOrus avatar Mar 29 '25 15:03 NHOrus