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

vadd host binary compilation error #116

Closed vkomenda closed 1 year ago

vkomenda commented 1 year ago

Do you know how to fix the following compilation error? I'm trying to build the vadd host binary.

$ g++ -o vadd -O2 vadd.cpp vadd-host.cpp -l:libtapa.a -lfrt -l:libglog.so.0.4.0 -lgflags -lOpenCL -lpthread -ldl -lboost_context -I${HOME}/Xilinx/Vitis_HLS/2022.1/include -g

/usr/bin/ld: /tmp/cchbrAjt.o: in function `long tapa::internal::invoker<void (&)(tapa::mmap<float const>, tapa::mmap<float const>, tapa::mmap<float>, unsigned long)>::invoke<tapa::read_only_mmap<float const>, tapa::read_only_mmap<float const>, tapa::write_only_mmap<float>, unsigned long const&>(bool, void (&)(tapa::mmap<float const>, tapa::mmap<float const>, tapa::mmap<float>, unsigned long), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tapa::read_only_mmap<float const>&&, tapa::read_only_mmap<float const>&&, tapa::write_only_mmap<float>&&, unsigned long const&)':
/usr/include/tapa/host/task.h:68: undefined reference to `google::ErrnoLogMessage::ErrnoLogMessage(char const*, int, int, long, void (google::LogMessage::*)())'
collect2: error: ld returned 1 exit status
Blaok commented 1 year ago

I think this is caused by a version mismatch between the glog library and the glog header. The glog 0.4.0 library takes an int for the 4th argument, but apparently the header is expecting a long. Could you check which glog/logging.h is being included?

vkomenda commented 1 year ago

Thanks! That was indeed a wrong header file. I switched to using glog v0.4 compiled from source to fix that.