Vivado HLS 2017.3 csim errors on Ubuntu 17.10 - vivado

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.

You need to rebuild your headers. Make sure to update the directories with your version of Vivado HLS.
cd /opt/Xilinx/Vivado_HLS/2015.2/lnx64/tools/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/install-tools; ./mkheaders /opt/Xilinx/Vivado_HLS/2015.2/lnx64/tools/gcc/
Source: https://wiki.archlinux.org/index.php/Xilinx_Vivado

Related

NTP 4.2.8p15 fails build with glibc 2.34: error: missing binary operator before token "("

I am building NTP 4.2.8p15 with glibc 2.34.
The build fails with error:
In file included from /usr/include/pthread.h:33,
from work_thread.c:13:
work_thread.c:45:57: error: missing binary operator before token "("
45 | #if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
| ^~~~~~~~~~~~~~~~~
The problem is answered here:
https://bugs.archlinux.org/task/74690
Since glibc 2.34 PTHREAD_STACK_MIN is no longer a compile time constant so can not be used in preprocessor comparisons which causes
the compilation failure [1]. The fix attached to the upstream bug
report [2] resolves the issue.
Additional info:
ntp 4.2.8.p15-1
https://bugs.ntp.org/show_bug.cgi?id=3741
[1] ntp-4.2.8.p15-1-x86_64-build.log.xz
[2] https://bugs.ntp.org/attachment.cgi?id=1814
To fix this build issue, apply the patch in link to NTP.

trying to build pytorch 1.0.0 cuda 10.2 with support for old gpu (3.0)

I'm playing with a couple of projects that explicitly require pytorch == 1.0.0, but I have an old graphics card that only supports cuda 3.0 so I'm using the cpu, which is very slow, being the graphics card a dual gpu I decided to give a try and build pytorch from the sources with support for 3.0 (I have planned to update the pc but is not gonna happen anytime soon).
I am using docker to do the build, in particular I tried to modify an existing Dockerfile from build-pytorch, on the host system I am using debian/sid and there is cuda 10.2 cudnn 7.6 installed, I'm not sure if I can downgrade cuda, and I don't know if the versions in the container must be exactly the same as the host (like for nvidia drivers).
Gist of the modified Dockerfile
The first thing I noticed when updating the versions is that package cuda-cublas-dev-10-2 was not found, the latest version was 10-0,
CUBLAS packaging changed in CUDA 10.1 to be outside of the toolkit installation path
If I install cublas version 10-0 or if I don't install it obviously no header files are found (error below), if I install the recommended libcublas-dev version the build continues for a while, with some warnings (below) , but then it stops with the error below.
I searched for the error online but I did not find anything specific, if I understand correctly there is a function declared more than once and when it is called the choice is ambiguous, but I have not yet investigated looking at the sources.
I would like to know if anyone has run into this error before and knows how to fix it.
libcublas-dev installed error:
[ 67%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/sparse/cuda/caffe2_gpu_generated_SparseCUDABlas.cu.o
/pytorch/aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu(58): error: more than one instance of function "at::native::sparse::cuda::cusparseGetErrorString" matches the argument list:
function "cusparseGetErrorString(cusparseStatus_t)"
function "at::native::sparse::cuda::cusparseGetErrorString(cusparseStatus_t)"
argument types are: (cusparseStatus_t)
1 error detected in the compilation of "/tmp/tmpxft_00004ccc_00000000-6_SparseCUDABlas.cpp1.ii".
CMake Error at caffe2_gpu_generated_SparseCUDABlas.cu.o.Release.cmake:279 (message):
Error generating file
/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/sparse/cuda/./caffe2_gpu_generated_SparseCUDABlas.cu.o
caffe2/CMakeFiles/caffe2_gpu.dir/build.make:1260: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/sparse/cuda/caffe2_gpu_generated_SparseCUDABlas.cu.o' failed
warnings:
ptxas warning : Too big maxrregcount value specified 96, will be ignored
missing header error:
Scanning dependencies of target caffe2_pybind11_state
[ 59%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state.dir/python/pybind_state.cc.o
In file included from /pytorch/aten/src/THC/THC.h:4:0,
from /pytorch/torch/lib/THD/../THD/base/TensorDescriptor.h:6,
from /pytorch/torch/lib/THD/../THD/base/TensorDescriptor.hpp:6,
from /pytorch/torch/lib/THD/../THD/THD.h:14,
from /pytorch/torch/lib/THD/base/DataChannelRequest.h:3,
from /pytorch/torch/lib/THD/base/DataChannelRequest.hpp:6,
from /pytorch/torch/lib/THD/base/DataChannelRequest.cpp:1:
/pytorch/build/caffe2/aten/src/THC/THCGeneral.h:17:23: fatal error: cublas_v2.h: No such file or directory
compilation terminated.
make[2]: *** [caffe2/torch/lib/THD/CMakeFiles/THD.dir/base/DataChannelRequest.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Apparently the problem was that both libcusparse and aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu implement cusparseGetErrorString() and for version >= 10.2 the one in the library should be used.
--- aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu.orig 2020-11-16 12:13:17.680023134 +0000
+++ aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cu 2020-11-16 12:13:45.158407583 +0000
## -9,7 +9,7 ##
namespace at { namespace native { namespace sparse { namespace cuda {
-
+#if 0
std::string cusparseGetErrorString(cusparseStatus_t status) {
switch(status)
{
## -51,6 +51,7 ##
}
}
}
+#endif
inline void CUSPARSE_CHECK(cusparseStatus_t status)
{
I haven't tried yet if it works at runtime but the build is successful.

Issue with installing PyLucene 6.5.0 on Linux

I recently moved to python3, so I'm trying to install the recent version of Pylucene (version 6.5.0) which is compatible with python3.
jcc3/sources/jcc.cpp: In function ‘PyObject* t_jccenv_strhash(PyObject*, PyObject*)’:
jcc3/sources/jcc.cpp:214:27: error: expected ‘)’ before ‘PRIxMAX’
sprintf(buffer, "%0*" PRIxMAX, (int) hexdig, hash);
^
jcc3/sources/jcc.cpp:214:54: warning: conversion lacks type at end of format [-Wformat=]
sprintf(buffer, "%0*" PRIxMAX, (int) hexdig, hash);
^
jcc3/sources/jcc.cpp:214:54: warning: too many arguments for format [-Wformat-extra-args]
error: command 'gcc' failed with exit status 1
But, to install the jcc I get the following error which I have no idea why it occurs:
Do you have any idea about this issue?
Thank you in advance,
Amin
I had the same problem, was solved by setting __STDC_FORMAT_MACROS:
My JCC_CFLAGS is set to:
export JCC_CFLAGS="-v;-fno-strict-aliasing;-Wno-write-strings;-D__STDC_FORMAT_MACROS"
An example of an automated build script of JCC for conda is available at:
https://github.com/conda-forge/jcc-feedstock/blob/master/recipe/build.sh

Nodejs RPM rebuild error with centos 6.8

I'm trying to rebuild nodejs 4.2.3 rpm and when running rpm build getting following error.
../deps/v8/src/base/platform/mutex.h:184: error: expected initializer before '<' token
../deps/v8/src/base/platform/mutex.h:202: error: template declaration of 'LockGuard final'
../deps/v8/src/base/platform/mutex.h:203: error: expected primary-expression before 'public'
Any idea what I'm missing here. Thanks in advance.
Found the solution, https://github.com/nodejs/node/issues/3347
Updated gcc & g++ accroding to the (https://gist.github.com/stephenturner/e3bc5cfacc2dc67eca8b ) & now it's working fine.

building mDNSResponder-master fails on linux machine (ubuntu 32-bit)

I am building mDNSResponder-master on my linux machine (ubuntu 32-bit).
I did the following steps:
1. cd ./mDNSPosix
2. make os=linux
I get the following error message:
mDNSPosix.c: In function ‘mDNSPlatformTCPAccept’:
mDNSPosix.c:364:13: **error: ‘fd’ undeclared** (first use in this function)
mDNSPosix.c:364:13: note: each undeclared identifier is reported only once for each function it appears in
mDNSPosix.c:359:71: warning: unused parameter ‘sd’ [-Wunused-parameter]
mDNSPosix.c: In function ‘mDNSPlatformTCPConnect’:
mDNSPosix.c:375:115: warning: unused parameter ‘hostname’ [-Wunused-parameter]
make: *** [objects/prod/mDNSPosix.c.o] Error 1
When I look into ‘mDNSPlatformTCPAccept() function in mDNSPosix.c, I find the following affestation: sock->fd = fd; while fd isn't a global variable so the compiler seems to have right.
How can I fix such error while I shouldn't modify the source code?
Thanks in advance.
Regards,
Problem fixed when using the latest version of DNS Server provided here:
http://opensource.apple.com/tarballs/mDNSResponder/
Thanks for all

Resources