Skip to content

[libc][complex] Testing infra for MPC #121261

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

Merged
merged 67 commits into from
Jan 28, 2025
Merged

Conversation

Sh0g0-1758
Copy link
Member

@Sh0g0-1758 Sh0g0-1758 commented Dec 28, 2024

This PR aims to add the groundwork to test the precision of libc complex functions against MPC. I took cargf as a test to verify that the infra works fine.

@Sh0g0-1758 Sh0g0-1758 requested a review from lntue December 28, 2024 10:35
@Sh0g0-1758 Sh0g0-1758 marked this pull request as ready for review January 8, 2025 12:08
Copy link

github-actions bot commented Jan 12, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@Sh0g0-1758
Copy link
Member Author

@nickdesaulniers @lntue I have added a shared library with functions and classes that are needed both by MPCWrapper and MPFRWrapper. I earlier thought of simply exporting the definitions into MPFRWrapper.h but that would necessitate having mpfr_inc.h in the header file, which ofcourse would be highly undesirable. It was also leading to some nasty bugs during the full build and so decided to go with the shared library approach.

@Sh0g0-1758 Sh0g0-1758 requested a review from lntue January 12, 2025 18:11
@Sh0g0-1758 Sh0g0-1758 self-assigned this Jan 13, 2025
@Sh0g0-1758
Copy link
Member Author

Sh0g0-1758 commented Jan 28, 2025

Okay, merging this now (its morning for me so will stay online for any angry bot)

@Sh0g0-1758 Sh0g0-1758 merged commit 7f37b34 into llvm:main Jan 28, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 28, 2025

LLVM Buildbot has detected a new failure on builder libc-riscv32-qemu-yocto-fullbuild-dbg running on rv32gc-qemu-system while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/4189

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[14/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjf.__internal__.dir/conjf.cpp.o
[15/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjf.dir/conjf.cpp.o
[16/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.crealf128.dir/crealf128.cpp.o
[17/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cproj.dir/cproj.cpp.o
[18/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conjl.dir/conjl.cpp.o
[19/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.conj.dir/conj.cpp.o
[20/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cproj.__internal__.dir/cproj.cpp.o
[21/3882] Building CXX object libc/src/__support/CMakeFiles/libc.src.__support.freelist_heap.dir/freelist_heap.cpp.o
[22/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimag.__internal__.dir/cimag.cpp.o
[23/3882] Building CXX object libc/utils/MPFRWrapper/CMakeFiles/libcMPCommon.dir/MPCommon.cpp.o
FAILED: libc/utils/MPFRWrapper/CMakeFiles/libcMPCommon.dir/MPCommon.cpp.o 
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -std=gnu++17 -O3 --target=riscv32-unknown-linux-gnu -fpie -DLIBC_FULL_BUILD -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wextra-semi -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -MD -MT libc/utils/MPFRWrapper/CMakeFiles/libcMPCommon.dir/MPCommon.cpp.o -MF libc/utils/MPFRWrapper/CMakeFiles/libcMPCommon.dir/MPCommon.cpp.o.d -o libc/utils/MPFRWrapper/CMakeFiles/libcMPCommon.dir/MPCommon.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPCommon.cpp
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPCommon.cpp:9:
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPCommon.h:20:
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/mpfr_inc.h:20:10: fatal error: 'mpfr.h' file not found
   20 | #include <mpfr.h>
      |          ^~~~~~~~
1 error generated.
[24/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimag.dir/cimag.cpp.o
[25/3882] Building CXX object libc/test/UnitTest/CMakeFiles/LibcTest.unit.dir/LibcTestMain.cpp.o
[26/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojl.dir/cprojl.cpp.o
[27/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojf128.dir/cprojf128.cpp.o
[28/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagf.dir/cimagf.cpp.o
[29/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojl.__internal__.dir/cprojl.cpp.o
[30/3882] Building CXX object libc/test/UnitTest/CMakeFiles/LibcMemoryHelpers.unit.dir/MemoryMatcher.cpp.o
[31/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagf.__internal__.dir/cimagf.cpp.o
[32/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagl.dir/cimagl.cpp.o
[33/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagl.__internal__.dir/cimagl.cpp.o
[34/3882] Building CXX object libc/test/UnitTest/CMakeFiles/LibcDeathTestExecutors.unit.dir/LibcDeathTestExecutors.cpp.o
[35/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagf128.__internal__.dir/cimagf128.cpp.o
[36/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cimagf128.dir/cimagf128.cpp.o
[37/3882] Building CXX object libc/src/complex/generic/CMakeFiles/libc.src.complex.generic.cprojf128.__internal__.dir/cprojf128.cpp.o
[38/3882] Building CXX object libc/utils/MPFRWrapper/CMakeFiles/libcMPFRWrapper.dir/MPFRUtils.cpp.o
FAILED: libc/utils/MPFRWrapper/CMakeFiles/libcMPFRWrapper.dir/MPFRUtils.cpp.o 
/usr/local/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libcrv32buildbot/gmp+mpfr/include -I/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc -mabi=ilp32d -march=rv32imafdc --target=riscv32-unknown-linux-gnu --sysroot=/opt/riscv/sysroot --gcc-toolchain=/opt/riscv -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -std=gnu++17 -O3 --target=riscv32-unknown-linux-gnu -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ffixed-point -Wextra-semi -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -MD -MT libc/utils/MPFRWrapper/CMakeFiles/libcMPFRWrapper.dir/MPFRUtils.cpp.o -MF libc/utils/MPFRWrapper/CMakeFiles/libcMPFRWrapper.dir/MPFRUtils.cpp.o.d -o libc/utils/MPFRWrapper/CMakeFiles/libcMPFRWrapper.dir/MPFRUtils.cpp.o -c /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPFRUtils.cpp
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPFRUtils.cpp:10:
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPCommon.h:20:
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/mpfr_inc.h:20:
In file included from /home/libcrv32buildbot/gmp+mpfr/include/mpfr.h:53:
In file included from /home/libcrv32buildbot/gmp+mpfr/include/gmp.h:23:
In file included from /home/libcrv32buildbot/gmp+mpfr/include/gmp-32.h:35:
In file included from /opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/13.2.0/../../../../riscv32-unknown-linux-gnu/include/c++/13.2.0/iosfwd:38:
/opt/riscv/lib/gcc/riscv32-unknown-linux-gnu/13.2.0/../../../../riscv32-unknown-linux-gnu/include/c++/13.2.0/bits/requires_hosted.h:34:4: error: "This header is not available in freestanding mode."
   34 | #  error "This header is not available in freestanding mode."
      |    ^
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPFRUtils.cpp:10:
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/MPCommon.h:20:
In file included from /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/utils/MPFRWrapper/mpfr_inc.h:20:
In file included from /home/libcrv32buildbot/gmp+mpfr/include/mpfr.h:53:

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 28, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building libc at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/12545

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-offload) failure: test (failure)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: mapping/data_member_ref.cpp' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ -fopenmp    -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/mapping/data_member_ref.cpp -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/mapping/Output/data_member_ref.cpp.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a && /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/mapping/Output/data_member_ref.cpp.tmp | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/mapping/data_member_ref.cpp
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang++ -fopenmp -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/mapping/data_member_ref.cpp -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/mapping/Output/data_member_ref.cpp.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/mapping/Output/data_member_ref.cpp.tmp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -11
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/mapping/data_member_ref.cpp
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/mapping/data_member_ref.cpp
# `-----------------------------
# error: command failed with exit status: 2

--

********************


Sh0g0-1758 added a commit that referenced this pull request Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants