10-21-2015 06:03 AM
There is a bug in vivado 2015.3 regarding Vivado vs. System include paths. In my case the problematic header is "gmp.h", but it is a more general problem with the way Vivado HLS calls gcc. I have to add something like the following line to the very top of my C/C++ design as work-around (before including things like "hls_math.h"):
otherwise I get the following error message in RTL/C Co-Simulation:
In file included from /opt/Xilinx/Vivado_HLS/2015.3/include/floating_point_v7_0_bitacc_cmodel.h:148:0, from /opt/Xilinx/Vivado_HLS/2015.3/include/hls_half.h:40, from /opt/Xilinx/Vivado_HLS/2015.3/include/hls/utils/x_hls_utils.h:37, from /opt/Xilinx/Vivado_HLS/2015.3/include/hls_math.h:48, from /home/clifford/Work/uprojects/2015/raw2cart_hls/raw2ovdv.h:7, from /home/clifford/Work/uprojects/2015/raw2cart_hls/raw2ovdv.cc:1: /opt/Xilinx/Vivado_HLS/2015.3/include/mpfr.h:181:9: error: ‘__gmp_const’ does not name a type
The problem is that gcc is looking in the system include directories before looking in /opt/Xilinx/Vivado_HLS/2015.3/include/, and I happen to have an (apperently incompatible) gmp.h in /usr/include/x86_64-linux-gnu/gmp.h. In the generated _pre.cc file it can easily be observed that this header is used instead of the one shipped with Vivado HLS.
[This is a bug report. I don't need support.]
04-03-2017 08:29 AM
I am getting same errors while using gmp.h in my project. I added path (drive:\Xilinx\Vivado_HLS\2015.2\include\gmp.h) to solve the issue of gmp.h not found.
11-28-2017 08:57 AM
Thank you! This worked for me as well. Great help! Makes sense - it's strange that I am still getting this bug in version 2017.1.