Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ucx 1.18.0 not building with NVHPC 24.9 with undefined reference #10509

Open
louspe-linaro opened this issue Feb 24, 2025 · 2 comments
Open

ucx 1.18.0 not building with NVHPC 24.9 with undefined reference #10509

louspe-linaro opened this issue Feb 24, 2025 · 2 comments
Assignees
Labels

Comments

@louspe-linaro
Copy link

Describe the bug

Undefined reference when building with NVHPC 24.9

   CC       ucx_info-build_info.o
   CC       ucx_info-proto_info.o
   CC       ucx_info-sys_info.o
   CC       ucx_info-tl_info.o
   CC       ucx_info-type_info.o
   CC       ucx_info-version_info.o
   CC       ucx_info-ucx_info.o
   CCLD     ucx_info
/usr/bin/ld: build/ucx/src/ucs/.libs/libucs.so: undefined reference to `__builtin_ia32_lzcnt_u32'
make[3]: *** [Makefile:591: ucx_info] Error 2

_lzcnt_u32(len) is used in src/ucs/arch/x86_64/cpu.c under flag __LZCNT__ but that is not defined for the NVIDIA compiler.
https://docs.nvidia.com/hpc-sdk/compilers/hpc-compilers-ref-guide/index.html#x86-64-abm-intrinsics

Steps to Reproduce

configure --disable-dependency-tracking --prefix=$HOME/ucx-install --bindir=${prefix}/bin --sbindir=${prefix}/bin --libexecdir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include --datarootdir=${prefix}/share

Trying to build v1.18.0

Setup and versions

Observed only on x86_64 with Ubuntu 24.04, SLES 15, RHEL-8, RHEL-9

@tvegas1
Copy link
Contributor

tvegas1 commented Feb 24, 2025

Still checking but seems it could be compiler related since defines itself the use:

 80 static __inline__ unsigned int __DEFAULT_FN_ATTRS
 81 _lzcnt_u32(unsigned int __X)
 82 {
 83   return __builtin_ia32_lzcnt_u32(__X);
 84 }

Repro:

$ cat abc.c
#include <stdio.h>
#include <x86intrin.h>
int main(void)
{
    unsigned int a = 32;
    printf("%u\n", _lzcnt_u32(a));
    return 0;
}
$ nvc abc.c
/tmp/nvcH7nneJO8FPcwQ.o: In function `_lzcnt_u32':
/opt/nvidia/hpc_sdk/Linux_x86_64/24.9/compilers/include/lzcntintrin.h:83: undefined reference to `__builtin_ia32_lzcnt_u32'

@tvegas1
Copy link
Contributor

tvegas1 commented Feb 25, 2025

Also related #10519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants