[Openmp-commits] [openmp] Add openmp support to System z (PR #66081)

Ulrich Weigand via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 27 02:36:54 PST 2024


================
@@ -0,0 +1,17 @@
+##===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+##===----------------------------------------------------------------------===##
+#
+# Build a plugin for a s390x machine if available.
+#
+##===----------------------------------------------------------------------===##
+
+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ build_generic_elf64("SystemZ" "S390X" "s390x" "s390x-ibm-linux-gnu" "22")
----------------
uweigand wrote:

No, it's a different message (note the "S390X" instead of "s390x" in the message text).  This message seems to originate from the *implementation* of `build_generic_elf64`:
```
macro(build_generic_elf64 tmachine tmachine_name tmachine_libname tmachine_triple elf_machine_id)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tmachine}$")
[...]
else()
  libomptarget_say("Not building ${tmachine_name} NextGen offloading plugin: machine not found in the system.")
endif()
```
This is testing `CMAKE_SYSTEM_PROCESSOR` against `SystemZ`, but the macro is set to `s390x` as Tom said.

If I change the `build_generic_elf64` invocation to use `s390x`, an attempt to build the plugin is made, but it fails:
```
-- LIBOMPTARGET: Building s390x plugin linked with libffi
[...]
/home/uweigand/llvm/llvm-head/openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp:409:20: error: no member named 's390x' in 'llvm::Triple'
  409 |     return Triple::LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE;
      |            ~~~~~~~~^
<command line>:2:52: note: expanded from macro 'LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE'
    2 | #define LIBOMPTARGET_NEXTGEN_GENERIC_PLUGIN_TRIPLE s390x
      |                                                    ^
```
So there appears to be some mismatch here.



https://github.com/llvm/llvm-project/pull/66081


More information about the Openmp-commits mailing list