Skip to content

[offload] [cmake] Standalone build test logic is broken #90333

Open
@mgorny

Description

@mgorny

I'm trying to figure out how to build it post-openmp/offload split, and the test logic just doesn't seem to make any sense to me.

So far I've noticed that:

  • offload reuses the OpenMPTesting logic that tries to use OPENMP_TEST_{C,CXX}_COMPILER
  • however, the cmake/DetectTestCompiler directories has not been copied from openmp, so the whole logic fails
  • test directory instead uses CMAKE_{C,CXX}_COMPILER

Even if I copy the directory, ensure that C/C++ compiler is clang and make the whole CMake pass, the test target seems to be broken:

$ ninja check-libomptarget
ninja: error: 'test/omp', needed by 'test/CMakeFiles/check-libomptarget', missing and no known rule to make it

And if I remove the wrong dependency from test/CMakeLists.txt, the tests fail because of:

# .---command stderr------------
# | x86_64-pc-linux-gnu-clang: error: '-fopenmp-targets' must be used in conjunction with a '-fopenmp' option compatible with offloading; e.g., '-fopenmp=libomp' or '-fopenmp=libiomp5'
# `-----------------------------
# error: command failed with exit status: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularoffload

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions