UCLA-VAST / tapa

TAPA is a dataflow HLS framework that features fast compilation, expressive programming model and generates high-frequency FPGA accelerators.
https://tapa.rtfd.io
MIT License
144 stars 27 forks source link

Compilation failed for vadd after installation #152

Open KevinLikesDringCoffe opened 4 months ago

KevinLikesDringCoffe commented 4 months ago

After installing tapa I tried to build vadd by source run_tapa.sh But I encounter these errors

I0316 04:40:40.180 tapa.util:184] logging level set to INFO
I0316 04:40:40.180 tapa.tapac:407] Executing all steps of tapac
W0316 04:40:40.180 tapa.tapac:429] The floorplan option is automatically enabled because a floorplan output file is provided
I0316 04:40:40.180 tapa.tapac:521] running translated command: `tapa --work-dir=run analyze --input=vadd.cpp --top=VecAdd synth --part-num=xcu250-figd2104-2L-e --clock-period=3.33 optimize-floorplan --connectivity=link_config.ini link --floorplan-output=run/VecAdd_floorplan.tcl pack --output=run/VecAdd.xo --bitstream-script=run/VecAdd_generate_bitstream.sh`
I0316 04:40:40.181 tapa.util:184] logging level set to INFO
I0316 04:40:40.181 tapa.tapa:54] tapa version: 0.0.20240301.1
I0316 04:40:40.181 tapa.tapa:58] Python recursion limit set to 3000
I0316 04:40:40.242 tapa.steps.analyze:248] Running tapacc command: /usr/local/bin/tapacc run/flatten/flatten-5322dfa0-vadd.cpp -top VecAdd -- -std=c++17 -I /home/zhenyu/.local/lib/python3.8/site-packages/tapa/../../../src -stdlib=libc++ -isystem /usr/lib/llvm-17/include/c++/v1/ -isystem /usr/include/clang/17/include/ -isystem /usr/lib/clang/17/include/
<scratch space>:45:1: error: expected unqualified-id
   45 | 
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:14:
In file included from /usr/include/c++/v1/__compare/compare_three_way.h:13:
In file included from /usr/include/c++/v1/__compare/three_way_comparable.h:14:
In file included from /usr/include/c++/v1/__concepts/common_reference_with.h:12:
In file included from /usr/include/c++/v1/__concepts/convertible_to.h:13:
In file included from /usr/include/c++/v1/__type_traits/is_convertible.h:14:
/usr/include/c++/v1/__type_traits/is_array.h:40:22: error: reference to unresolved using declaration
   40 | template <class _Tp, size_t _Np>
      |                      ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:22:
/usr/include/c++/v1/__iterator/access.h:22:22: error: reference to unresolved using declaration
   22 | template <class _Tp, size_t _Np>
      |                      ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:22:
/usr/include/c++/v1/__iterator/access.h:27:22: error: reference to unresolved using declaration
   27 | template <class _Tp, size_t _Np>
      |                      ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:182:26: error: reference to unresolved using declaration
  182 | enum class align_val_t : size_t {};
      |                          ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:207:84: error: reference to unresolved using declaration
  207 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
      |                                                                                    ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:207:66: error: 'operator new' takes type size_t ('unsigned long') as first parameter
  207 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
      |                                                                  ^
/usr/include/c++/v1/new:209:19: error: reference to unresolved using declaration
  209 | operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
      |                   ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:209:1: error: 'operator new' takes type size_t ('unsigned long') as first parameter
  209 | operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
      | ^
/usr/include/c++/v1/new:213:67: error: reference to unresolved using declaration
  213 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
      |                                                                   ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:216:86: error: reference to unresolved using declaration
  216 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
      |                                                                                      ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:216:66: error: 'operator new[]' takes type size_t ('unsigned long') as first parameter
  216 | _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
      |                                                                  ^
/usr/include/c++/v1/new:218:21: error: reference to unresolved using declaration
  218 | operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
      |                     ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:218:1: error: 'operator new[]' takes type size_t ('unsigned long') as first parameter
  218 | operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
      | ^
/usr/include/c++/v1/new:222:69: error: reference to unresolved using declaration
  222 | _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
      |                                                                     ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:227:19: error: reference to unresolved using declaration
  227 | operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
      |                   ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:227:1: error: 'operator new' takes type size_t ('unsigned long') as first parameter
  227 | operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
      | ^
/usr/include/c++/v1/new:229:19: error: reference to unresolved using declaration
  229 | operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
      |                   ^
/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here
   61 | using ::size_t _LIBCPP_USING_IF_EXISTS;
      | ^
In file included from /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp:5:
In file included from /usr/local/include/tapa.h:6:
In file included from /usr/local/include/tapa/host/tapa.h:4:
In file included from /usr/local/include/tapa/base/tapa.h:6:
In file included from /usr/local/include/tapa/base/util.h:7:
In file included from /usr/include/c++/v1/ostream:179:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:24:
In file included from /usr/include/c++/v1/__memory/allocation_guard.h:15:
In file included from /usr/include/c++/v1/__memory/allocator_traits.h:14:
In file included from /usr/include/c++/v1/__memory/construct_at.h:23:
/usr/include/c++/v1/new:229:1: error: 'operator new' takes type size_t ('unsigned long') as first parameter
  229 | operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
      | ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Error while processing /home/zhenyu/tapa/apps/vadd/run/flatten/flatten-5322dfa0-vadd.cpp.
E0316 04:40:41.632 tapa.steps.analyze:179] command ('/usr/local/bin/tapacc', 'run/flatten/flatten-5322dfa0-vadd.cpp', '-top', 'VecAdd', '--', '-std=c++17', '-I', '/home/zhenyu/.local/lib/python3.8/site-packages/tapa/../../../src', '-stdlib=libc++', '-isystem', '/usr/lib/llvm-17/include/c++/v1/', '-isystem', '/usr/include/clang/17/include/', '-isystem', '/usr/lib/clang/17/include/') failed with exit code 1

How can I solve it?

Blaok commented 4 months ago

How did you install TAPA? Since your tapacc is installed under /usr/local/bin/, I think you might be installing from source and need to install Clang 17 manually (sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" 17 all).

KevinLikesDringCoffe commented 4 months ago

How did you install TAPA? Since your tapacc is installed under /usr/local/bin/, I think you might be installing from source and need to install Clang 17 manually (sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" 17 all).

I installed TAPA from source since my system is 18.04 and already installed Clang 17

Blaok commented 3 months ago

OK I was able to reproduce this problem after installing from source. The problem is indeed with Clang 17 installation; sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" 17 all is actually installing Clang 18 instead of Clang 17 now☹️.

@KevinLikesDringCoffe Could you try if sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash 17 all fixes the issue?