11-22-2017 03:06 AM
I recently switched to SDx 2017.2. After trying to import and build a project, SDx prints out the following error messages regarding "hls_half.h":
C:/Xilinx/SDx/2017.2/Vivado_HLS/include/hls_half.h:2187:17: error: no member named 'fmax' in namespace 'std'; did you mean simply 'fmax'? return expr(std::fmax(x, y)); ^~~~~~~~~ fmax
This happens for every c++11 function included from cmath. I tried specifying "-std=c++11" in the compiler options, but without success.
I currently using a workaround by hardcoding the functions into "half_hls.h"....
Thanks a lot,
12-04-2017 09:53 PM
12-06-2017 01:20 AM
#define HALF_ENABLE_CPP11_CMATH 0
at the top of the "hls_half.h" file. Not a 100% clean solution, but worked for me. :)
12-07-2017 10:11 PM
12-07-2017 11:41 PM
no unfortunately I do not get this error, so I don't know how to fix it. :/
I also do not get the warnings before.
I had another workaround before I found this by replacing the hls_half.h from 2017.2 with the one from 2017.1.
There is the one from 2017.1 attached, maybe this will help you.
12-11-2017 12:11 AM
i have the same problem by the 2017.01 hls_half.h
i cant do any thing,but waiting for the new SDX
12-27-2018 10:00 AM - edited 12-27-2018 10:03 AM
Here are two things to try...
1) remove the std:: (and any using namespace std)... e.g. just call fmax with no namespace (you should include the the math include file)
2) define your own FMAX macro, and call that instead e.g. #define FMAX(_a, _b) ((_a) >= (_b)) ? (_a) : (_b)
Hope that helps
12-28-2018 02:39 AM
Thanks for your reply @xilinxacct, but same project works good on another PC without any code change. Both are SDSoC 2018.2 and the only difference between them is Ubuntu versions (16.04 and 18.04). I checked includes and libraries. I tried -std=c++11 flag but still it can't build.
12-28-2018 06:20 AM
With both of those suggestions, you should not need the std=c++11 flag any more, since it is as basic as it gets at that point. Using 2018.2 The compiler worked fine for both of those methods. Suggestion #2 is just code, so doesn't even count on a library. Maybe you have some other issue (especially, as you say, it works elsewhere)
01-03-2019 02:15 AM
I fixed the problem with updating the petalinux platform file which I was downloaded from Avnet Ultra96 support page. I think sw part of the platform folder is updated in the new version and it works ok in SDSoC 2018.2.