Vivado HLS failed to compile a c test bench code on kubuntu 17.10, the same project compiles perfectly under Windows 10. On Kubuntu and Windows the solutions synthesize, only the sim fails on ubuntu.
from the log file i think that vivado its mixing its gcc4.6.3 with the system gcc libraries, could someone please help me to avoid this.
Regards
INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
Compiling(apcc) ../../../Source/circuito_tb.c in debug mode
INFO: [HLS 200-10] Running '/opt/Xilinx/Vivado/2017.3/bin/unwrapped/lnx64.o/apcc'
INFO: [HLS 200-10] For user 'ernesto' on host 'eco-laptop' (Linux_x86_64 version 4.13.0-16-generic) on Fri Nov 17 16:32:27 CET 2017
INFO: [HLS 200-10] On os Ubuntu 17.10
INFO: [HLS 200-10] In directory '/home/ernesto/home/uc3m/asignaturas/SubsistemasAD/VivadoHLS_Homework/CruzOliveraErnesto_VivadoHLS_Homework/default/csim/build'
ERROR: [APCC 202-3] Gcc Compile failed:
In file included from /opt/Xilinx/Vivado/2017.3/lnx64/tools/gcc/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/features.h:339:0,
from /usr/include/setjmp.h:25,
from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:3:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:459:49: error: missing binary operator before token "("
In file included from /opt/Xilinx/Vivado/2017.3/lnx64/tools/gcc/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/limits.h:169:0,
from /opt/Xilinx/Vivado/2017.3/lnx64/tools/gcc/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/syslimits.h:7,
from /opt/Xilinx/Vivado/2017.3/lnx64/tools/gcc/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3/include-fixed/limits.h:34,
from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:4:
/usr/include/limits.h:145:17: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:12:0:
/usr/include/stdio.h:276:43: error: missing binary operator before token "("
/usr/include/stdio.h:349:17: error: missing binary operator before token "("
/usr/include/stdio.h:567:17: error: missing binary operator before token "("
/usr/include/stdio.h:592:43: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:13:0:
/usr/include/string.h:164:21: error: missing binary operator before token "("
/usr/include/string.h:173:43: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:14:0:
/usr/include/stdlib.h:131:36: error: missing binary operator before token "("
/usr/include/stdlib.h:174:17: error: missing binary operator before token "("
/usr/include/stdlib.h:188:36: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:15:0:
/usr/include/math.h:44:36: error: missing binary operator before token "("
/usr/include/math.h:59:17: error: missing binary operator before token "("
/usr/include/math.h:67:36: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:15:0:
/usr/include/math.h:137:17: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:15:0:
/usr/include/math.h:169:17: error: missing binary operator before token "("
In file included from /usr/include/math.h:224:0,
from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:15:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:112:17: error: missing binary operator before token "("
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:289:17: error: missing binary operator before token "("
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:344:17: error: missing binary operator before token "("
In file included from /tmp/apcc_db_ernesto/185171510932747310469/circuito_tb.c:15:0:
/usr/include/math.h:314:18: error: missing binary operator before token "("
/usr/include/math.h:479:17: error: missing binary operator before token "("
/usr/include/math.h:826:17: error: missing binary operator before token "("
ERROR: [APCC 202-3] Tmp directory is /tmp/apcc_db_ernesto/185171510932747310469
ERROR: [APCC 202-1] APCC failed.
csim.mk:79: recipe for target 'obj/circuito_tb.o' failed
make: *** [obj/circuito_tb.o] Error 1
CRITICAL WARNING: [SIM 100] 'csim_design' failed: compilation error(s).
INFO: [SIM 3] *************** CSIM finish ***************
Vivado HLS is bundled with a rather old gcc
version, and its headers do not match with your system's. For me, it happened when I upgraded glibc
to version 2.26.
It may be dangerous to downgrade your system's glibc
. The safest solution is to switch to clang
until Xilinx updates bundled gcc
. You can find this option at Project
-> Project Settings
-> Simulation
-> Compiler
.
If clang
is not already installed in your machine, a sudo apt-get install clang
should do the job.