UPGRADE YOUR BROWSER
We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!
11-22-2017 03:06 AM
Hello everyone,
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,
Seek
12-04-2017 09:53 PM
hi seek64:
i havethe same problem, and in SDCOC 2017.02?
how can you solve the problem.my project have the error yet
thanks
12-06-2017 01:20 AM
Hello zhch7777,
try adding
#define HALF_ENABLE_CPP11_CMATH 0
at the top of the "hls_half.h" file. Not a 100% clean solution, but worked for me. :)
Regards,
Seek
12-07-2017 10:11 PM
hi seek64:
thank for reply,
yes i add
#define HALF_ENABLE_CPP11_CMATH 0
and could compile with warning.but can not build elf file
do you have the same problem.
12-07-2017 11:41 PM
Hello,
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.
Regards,
Seek
12-11-2017 12:11 AM
hello
thanks
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 09:37 AM
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)
OR
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
Hi,
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.