simd-everywhere/simde

problem building tests with clang

Closed this issue · 4 comments

meson setup builddir
The Meson build system
Version: 1.5.1
Source dir: /home/armnmfv/GITHUB/simde
Build dir: /home/armnmfv/GITHUB/simde/builddir
Build type: native build
Project name: SIMDe
Project version: 0.8.2
C compiler for the host machine: clang (clang 19.1.0-rc2 "clang version 19.1.0-rc2 (https://github.com/llvm/llvm-project.git d033ae172d1c5a85fd09c36e23608a9241ea2990)")
C linker for the host machine: clang ld.bfd 2.34
C++ compiler for the host machine: clang++ (clang 19.1.0-rc2 "clang version 19.1.0-rc2 (https://github.com/llvm/llvm-project.git d033ae172d1c5a85fd09c36e23608a9241ea2990)")
C++ linker for the host machine: clang++ ld.bfd 2.34
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Compiler for C supports arguments -fopenmp-simd: YES
Compiler for C++ supports arguments -fopenmp-simd: YES
Compiler for C supports arguments -Wpsabi: YES
Compiler for C++ supports arguments -Wpsabi: YES
Library m found: YES
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.1
Build targets in project: 2002

Found ninja-1.10.0 at /usr/bin/ninja

cd builddir/
[ ~/GITHUB/simde/builddir : (b_v0.8.2 %)]

meson compile -j1
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -j 1
[103/4004] Linking target test/x86/avx512/cast-emul-c
FAILED: test/x86/avx512/cast-emul-c
clang -o test/x86/avx512/cast-emul-c test/x86/avx512/cast-emul-c.p/cast.c.o -Wl,--as-needed -Wl,--no-undefined -lm
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
test/x86/avx512/cast-emul-c.p/cast.c.o: in function simde_test_f16_precision_to_slop': cast.c:(.text+0x258b8): undefined reference to __truncsfhf2'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

what am i doing wrong
it works well with gcc 13 and 14

mr-c commented

Hello @mfvalin , do older versions of clang work for you?

We've never tested with clang-19

zen3 CPU, Ubuntu 20.24.6 LTS
(simde 0.8.2)

intel compilers 2023 (traditional) fail when compiling
icc (ICC) 2021.10.0 20230609
Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230721)
../simde/x86/avx512/cvt.h(69) (col. 7): internal error: assertion failed at: "edg_expr.c", line 7466 in dump_expr_il0

intel compilers 2024 (llvm based) fail when compiling
build_dir/../test/x86/avx512/../../../simde/simde-f16.h:181: undefined reference to `__truncsfhf2'

nvidia 24.1 fails at setup
meson.build:1:0: ERROR: None of values ['c99'] are supported by the C compiler. Possible values for option "C_std" are ['none']

clang version 16 (AMD aocc) fails when compiling
C compiler for the host machine: clang (clang 16.0.3 "AMD clang version 16.0.3 (CLANG: AOCC_4.2.0-Build#89 2023_12_13)")
C linker for the host machine: clang ld.lld 16.0.3
C++ compiler for the host machine: clang++ (clang 16.0.3 "AMD clang version 16.0.3 (CLANG: AOCC_4.2.0-Build#89 2023_12_13)")
C++ linker for the host machine: clang++ ld.lld 16.0.3
ld.lld: error: undefined symbol: __truncsfhf2

gcc 11 compiles O.K. (all tests successful)

gcc 13/14 compiles O.K. (half the tests fail 1001/2002)

if i switch to a zen4 Ubuntu 22.04 platform,
the distro gcc11 works, all tests pass
clang from llvm 19 works, all tests pass
gcc14 works, all tests pass
clang 16 from AMD aocc works, all tests pass
intel icx/icpx 2024 works, all tests pass

it looks like my problems are associated in some way with my Ubuntu 20.04 setup

mr-c commented

it looks like my problems are associated in some way with my Ubuntu 20.04 setup

Okay. I'm going to close this issue for now. Good luck!