[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


            Bug ID: 51579
           Summary: openmp runtime build failure via
           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"

$ ninja runtimes

-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /home/uday/llvm-project-upstream/openmp/runtime/CMakeLists.txt:240 (include)

-- Configuring incomplete, errors occurred!
See also
See also

Determining if the include file pthread.h exists failed with the following
Change Dir:

Run Build Command(s):/usr/bin/ninja cmTC_f7224 && [1/2] Building C object
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
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
// or "all".

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