<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57345>57345</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Cannot Configure / Build Clang OpenMP on NVIDIA Server
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ajpowelsnl
      </td>
    </tr>
</table>

<pre>
    Hello,

I am attempting to build the most recent version of the Clang compiler with OpenMP using the llvm project.

For more context, I am attempting to address this bug in our own https://github.com/kokkos/kokkos/issues/5315.

Here is my configuration:

```
cmake \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libc;libcxx;libcxxabi;libunwind;openmp" \
-DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_70 \
-DLLVM_CCACHE_BUILD=OFF \
-DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=70 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-G "Unix Makefiles" \
../llvm
```

Here is my environment:

```
Currently Loaded Modules:
  1) sems-cmake/3.23.1   2) sems-git/2.29.0   3) sems-gcc/7.3.0

```

Here is the build error I'm getting:

```
[  6%] Building CXX object libc/src/math/generic/CMakeFiles/libc.src.math.generic.coshf.dir/coshf.cpp.o
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:57:29: error: expected member name or ';' after declaration specifiers
  static constexpr uint16_t OVERFLOW = 0x8;
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/math.h:334:19: note: expanded from macro 'OVERFLOW'
# define OVERFLOW       3
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:58:29: error: expected member name or ';' after declaration specifiers
  static constexpr uint16_t UNDERFLOW = 0x10;
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/usr/include/math.h:335:20: note: expanded from macro 'UNDERFLOW'
# define UNDERFLOW      4
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:79:51: error: expected unqualified-id
         (excepts & FE_OVERFLOW ? ExceptionFlags::OVERFLOW : 0) |
                                                  ^
/usr/include/math.h:334:19: note: expanded from macro 'OVERFLOW'
# define OVERFLOW       3
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:79:51: error: expected ':'
         (excepts & FE_OVERFLOW ? ExceptionFlags::OVERFLOW : 0) |
                                                  ^
                                                  : 
/usr/include/math.h:334:19: note: expanded from macro 'OVERFLOW'
# define OVERFLOW       3
                        ^
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:79:33: note: to match this '?'
         (excepts & FE_OVERFLOW ? ExceptionFlags::OVERFLOW : 0) |
                                ^
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:80:52: error: expected unqualified-id
         (excepts & FE_UNDERFLOW ? ExceptionFlags::UNDERFLOW : 0) |
                                                   ^
/usr/include/math.h:335:20: note: expanded from macro 'UNDERFLOW'
# define UNDERFLOW      4
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:80:52: error: expected ':'
         (excepts & FE_UNDERFLOW ? ExceptionFlags::UNDERFLOW : 0) |
                                                   ^
                                                   : 
/usr/include/math.h:335:20: note: expanded from macro 'UNDERFLOW'
# define UNDERFLOW      4
                        ^
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:80:34: note: to match this '?'
         (excepts & FE_UNDERFLOW ? ExceptionFlags::UNDERFLOW : 0) |
                                 ^
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:90:36: error: expected unqualified-id
         (status & ExceptionFlags::OVERFLOW ? FE_OVERFLOW : 0) |
                                   ^
/usr/include/math.h:334:19: note: expanded from macro 'OVERFLOW'
# define OVERFLOW       3
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:91:36: error: expected unqualified-id
         (status & ExceptionFlags::UNDERFLOW ? FE_UNDERFLOW : 0) |
                                   ^
/usr/include/math.h:335:20: note: expanded from macro 'UNDERFLOW'
# define UNDERFLOW      4
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:270:48: error: expected unqualified-id
  if (status_value & internal::ExceptionFlags::OVERFLOW)
                                               ^
/usr/include/math.h:334:19: note: expanded from macro 'OVERFLOW'
# define OVERFLOW       3
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:271:44: error: expected unqualified-id
    raise_helper(internal::ExceptionFlags::OVERFLOW);
                                           ^
/usr/include/math.h:334:19: note: expanded from macro 'OVERFLOW'
# define OVERFLOW       3
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:272:48: error: expected unqualified-id
  if (status_value & internal::ExceptionFlags::UNDERFLOW)
                                               ^
/usr/include/math.h:335:20: note: expanded from macro 'UNDERFLOW'
# define UNDERFLOW      4
                        ^
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/coshf.cpp:12:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/math/generic/expxf.h:14:
In file included from /ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/FEnvImpl.h:21:
/ascldap/users/ajpowel/clang_llvm_compiler_project/llvm-project/libc/src/__support/FPUtil/x86_64/FEnvImpl.h:273:44: error: expected unqualified-id
    raise_helper(internal::ExceptionFlags::UNDERFLOW);
                                           ^
/usr/include/math.h:335:20: note: expanded from macro 'UNDERFLOW'
# define UNDERFLOW      4
                        ^
12 errors generated.
make[5]: *** [libc/src/math/generic/CMakeFiles/libc.src.math.generic.coshf.dir/coshf.cpp.o] Error 1
make[4]: *** [libc/src/math/generic/CMakeFiles/libc.src.math.generic.coshf.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [runtimes/runtimes-stamps/runtimes-build] Error 2
make[1]: *** [runtimes/CMakeFiles/runtimes.dir/all] Error 2
make: *** [all] Error 2

```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/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