Skip to content

llvm build failure for openmp #59537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeffcbecker opened this issue Dec 15, 2022 · 31 comments
Closed

llvm build failure for openmp #59537

jeffcbecker opened this issue Dec 15, 2022 · 31 comments
Labels
build-problem openmp platform:linux question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@jeffcbecker
Copy link

jeffcbecker commented Dec 15, 2022

On x86/Linux, did the following

$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_RUNTIMES=openmp ../llvm
$ make
...

Build gets to 98% complete, and has the following error

Consolidate compiler generated dependencies of target omptarget
[  4%] Building CXX object openmp/libomptarget/src/CMakeFiles/omptarget.dir/api.cpp.o
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
In file included from /nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:18:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/Support/type_traits.h:31:28: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
  using UnderlyingT = std::remove_reference_t<T>;
                      ~~~~~^~~~~~~~~~~~~~~~~~
                           remove_reference
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1374:12: note: 'remove_reference' declared here
    struct remove_reference
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
In file included from /nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:18:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/Support/type_traits.h:48:13: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
    T, std::enable_if_t<std::is_pointer<T>::value>> {
       ~~~~~^~~~~~~~~~~
            enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
In file included from /nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:18:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/Support/type_traits.h:58:39: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
struct add_const_past_pointer<T, std::enable_if_t<std::is_pointer<T>::value>> {
                                 ~~~~~^~~~~~~~~~~
                                      enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
In file included from /nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:18:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/Support/type_traits.h:59:27: error: no template named 'remove_pointer_t' in namespace 'std'; did you mean 'remove_pointer'?
  using type = const std::remove_pointer_t<T> *;
                     ~~~~~^~~~~~~~~~~~~~~~
                          remove_pointer
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1661:12: note: 'remove_pointer' declared here
    struct remove_pointer
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
In file included from /nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:18:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/Support/type_traits.h:68:40: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
                                  std::enable_if_t<std::is_pointer<T>::value>> {
                                  ~~~~~^~~~~~~~~~~
                                       enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:40:49: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
using EnableIfConvertibleToInputIterator = std::enable_if_t<std::is_convertible<
                                           ~~~~~^~~~~~~~~~~
                                                enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:109:10: error: no template named 'conditional_t' in namespace 'std'; did you mean 'conditional'?
    std::conditional_t<sizeof(T) < 4 && sizeof(void *) >= 8, uint64_t,
    ~~~~~^~~~~~~~~~~~~
         conditional
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1780:12: note: 'conditional' declared here
    struct conditional
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:212:12: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
      std::enable_if_t<!std::is_same<std::remove_const_t<ItTy>, T *>::value,
      ~~~~~^~~~~~~~~~~
           enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:212:43: error: no template named 'remove_const_t' in namespace 'std'; did you mean 'remove_const'?
      std::enable_if_t<!std::is_same<std::remove_const_t<ItTy>, T *>::value,
                                     ~~~~~^~~~~~~~~~~~~~
                                          remove_const
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1327:12: note: 'remove_const' declared here
    struct remove_const
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:225:12: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
      std::enable_if_t<!std::is_same<std::remove_const_t<ItTy>, T *>::value,
      ~~~~~^~~~~~~~~~~
           enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:225:43: error: no template named 'remove_const_t' in namespace 'std'; did you mean 'remove_const'?
      std::enable_if_t<!std::is_same<std::remove_const_t<ItTy>, T *>::value,
                                     ~~~~~^~~~~~~~~~~~~~
                                          remove_const
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1327:12: note: 'remove_const' declared here
    struct remove_const
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:157:10: error: too few template arguments for class template 'less'
    std::less<> LessThan;
         ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_function.h:231:12: note: template is declared here
    struct less : public binary_function<_Tp, _Tp, bool>
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:170:10: error: too few template arguments for class template 'less'
    std::less<> LessThan;
         ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_function.h:231:12: note: template is declared here
    struct less : public binary_function<_Tp, _Tp, bool>
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:352:5: error: no member named 'uninitialized_move' in namespace 'std'; did you mean simply 'uninitialized_move'?
    std::uninitialized_move(I, E, Dest);
    ^~~~~~~~~~~~~~~~~~~~~~~
    uninitialized_move
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:351:15: note: 'uninitialized_move' declared here
  static void uninitialized_move(It1 I, It1 E, It2 Dest) {
              ^
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:489:28: error: no template named 'conditional_t' in namespace 'std'; did you mean 'conditional'?
  using ValueParamT = std::conditional_t<TakesParamByValue, T, const T &>;
                      ~~~~~^~~~~~~~~~~~~
                           conditional
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1780:12: note: 'conditional' declared here
    struct conditional
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:517:12: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
      std::enable_if_t<std::is_same<std::remove_const_t<T1>, T2>::value> * =
      ~~~~~^~~~~~~~~~~
           enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
    struct enable_if 
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:517:42: error: no template named 'remove_const_t' in namespace 'std'; did you mean 'remove_const'?
      std::enable_if_t<std::is_same<std::remove_const_t<T1>, T2>::value> * =
                                    ~~~~~^~~~~~~~~~~~~~
                                         remove_const
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1327:12: note: 'remove_const' declared here
    struct remove_const
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:775:27: error: no template named 'remove_const_t' in namespace 'std'; did you mean 'remove_const'?
        std::is_same<std::remove_const_t<std::remove_reference_t<ArgType>>,
                     ~~~~~^~~~~~~~~~~~~~
                          remove_const
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1327:12: note: 'remove_const' declared here
    struct remove_const
           ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:27:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:25:
/nobackupnfs1/jcbecker/llvm-project/llvm/include/llvm/ADT/SmallVector.h:775:47: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
        std::is_same<std::remove_const_t<std::remove_reference_t<ArgType>>,
                                         ~~~~~^~~~~~~~~~~~~~~~~~
                                              remove_reference
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1374:12: note: 'remove_reference' declared here
    struct remove_reference
           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[5]: *** [openmp/libomptarget/src/CMakeFiles/omptarget.dir/api.cpp.o] Error 1
make[4]: *** [openmp/libomptarget/src/CMakeFiles/omptarget.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
@llvmbot
Copy link
Member

llvmbot commented Dec 15, 2022

@llvm/issue-subscribers-openmp

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 15, 2022

What version is your compiler? The include/c++/4.8.5 seems a little suspect, it might be picking up the wrong compiler when we do the second build for the "runtimes" option. Sometimes the LLVM build will pick up the system's default GCC instead of the one that's expected. I've used -DGCC_INSTALL_PREFIX= in the past to get around that, it's worth a shot.

@jeffcbecker
Copy link
Author

jeffcbecker commented Dec 15, 2022

I tried again with GCC 10.3 and got:

[  4%] Building CXX object openmp/libomptarget/src/CMakeFiles/omptarget.dir/api.cpp.o
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:19:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/list:60:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_algobase.h:61:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:542:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:543:21: error: expected ';' at end of declaration
    inline _Iterator
                    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:544:18: error: unknown type name '_Iterator'
    __miter_base(_Iterator __it)
                 ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:544:5: error: a type specifier is required for all declarations
    __miter_base(_Iterator __it)
    ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:19:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/list:60:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_algobase.h:64:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_pair.h:59:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/move.h:57:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:8: error: expected ';' after struct
    { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
       ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:9: error: a type specifier is required for all declarations
    { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
        ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected unqualified-id
    _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
                          ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected ')'
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:26: note: to match this '('
    _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
                         ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2648:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2650:5: error: no variable template matches partial specialization
    _Require<__not_<__is_tuple_like<_Tp>>,
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2652:31: error: expected ';' at end of declaration
             is_move_assignable<_Tp>>
                                     ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:10: error: unknown type name '_Tp'
    swap(_Tp&, _Tp&)
         ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:16: error: unknown type name '_Tp'
    swap(_Tp&, _Tp&)
               ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2654:51: error: use of undeclared identifier '_Tp'
    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
                                                  ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:45: error: expected '(' for function-style cast or type construction
                    is_nothrow_move_assignable<_Tp>>::value);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:48: error: no member named 'value' in the global namespace
                    is_nothrow_move_assignable<_Tp>>::value);
                                                    ~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:5: error: a type specifier is required for all declarations
    swap(_Tp&, _Tp&)
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2658:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2660:5: error: no variable template matches partial specialization
    __enable_if_t<__is_swappable<_Tp>::value>
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[5]: *** [openmp/libomptarget/src/CMakeFiles/omptarget.dir/api.cpp.o] Error 1
make[4]: *** [openmp/libomptarget/src/CMakeFiles/omptarget.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

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 15, 2022

Was this a clean build, that is with previous installations and the build directory deleted? Sometimes CMake will cache problematic variables, or files from the old installation will be used when we want them to be rebuilt.

@jeffcbecker
Copy link
Author

no - I'll start clean, tx

@jeffcbecker
Copy link
Author

jeffcbecker commented Dec 15, 2022

Did a clean cmake followed by make -j8. Errors follow. If you'd prefer, I can do a single threaded make. Tx

[  0%] Building CXX object openmp/libomptarget/src/CMakeFiles/omptarget.dir/api.cpp.o
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp:12:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/plugins/common/elf_common/elf_common.h:16:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptargetplugin.h:17:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:17:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/deque:60:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_algobase.h:61:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:542:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:543:21: error: expected ';' at end of declaration
    inline _Iterator
                    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:544:18: error: unknown type name '_Iterator'
    __miter_base(_Iterator __it)
                 ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:544:5: error: a type specifier is required for all declarations
    __miter_base(_Iterator __it)
    ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:19:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/list:60:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_algobase.h:61:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:542:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:543:21: error: expected ';' at end of declaration
    inline _Iterator
                    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:544:18: error: unknown type name '_Iterator'
    __miter_base(_Iterator __it)
                 ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/cpp_type_traits.h:544:5: error: a type specifier is required for all declarations
    __miter_base(_Iterator __it)
    ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp:12:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/plugins/common/elf_common/elf_common.h:16:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptargetplugin.h:17:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/omptarget.h:17:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/deque:60:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_algobase.h:64:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_pair.h:59:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/move.h:57:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:8: error: expected ';' after struct
    { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
       ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:9: error: a type specifier is required for all declarations
    { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
        ^
[  0%] Building LLVM bitcode Workshare.cpp-gfx1103.bc
[  0%] Building LLVM bitcode Workshare.cpp-gfx1101.bc
[  0%] Building LLVM bitcode Workshare.cpp-gfx1030.bc
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected unqualified-id
    _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
                          ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected ')'
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:26: note: to match this '('
    _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
                         ^
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/src/api.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/libomptarget/include/device.h:19:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/list:60:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_algobase.h:64:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/stl_pair.h:59:
In file included from /nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/bits/move.h:57:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:8: error: expected ';' after struct
    { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
       ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:9: error: a type specifier is required for all declarations
    { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
        ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected unqualified-id
    _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
                          ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected ')'
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:26: note: to match this '('
    _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
                         ^
[  0%] Building the OMPD GDB plugin
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2648:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2650:5: error: no variable template matches partial specialization
    _Require<__not_<__is_tuple_like<_Tp>>,
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2652:31: error: expected ';' at end of declaration
             is_move_assignable<_Tp>>
                                     ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:10: error: unknown type name '_Tp'
    swap(_Tp&, _Tp&)
         ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:16: error: unknown type name '_Tp'
    swap(_Tp&, _Tp&)
               ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2654:[  0%] Built target ompd_gdb_plugin
51: error: use of undeclared identifier '_Tp'
    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
                                                  ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:45: error: expected '(' for function-style cast or type construction
                    is_nothrow_move_assignable<_Tp>>::value);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:48: error: no member named 'value' in the global namespace
                    is_nothrow_move_assignable<_Tp>>::value);
                                                    ~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:5: error: a type specifier is required for all declarations
    swap(_Tp&, _Tp&)
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2658:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2660:5: error: no variable template matches partial specialization
    __enable_if_t<__is_swappable<_Tp>::value>
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2648:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2650:5: error: no variable template matches partial specialization
    _Require<__not_<__is_tuple_like<_Tp>>,
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2652:31: error: expected ';' at end of declaration
             is_move_assignable<_Tp>>
                                     ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:10: error: unknown type name '_Tp'
    swap(_Tp&, _Tp&)
         ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:16: error: unknown type name '_Tp'
    swap(_Tp&, _Tp&)
               ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2654:51: error: use of undeclared identifier '_Tp'
    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
                                                  ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:45: error: expected '(' for function-style cast or type construction
                    is_nothrow_move_assignable<_Tp>>::value);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:48: error: no member named 'value' in the global namespace
                    is_nothrow_move_assignable<_Tp>>::value);
                                                    ~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:5: error: a type specifier is required for all declarations
    swap(_Tp&, _Tp&)
    ^
[  0%] Building LLVM bitcode Configuration.cpp-gfx1101.bc
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2658:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2660:5: error: no variable template matches partial specialization
    __enable_if_t<__is_swappable<_Tp>::value>
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

@shiltian
Copy link
Contributor

Can you attach the full log here?

@jeffcbecker
Copy link
Author

Compilation fails at the end. Log starting from where error begins is below.

Consolidate compiler generated dependencies of target yaml2obj
[ 98%] Built target yaml2obj
[ 98%] Built target runtimes-clobber
[ 98%] Performing build step for 'runtimes'
[ 0%] Built target libomp-needed-headers
[ 0%] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/runtime/src/kmp_alloc.cpp:13:
In file included from /nobackupnfs1/jcbecker/llvm-project/openmp/runtime/src/kmp.h:70:
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:8: error: expected ';' after struct
{ } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:521:9: error: a type specifier is required for all declarations
{ } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected unqualified-id
_GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:27: error: expected ')'
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:696:26: note: to match this '('
_GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2648:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
_GLIBCXX20_CONSTEXPR
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2650:5: error: no variable template matches partial specialization
_Require<_not<__is_tuple_like<_Tp>>,
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2652:31: error: expected ';' at end of declaration
is_move_assignable<_Tp>>
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:10: error: unknown type name '_Tp'
swap(_Tp&, _Tp&)
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:16: error: unknown type name '_Tp'
swap(_Tp&, _Tp&)
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2654:51: error: use of undeclared identifier '_Tp'
noexcept(_and<is_nothrow_move_constructible<_Tp>,
^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:45: error: expected '(' for function-style cast or type construction
is_nothrow_move_assignable<_Tp>>::value);

/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2655:48: error: no member named 'value' in the global namespace
                    is_nothrow_move_assignable<_Tp>>::value);
                                                    ~~^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2653:5: error: a type specifier is required for all declarations
    swap(_Tp&, _Tp&)
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2658:5: error: unknown type name '_GLIBCXX20_CONSTEXPR'
    _GLIBCXX20_CONSTEXPR
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2660:5: error: no variable template matches partial specialization
    __enable_if_t<__is_swappable<_Tp>::value>
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2660:46: error: expected ';' at end of declaration
    __enable_if_t<__is_swappable<_Tp>::value>
                                             ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2661:5: error: a type specifier is required for all declarations
    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
    ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2661:16: error: use of undeclared identifier '__a'
    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
               ^
/nasa/pkgsrc/toss3/2021Q2/gcc10/include/c++/type_traits:2661:21: error: use of undeclared identifier '_Nm'
    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[5]: *** [openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o] Error 1
make[4]: *** [openmp/runtime/src/CMakeFiles/omp.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

@shiltian
Copy link
Contributor

I tried locally with GCC 10 but cannot reproduce the error you observed. It'll be more helpful if you can attach the full log, including CMake configure and make -v.

@jeffcbecker
Copy link
Author

OK. Did git pull on llvm-project followed by cmake and make. Outputs from both commands attached.
cmake.out.txt
make.out.txt

@shiltian
Copy link
Contributor

How did you make clang choose GCC 10 in the second build pass for OpenMP? I didn't see you use GCC_INSTALL_PREFIX. I'm asking because I think clang by default will use system GCC instead of the one from modules.

@jeffcbecker
Copy link
Author

I didn't realize I needed to do anything. Where do I specify GCC_INSTALL_PREFIX?

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 19, 2022

I didn't realize I needed to do anything. Where do I specify GCC_INSTALL_PREFIX?

I mentioned earlier to pass -DGCC_INTALL_PREFIX=<path> to the CMake invocation. Start with a fresh build too. The prefix should be the directory where you can get ./bin/gcc

@shiltian
Copy link
Contributor

Hmm, based on your initial description, it looks like you were using the system GCC 4.8.5. Later it became GCC 10.3.

@jeffcbecker
Copy link
Author

correct - I forgot to load the module on the initial issue

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 19, 2022

correct - I forgot to load the module on the initial issue

The module system usually causes a lot of problems when certain tools prefer to look at the system's binaries rather than whatever PATH or LD_LIBRRY_PATH tells them. -DGCC_INSTALL_PREFIX usually fixed my problems when building things on clusters with very old system installations of gcc so let me know if it's still broken after a clean build with that set to the path in the module.

@shiltian
Copy link
Contributor

Yeah, that's the tricky part. AFAIK, module load gcc cannot make clang to use it by default. Some manual efforts have to be done to force clang to use the GCC loaded by module. GCC_INSTALL_PREFIX is usually the best way to handle that. Another way is to use clang config file, which also requires some extra arguments when building clang. Since you don't have both, I'm not sure how clang can pick up the GCC 10.3 loaded by module. My wild guess is your module did something and that causes the compile error you observed.

@jeffcbecker
Copy link
Author

Success! My ultimate goal of this was to build OpenMP target offload for NVIDIA and AMD GPU's. Although I did not specify nvptx or amdgpu as LLVM_TARGETS_TO_BUILD, it looks like those might have been built (runtime.txt attached with make -j8 output). Do I need to do anything else? Thanks!

runtime.txt

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 19, 2022

Success! My ultimate goal of this was to build OpenMP target offload for NVIDIA and AMD GPU's. Although I did not specify nvptx or amdgpu as LLVM_TARGETS_TO_BUILD, it looks like those might have been built (runtime.txt attached with make -j8 output). Do I need to do anything else? Thanks!

runtime.txt

Glad to hear it. All targets are built by default unless specified otherwise. Right now we should be able to build both the AMD and NVIDIA offloading support even without a valid ROCm / CUDA installation. Here's a useful program that returns 0 if offloading was successful.

// clang test.c -fopenmp --offload-arch=<arch>
#include <omp.h>

int main() {
  int isDevice = 0;
#pragma omp target map(from : isDevice)
  { isDevice = omp_is_initial_device(); }
  return isDevice;
}

Let me know if this works for you.

@jeffcbecker
Copy link
Author

I asked because my cmake specified
-DLLVM_TARGETS_TO_BUILD=X86

However the make output contains lines like:
[ 47%] Extracting LLVM bitcode libomptarget-amdgpu-gfx940.bc
[ 47%] Building CXX object openmp/libomptarget/plugins/cuda/CMakeFiles/omptarget.rtl.cuda.dir/src/rtl.cpp.o
[ 47%] Extracting LLVM bitcode libomptarget-nvptx-sm_35.bc
...
[ 53%] Embedding LLVM offloading binary in devicertl-amdgpu-gfx940.o
[ 53%] Embedding LLVM offloading binary in devicertl-nvptx-sm_35.o

@jeffcbecker
Copy link
Author

also, my cmake had:
-DLLVM_ENABLE_PROJECTS=clang

and I was wondering if I needed to add : openmp

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 19, 2022

also, my cmake had: -DLLVM_ENABLE_PROJECTS=clang

and I was wondering if I needed to add : openmp

-DLLVM_ENABLE_RUNTIMES=openmp is a replacement for -DLLVM_ENABLE_PROJECTS=openmp. And yes, since you only built X86 you need to set it to X86;NVPTX;AMDGPU to be able to offload.

@jeffcbecker
Copy link
Author

Not sure what's wrong but...

jcbecker@pfe26 514$ cmake -G "Unix Makefiles"
-DCMAKE_BUILD_TYPE=Release
-DGCC_INSTALL_PREFIX=/nasa/pkgsrc/toss3/2021Q2/gcc10
-DLLVM_TARGETS_TO_BUILD=X86;NVPTX
-DLLVM_ENABLE_PROJECTS=clang
-DLLVM_ENABLE_RUNTIMES=openmp ../llvm
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.

CMake Error: The source directory "/nobackupnfs1/jcbecker/llvm-project/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-bash: NVPTX: command not found

@shiltian
Copy link
Contributor

-DLLVM_TARGETS_TO_BUILD="X86;NVPTX"

@jeffcbecker
Copy link
Author

got both targets to build - thanks

@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Dec 20, 2022
@jeffcbecker jeffcbecker reopened this Dec 21, 2022
@jeffcbecker
Copy link
Author

@jhuber6 , I tried your test.c program above, and added a print statement to print isDevice before returning. I compiled it with:

$ clang test.c -fopenmp -fopenmp-targets=nvptx64

$ ./a.out
isDevice is 1

You had indicated that it should return 0, so it seems like offloading is not working. Please advise

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 21, 2022

@jhuber6 , I tried your test.c program above, and added a print statement to print isDevice before returning. I compiled it with:

$ clang test.c -fopenmp -fopenmp-targets=nvptx64

$ ./a.out isDevice is 1

You had indicated that it should return 0, so it seems like offloading is not working. Please advise

Do you have a functioning install of CUDA or ROCm with a compatible GPU on the system? One of the following should at least indicate the presence of a GPU for starters, rocm-smi, nvidia-smi, llvm-omp-device-info.

@shiltian
Copy link
Contributor

@jeffcbecker I don't think the discussion is about the ticket anymore. I'll close it. In addition, for those questions of using OpenMP target offloading, https://discourse.llvm.org/c/runtimes/openmp/ is a better place. GitHub issue is more for bug report.

@ms178
Copy link

ms178 commented Dec 22, 2022

@jhuber6 I still see

ld.lld: error: version script assignment of 'VERSION' to symbol 'ompt_start_tool' failed: symbol not defined
ld.lld: error: version script assignment of 'VERSION' to symbol 'ompt_libomp_connect' failed: symbol not defined

as of 69243cd. I don't get these when using Mold-git as my linker.

PKGBUILD.txt

@jhuber6
Copy link
Contributor

jhuber6 commented Dec 22, 2022

That's caused by lld recently changing the default to error on undefined symbols in version scripts. Someone needs to either define dummy versions of those symbols or adjust the version script. Can you open a new issue?

@ms178
Copy link

ms178 commented Dec 22, 2022

Sure, I'll open a new issue. Filed it here: #59660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-problem openmp platform:linux question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

6 participants