[llvm-bugs] [Bug 51579] New: openmp runtime build failure via LLVM_ENABLE_RUNTIMES=openmp

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Aug 22 19:33:15 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51579

            Bug ID: 51579
           Summary: openmp runtime build failure via
                    LLVM_ENABLE_RUNTIMES=openmp
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: uday at polymagelabs.com
                CC: llvm-bugs at lists.llvm.org

This is with the trunk 9cfab5e2491ec1fbf8a3055453b3da08ecacc6a6 (Aug 22). 

With the following cmake conf, the build can't find `pthread.h` although
/usr/include/pthread.h exists. Error log pasted below. I am wondering whether
this approach of building is supported.

$ cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="mlir"
-DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_LLD=ON  -DLLVM_CCACHE_BUILD=ON
-DLLVM_ENABLE_RUNTIMES=openmp

$ ninja runtimes

-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146
(message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393
(_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindThreads.cmake:220
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  /home/uday/llvm-project-upstream/openmp/runtime/cmake/config-ix.cmake:155
(find_package)
  /home/uday/llvm-project-upstream/openmp/runtime/CMakeLists.txt:240 (include)


-- Configuring incomplete, errors occurred!
See also
"/home/uday/llvm-project-upstream/build/runtimes/runtimes-bins/CMakeFiles/CMakeOutput.log".
See also
"/home/uday/llvm-project-upstream/build/runtimes/runtimes-bins/CMakeFiles/CMakeError.log".

Determining if the include file pthread.h exists failed with the following
output:
Change Dir:
/home/uday/llvm-project-upstream/build/runtimes/runtimes-bins/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_f7224 && [1/2] Building C object
CMakeFiles/cmTC_f7224.dir/CheckIncludeFile.c.o
FAILED: CMakeFiles/cmTC_f7224.dir/CheckIncludeFile.c.o 
/usr/bin/cc   -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wno-comment
-fdiagnostics-color  -nostdinc++ -nostdlib++ -o
CMakeFiles/cmTC_f7224.dir/CheckIncludeFile.c.o   -c CheckIncludeFile.c
cc: error: unrecognized command line option ‘-nostdlib++’; did you mean
‘-nostdlib’?
ninja: build stopped: subcommand failed.


However, changing the cmake conf to include "clang" in the list of projects
makes the build succeed. I found this surprising. 

I understand this isn't the recommended way to build the openmp runtime per
https://openmp.llvm.org/ but I was wondering what the purpose of
`LLVM_ENABLE_RUNTIMES` was when LLVM_ENABLE_PROJECTS accepted openmp in its
list. The doc on this CMake variable says:

----------
//Semicolon-separated list of runtimes to build
(compiler-rt;libc;libcxx;libcxxabi;libunwind;openmp),
// or "all".
LLVM_ENABLE_RUNTIMES:STRING=
------------------------

cmake version 3.16.3

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210823/8049f1fe/attachment.html>


More information about the llvm-bugs mailing list