Error with array.h headers - c++

I use CLion and I have this simple code:
#include <array>
int main() {
std::array<std::uint64_t, 3> arr;
return 0;
}
In my CMakeLists.txt I tried all the compiler flags from c++11/gnu++11 to c++17/gnu++17, but I keep getting this error when trying to build the code above
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake --build
/pathToCLionProject/my_project/cmake-build-default --target my_project -- -j 2
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -H/pathToCLionProject/my_project -B/pathToCLionProject/my_project/cmake-build-default --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/gmake -f CMakeFiles/Makefile2 my_project
gmake[1]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -H/pathToCLionProject/my_project -B/pathToCLionProject/my_project/cmake-build-default --check-build-system CMakeFiles/Makefile.cmake 0
/pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -E cmake_progress_start /pathToCLionProject/my_project/cmake-build-default/CMakeFiles 2
/usr/bin/gmake -f CMakeFiles/Makefile2 CMakeFiles/my_project.dir/all
gmake[2]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
/usr/bin/gmake -f CMakeFiles/my_project.dir/build.make CMakeFiles/my_project.dir/depend
gmake[3]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
cd /pathToCLionProject/my_project/cmake-build-default && /pathToCLion/clion-2018.1.2/bin/cmake/bin/cmake -E cmake_depends "Unix Makefiles" /pathToCLionProject/my_project /pathToCLionProject/my_project /pathToCLionProject/my_project/cmake-build-default /pathToCLionProject/my_project/cmake-build-default /pathToCLionProject/my_project/cmake-build-default/CMakeFiles/my_project.dir/DependInfo.cmake --color=
Scanning dependencies of target my_project
gmake[3]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
/usr/bin/gmake -f CMakeFiles/my_project.dir/build.make CMakeFiles/my_project.dir/build
gmake[3]: Entering directory '/pathToCLionProject/my_project/cmake-build-default'
[ 50%] Building CXX object CMakeFiles/my_project.dir/dev/hmmenc_client/test.cpp.o
/usr/bin/c++ -I/pathToCLionProject/my_project -I/pathToCLionProject/my_project/dev/hmmenc_client -I/usr/local/include/pqxx -I/usr/pgsql-10/include -pthread -std=gnu++11 -o CMakeFiles/my_project.dir/dev/hmmenc_client/test.cpp.o -c /pathToCLionProject/my_project/dev/hmmenc_client/test.cpp
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp: In function ‘int main()’:
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:10: error: ‘array’ is not a member of ‘std’
std::array<std::uint64_t, 3> arr;
^~~~~
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:10: note: ‘std::array’ is defined in header ‘<array>’; did you forget to ‘#include <array>’?
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:6:1:
+#include <array>
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:10:
std::array<std::uint64_t, 3> arr;
^~~~~
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:29: error: expected primary-expression before ‘,’ token
std::array<std::uint64_t, 3> arr;
^
/pathToCLionProject/my_project/dev/hmmenc_client/test.cpp:9:34: error: ‘arr’ was not declared in this scope
std::array<std::uint64_t, 3> arr;
^~~
gmake[3]: *** [CMakeFiles/my_project.dir/build.make:66: CMakeFiles/my_project.dir/dev/hmmenc_client/test.cpp.o] Error 1
gmake[3]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
gmake[2]: *** [CMakeFiles/Makefile2:71: CMakeFiles/my_project.dir/all] Error 2
gmake[2]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/my_project.dir/rule] Error 2
gmake[1]: Leaving directory '/pathToCLionProject/my_project/cmake-build-default'
gmake: *** [Makefile:121: my_project] Error 2
This is my g++ version: gcc version 8.1.1 20180502 (Red Hat 8.1.1-1) (GCC). What can cause this error?

This error occurs if you have an empty file named array in any of the directories listed on the include path (/pathToCLionProject/my_project, /pathToCLionProject/my_project/dev/hmmenc_client /usr/local/include/pqxx, /usr/pgsql-10/include).

Related

Unable to build OpenCV with CUDA on RHEL 7

I am trying to build OpenCV tag 4.2 with CUDA 11.1 in an RHEL 7 docker image and are running into issues.
First issue/warning is this:
THRUST_COMPILER_DEPRECATION(C++14, pass -std=c++14 to your compiler);
Which can be resolved by removing --std=c++11 from cmake/OpenCVDetectCUDA.cmake:265.
Alright, simple enough to handle that warning. Although it would have been better to change it using a cmake option/define. The compile errors for gpu_mat.cu are there with or without the above change.
Then main problem is the build errors that are happening for gpu_mat.cu. Here is my current CMake line. I have tried a bunch of different options and at this point I'm just throwing everything and kitchen sink at it.
cmake ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_CXX11=OFF \ # I have tried it set to ON \
-DCMAKE_CXX_FLAGS="-std=c++14" \ # and without this line.
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ \
-DWITH_EIGEN=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DOPENCV_ENABLE_NONFREE:BOOL=ON \
-DWITH_CUDA:BOOL=ON \
-DCMAKE_PREFIX_PATH=/usr/local/cuda-11.1 \
-DCUDA_ARCH_BIN="52 60 61 70 75 80 86" \
-DCUDA_SEPARABLE_COMPILATION=ON \
-DCUDA_VERBOSE_BUILD=ON \
-DCUDA_NVCC_FLAGS="--std=c++14" \ # even passing this didn't resolve THRUST warning
-DCUDA_FAST_MATH=ON \
-DCUDA_PROPAGATE_HOST_FLAGS=OFF \
-DCUDA_BUILD_CUBIN=ON \
-DCUDA_HOST_COMPILER=/opt/rh/devtoolset-8/root/usr/bin/c++
Here is the VERBOSE output for gpu_mat.cu build:
[ 26%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o
cd /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda && /usr/bin/cmake -E make_directory /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/.
cd /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda && /usr/bin/cmake -D verbose:BOOL=ON -D build_configuration:STRING=Release -D generated_file:STRING=/opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o -D generated_cubin_file:STRING=/opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o.cubin.txt -P /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.Release.cmake
-- Removing /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
/usr/bin/cmake -E rm -f /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
-- Generating dependency file: /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.NVCC-depend
/usr/local/cuda-11.1/bin/nvcc -M -D__CUDACC__ /opt/tmp/opencv/modules/core/src/cuda/gpu_mat.cu -o /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.NVCC-depend -ccbin /opt/rh/devtoolset-8/root/usr/bin/c++ -m64 -D__OPENCV_BUILD=1 -D_USE_MATH_DEFINES -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -DOPENCV_WITH_ITT=1 --std=c++14 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -D_FORCE_INLINES --use_fast_math -Xcompiler -DCVAPI_EXPORTS -Xcompiler -fPIC -DNVCC -I/usr/local/cuda-11.1/include -I/opt/tmp/opencv/build/3rdparty/ippicv/ippicv_lnx/icv/include -I/opt/tmp/opencv/build/3rdparty/ippicv/ippicv_lnx/iw/include -I/opt/tmp/opencv/build -I/opt/tmp/opencv/modules/core/include -I/opt/tmp/opencv/build/modules/core -I/opt/tmp/opencv_contrib/modules/cudev/include -I/opt/tmp/opencv/3rdparty/include/opencl/1.2 -I/opt/tmp/opencv/3rdparty/ittnotify/include
-- Generating temporary cmake readable file: /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend.tmp
/usr/bin/cmake -D input_file:FILEPATH=/opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.NVCC-depend -D output_file:FILEPATH=/opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend.tmp -D verbose=ON -P /usr/share/cmake-3.18/Modules/FindCUDA/make2cmake.cmake
-- Copy if different /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend.tmp to /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend
/usr/bin/cmake -E copy_if_different /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend.tmp /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend
-- Removing /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend.tmp and /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.NVCC-depend
/usr/bin/cmake -E rm -f /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.depend.tmp /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o.NVCC-depend
-- Generating /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
/usr/local/cuda-11.1/bin/nvcc /opt/tmp/opencv/modules/core/src/cuda/gpu_mat.cu -dc -o /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o -ccbin /opt/rh/devtoolset-8/root/usr/bin/c++ -m64 -D__OPENCV_BUILD=1 -D_USE_MATH_DEFINES -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -DOPENCV_WITH_ITT=1 --std=c++14 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -D_FORCE_INLINES --use_fast_math -Xcompiler -DCVAPI_EXPORTS -Xcompiler -fPIC -DNVCC -I/usr/local/cuda-11.1/include -I/opt/tmp/opencv/build/3rdparty/ippicv/ippicv_lnx/icv/include -I/opt/tmp/opencv/build/3rdparty/ippicv/ippicv_lnx/iw/include -I/opt/tmp/opencv/build -I/opt/tmp/opencv/modules/core/include -I/opt/tmp/opencv/build/modules/core -I/opt/tmp/opencv_contrib/modules/cudev/include -I/opt/tmp/opencv/3rdparty/include/opencl/1.2 -I/opt/tmp/opencv/3rdparty/ittnotify/include
And a snippet of the errors that immedately follow:
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h: In member function 'std::size_t std::hash<float>::operator()(float) const':
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h:232:22: error: expected ')' before numeric constant
return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
~ ^~~
)
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h:232:15: error: invalid operands of types 'float' and 'double(const char*) throw ()' {aka 'double(const char*)'} to binary 'operator!='
return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
~~~~~~^~~~~~~~~~
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h:232:64: error: expected ')' before ';' token
return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
~ ^
)
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h: In member function 'std::size_t std::hash<double>::operator()(double) const':
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h:244:22: error: expected ')' before numeric constant
return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
~ ^~
)
/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/functional_hash.h:244:15: error: invalid operands of types 'double' and 'double(const char*) throw ()' {aka 'double(const char*)'} to binary 'operator!='
return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
.................................
~~~
/opt/tmp/opencv/modules/core/src/cuda/gpu_mat.cu:382:4: note: to match this '('
if (value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0 && value[3] == 0.0)
^
/opt/tmp/opencv/modules/core/src/cuda/gpu_mat.cu:415:14: error: 'func_t' does not name a type; did you mean 'fpos_t'?
static const func_t funcs[7][4] =
^~~~~~
fpos_t
/opt/tmp/opencv/modules/core/src/cuda/gpu_mat.cu:426:3: error: 'funcs' was not declared in this scope
funcs[depth()][channels() - 1](*this, value, stream);
^ ~~~
-- Removing /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
/usr/bin/cmake -E rm -f /opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
CMake Error at cuda_compile_1_generated_gpu_mat.cu.o.Release.cmake:276 (message):
Error generating file
/opt/tmp/opencv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/build.make:84: modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o] Error 1
make[2]: Leaving directory '/opt/tmp/opencv/build'
make[1]: *** [CMakeFiles/Makefile2:3852: modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[1]: Leaving directory '/opt/tmp/opencv/build'
make: *** [Makefile:182: all] Error 2
I am running the build process after enabling devtools
scl enable devtoolset-8 bash # also tried with devtoolset-7
I have searched for these errors, but I guess my google-fu is weak for this. I didn't have these errors/problems when I built OpenCV 4.5.1 w/ CUDA in an Ubuntu 18 Docker image.
So I'm totally missing something and have been working on this for a couple of days. I am just out of ideas of what to do next.
Thanks for any input.
I'm seeing some very similar build errors as you are, so you're not alone! I'm told it has something to do with a recent change to centos 7, which has broken nvcc. Hopefully, it gets fixed soon.
https://gitlab.com/nvidia/container-images/cuda/-/issues/109#note_503061879
There was a reported issue with RHEL/CentOS and has since been resolved.
https://access.redhat.com/errata/RHBA-2021:0439

I would like to fix a bug happened while I was trying to compile xenGT

I'm trying to Build Qemu & Xen for XenGT on Ubuntu 20.04 following this tutorial :
https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide#332-build-qemu--xen-for-xengt
because I want to share the integrated GPU with a xen VM.
The main hardware components of my PC are the following :
CPU I9-9900k
Intel Corporation UHD Graphics 630 (Desktop 9 Series) (rev 02)
IVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
The compilation gave no errors until this point :
root#ziomario-z390aoruspro:/etc/xen/igvtg-xen# make install-tools
......
make libs
make[5]: ingresso nella directory «/etc/xen/igvtg-xen/tools/libxc»
rm -f _paths.h.tmp; echo "#define sbindir "/usr/sbin"" >>_paths.h.tmp; echo "#define bindir "/usr/bin"" >>_paths.h.tmp; echo "#define LIBEXEC "/usr/lib/xen"" >>_paths.h.tmp; echo "#define LIBEXEC_BIN "/usr/lib/xen/bin"" >>_paths.h.tmp; echo "#define libdir "/usr/lib"" >>_paths.h.tmp; echo "#define SHAREDIR "/usr/share"" >>_paths.h.tmp; echo "#define XENFIRMWAREDIR "/usr/lib/xen/boot"" >>_paths.h.tmp; echo "#define XEN_CONFIG_DIR "/etc/xen"" >>_paths.h.tmp; echo "#define XEN_SCRIPT_DIR "/etc/xen/scripts"" >>_paths.h.tmp; echo "#define XEN_LOCK_DIR "/var/lock"" >>_paths.h.tmp; echo "#define XEN_RUN_DIR "/var/run/xen"" >>_paths.h.tmp; echo "#define XEN_PAGING_DIR "/var/lib/xen/xenpaging"" >>_paths.h.tmp; echo "#define XEN_DUMP_DIR "/var/lib/xen/dump"" >>_paths.h.tmp; echo "#define XEN_LOG_DIR "/var/log/xen"" >>_paths.h.tmp; echo "#define XEN_LIB_DIR "/var/lib/xen"" >>_paths.h.tmp; echo "#define XEN_RUN_STORED "/var/run/xenstored"" >>_paths.h.tmp; if ! cmp -s _paths.h.tmp paths.h; then mv -f paths.h.tmp paths.h; else rm -f paths.h.tmp; fi
gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION=XEN_LATEST_INTERFACE_VERSION -MMD -MF .xc_pm.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -I../../xen/common/libelf -Werror -Wmissing-prototypes -I. -I./include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -D__XEN_TOOLS -pthread -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/toollog/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/evtchn/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/devicemodel/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -include /etc/xen/igvtg-xen/tools/libxc/../../tools/config.h -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/call/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/foreignmemory/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/libs/gnttab/include -I/etc/xen/igvtg-xen/tools/libxc/../../tools/include -c -o xc_pm.o xc_pm.c
In file included from /usr/include/string.h:495,
from xc_private.h:24,
from xc_pm.c:22:
In function ‘strncpy’,
inlined from ‘xc_set_cpufreq_gov’ at xc_pm.c:308:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[5]: *** [/etc/xen/igvtg-xen/tools/libxc/../../tools/Rules.mk:222: xc_pm.o] Errore 1
make[5]: uscita dalla directory «/etc/xen/igvtg-xen/tools/libxc»
make[4]: *** [Makefile:184: build] Errore 2
make[4]: uscita dalla directory «/etc/xen/igvtg-xen/tools/libxc»
make[3]: *** [/etc/xen/igvtg-xen/tools/../tools/Rules.mk:246: subdir-install-libxc] Errore 2
make[3]: uscita dalla directory «/etc/xen/igvtg-xen/tools»
make[2]: *** [/etc/xen/igvtg-xen/tools/../tools/Rules.mk:241: subdirs-install] Errore 2
make[2]: uscita dalla directory «/etc/xen/igvtg-xen/tools»
make[1]: *** [Makefile:74: install] Errore 2
make[1]: uscita dalla directory «/etc/xen/igvtg-xen/tools»
make: *** [Makefile:127: install-tools] Errore 2
is this a bug ? how can I fix it ? Im not so skilled. Maybe it is an old bug and it is already been fixed,but I didn't find the solution. Can someone help me ? thanks.

Yocto build opengl cts failed

I am trying to build opengl cts into yocto. I created a recipe to do so:
DESCRIPTION = "OpenGL CTS"
LICENSE = "Apache-2.0"
PR = "r0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=67d07a07ec29a50a3ded12b2ba952257"
SRCREV = "77705f0d7a813bdac9c91385e46bff98b16320c9"
SRC_URI = "git://github.com/KhronosGroup/VK-GL-CTS.git;protocol=https"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
The build process for the above recipe failed with the following output at do_compile() method:
| [ 17%] Linking CXX static library libglutil.a
| cd /home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build/framework/opengl && /home/fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/cmake -P CMakeFiles/glutil.dir/cmake_clean_target.cmake
| cd /home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build/framework/opengl && /fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/glutil.dir/link.txt --verbose=1
| arm-poky-linux-gnueabi-ar qc libglutil.a CMakeFiles/glutil.dir/gluContextInfo.cpp.o CMakeFiles/glutil.dir/gluDefs.cpp.o CMakeFiles/glutil.dir/gluDrawUtil.cpp.o CMakeFiles/glutil.dir/gluES3PlusWrapperContext.cpp.o CMakeFiles/glutil.dir/gluFboRenderContext.cpp.o CMakeFiles/glutil.dir/gluPixelTransfer.cpp.o CMakeFiles/glutil.dir/gluProgramInterfaceQuery.cpp.o CMakeFiles/glutil.dir/gluRenderConfig.cpp.o CMakeFiles/glutil.dir/gluRenderContext.cpp.o CMakeFiles/glutil.dir/gluShaderProgram.cpp.o CMakeFiles/glutil.dir/gluShaderUtil.cpp.o CMakeFiles/glutil.dir/gluStateReset.cpp.o CMakeFiles/glutil.dir/gluTexture.cpp.o CMakeFiles/glutil.dir/gluTextureUtil.cpp.o CMakeFiles/glutil.dir/gluTextureTestUtil.cpp.o CMakeFiles/glutil.dir/gluVarType.cpp.o CMakeFiles/glutil.dir/gluVarTypeUtil.cpp.o CMakeFiles/glutil.dir/gluStrUtil.cpp.o CMakeFiles/glutil.dir/gluCallLogWrapper.cpp.o CMakeFiles/glutil.dir/gluObjectWrapper.cpp.o CMakeFiles/glutil.dir/gluContextFactory.cpp.o CMakeFiles/glutil.dir/gluDummyRenderContext.cpp.o CMakeFiles/glutil.dir/gluPlatform.cpp.o CMakeFiles/glutil.dir/gluShaderLibrary.cpp.o
| /home/fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ranlib libglutil.a
| make[2]: Leaving directory '/home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build'
| [ 17%] Built target glutil
| make[1]: Leaving directory '/home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build'
| Makefile:86: recipe for target 'all' failed
| make: *** [all] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: oe_runmake failed

autotools: how to deal with a source generated by configure?

Let's imagine a minimal project with the following structure:
|-- configure.ac
|-- Makefile.am
|-- src/
`-- ...
|-- test/
`-- Makefile.am
`-- test.sh
`-- test.py.in
Now, test.py.in uses autotools variables to build test.py. Running configure does build test.py and I'm quite happy about it.
But, touching/modifying test.py.in and then running make check should run configure before actually testing, but it does not. How to?
My Makefile.am:
check_SCRIPTS = \
test.sh \
$(NULL)
check_PROGRAMS = \
$(NULL)
testsuite_bin_SOURCES = \
$(NULL)
TESTS = \
test.sh \
$(NULL)
MOSTLYCLEANFILES = \
*.out *.err *.log \
$(NULL)
EXTRA_DIST = \
test.sh \
test.py \
$(NULL)
Running make check when test.py has been rmed:
$ make check
make test.sh
make[1]: Entering directory `.../test'
make[1]: Nothing to be done for `test.sh'.
make[1]: Leaving directory `.../test'
make check-TESTS
make[1]: Entering directory `.../test'
*** './test.py' was not found - aborting test ***
FAIL: test.sh
=======================================
1 of 1 test failed
Please report to nobody#nohost.nodomain
=======================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/test
make: *** [check-am] Error 2
Part of my configure.ac:
AC_CONFIG_FILES([
#...
test/Makefile
test/test.py
])
AC_OUTPUT

Sr Programming Language Install On Ubuntu 14.04 Compiler Errors

The SR Programming language is no longer being maintained, so I realize my chances of finding help on this issue might be slim. However, I need the language installed for classroom purposes and can't think of how to proceed.
Here's the seemingly sole source of information on the web about the language
http://www.cs.arizona.edu/sr/
The install package provides a Makefile for installation. However, running the following:
mkdir /usr/local/src/sr
cd /usr/local/src/sr
wget ftp://ftp.cs.arizona.edu/sr/sr.tar.Z
tar xzf sr.tar.Z
make
results in these errors
echo "#" >paths.sh
echo "# Created mechanically; DO NOT EDIT THIS FILE." >>paths.sh
echo "#" >>paths.sh
sed -n >>paths.sh <Configuration \
-e 's/#.*//' -e 's/[ ]*$//' -e 's/ *= */=/' \
-e 's/="*\(.* [^"]*\)"*$/="\1"/' -e '/^[A-Z0-9_]* *=/p'
echo "" >>paths.sh
echo >paths.tmp '/*'
echo >>paths.tmp ' * Created mechanically; DO NOT EDIT THIS FILE.'
echo >>paths.tmp ' */'
sed >>paths.tmp <paths.sh \
-n -e 's/"//g' -e 's/.*/#define &"/' -e 's/= */ "/p'
if cmp -s paths.tmp paths.h; then :; else cp paths.tmp paths.h; fi
cc -g -c -o util.o util.c
util.c: In function ‘salloc’:
util.c:79:27: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
return strcpy (alloc (strlen (s) + 1), s);
^
util.c: In function ‘strtail’:
util.c:94:14: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
int ls = strlen (s);
^
util.c: In function ‘setpath’:
util.c:221:25: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
searchpath = alloc (strlen (evpath) + strlen (ifdir) + 100);
^
cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c
cd sr; make CC="cc" CFLAGS="-g "
make[1]: Entering directory `/usr/local/src/sr/sr'
cc -g -c -o main.o main.c
In file included from main.c:7:0:
../arch.h:147:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token
ERROR -- no architecture selected
^
main.c:114:1: warning: conflicting types for ‘options’ [enabled by default]
options (argc, argv)
^
main.c:114:1: error: static declaration of ‘options’ follows non-static declaration
main.c:53:5: note: previous implicit declaration of ‘options’ was here
options (argc, argv); /* process options */
^
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/usr/local/src/sr/sr'
make: *** [all] Error 2
I figured that this might be a problem with the compiler version I was using. gcc -v returns gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04), and the install files seem to be made to compile on earlier versions. I tried installing an earlier version of gcc such that gcc -v yields gcc version 3.4.6 (Debian 3.4.6-5), but ran into similar yet different compiler errors. Perhaps I did something wrong with the downgraded install because it seems weird that it says Debian 3.4.6-5.
The package also provides a install.sh file. Trying
chmod +x /usr/local/src/sr/install.sh
/usr/local/src/sr/install.sh
returns the following:
+ cp sr/sr /usr/local/bin
cp: cannot stat ‘sr/sr’: No such file or directory
+ strip /usr/local/bin/sr
strip: Warning: '/usr/local/bin/sr' is not an ordinary file
+ cp srl/srl /usr/local/bin
cp: cannot stat ‘srl/srl’: No such file or directory
+ strip /usr/local/bin/srl
strip: Warning: '/usr/local/bin/srl' is not an ordinary file
+ cp srm/srm /usr/local/bin
cp: cannot stat ‘srm/srm’: No such file or directory
+ strip /usr/local/bin/srm
strip: Warning: '/usr/local/bin/srm' is not an ordinary file
+ cp srprof/srprof /usr/local/bin
cp: cannot stat ‘srprof/srprof’: No such file or directory
+ strip /usr/local/bin/srprof
strip: Warning: '/usr/local/bin/srprof' is not an ordinary file
+ cp srtex/srtex /usr/local/bin
cp: cannot stat ‘srtex/srtex’: No such file or directory
+ strip /usr/local/bin/srtex
strip: Warning: '/usr/local/bin/srtex' is not an ordinary file
+ cp srlatex/srlatex /usr/local/bin
cp: cannot stat ‘srlatex/srlatex’: No such file or directory
+ strip /usr/local/bin/srlatex
strip: Warning: '/usr/local/bin/srlatex' is not an ordinary file
+ cp srgrind/srgrind /usr/local/bin
cp: cannot stat ‘srgrind/srgrind’: No such file or directory
+ cp preproc/*2sr /usr/local/bin
cp: cannot stat ‘preproc/*2sr’: No such file or directory
+ cp sr.h /usr/local/lib/sr
+ cp srmulti.h /usr/local/lib/sr
+ cp rts/srlib.a /usr/local/lib/sr
cp: cannot stat ‘rts/srlib.a’: No such file or directory
+ [ -f /bin/ranlib -o -f /usr/bin/ranlib ]
+ ranlib /usr/local/lib/sr/srlib.a
ranlib: '/usr/local/lib/sr/srlib.a': No such file
+ cp library/*.o /usr/local/lib/sr
cp: cannot stat ‘library/*.o’: No such file or directory
+ cp library/*.spec /usr/local/lib/sr
cp: cannot stat ‘library/*.spec’: No such file or directory
+ cp library/*.impl /usr/local/lib/sr
cp: cannot stat ‘library/*.impl’: No such file or directory
+ cp srmap /usr/local/lib/sr
+ cp rts/srx /usr/local/lib/sr
cp: cannot stat ‘rts/srx’: No such file or directory
+ strip /usr/local/lib/sr/srx
strip: '/usr/local/lib/sr/srx': No such file
+ cp srlatex/srlatex.sty /usr/local/lib/sr
+ cp preproc/ccr2sr.h preproc/csp2sr.h preproc/m2sr.h /usr/local/lib/sr
+ cp sr-mode.el /usr/local/lib/sr
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ]
+ echo not installing man pages for commands
not installing man pages for commands
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ]
+ echo not installing sranimator/srgetopt/srwin man pages
not installing sranimator/srgetopt/srwin man pages
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ]
+ echo not installing srmap/srtrace man pages
not installing srmap/srtrace man pages
+ exit 0
and nothing happens.
Can anyone make sense of these errors or at least give advice on how to proceed? It might seem futile because the language hasn't been maintained in a decade, but any advice would help me out tremendously.
Thank you
Update:
My Colleague provided these changes to the ./Configuration file:
sed -i -e "s:/usr/local:/usr:" -e "s:/usr/X11/lib:/usr/lib:" \
-e "s:CCPATH = /bin/cc:CCPATH = /usr/bin/gcc" \
-e "s:RSHPATH = /usr/ucb/rsh:RSHPATH = /usr/bin/ssh:" \
-e "s:VFPATH = /usr/lib/vfontedpr:VFPATH = :" Configuration
Running make on gcc 4.8.4 after this gives
cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c
cd sr; make CC="cc" CFLAGS="-g "
make[1]: Entering directory `/usr/local/src/sr/sr'
cc -g -c -o main.o main.c
In file included from main.c:7:0:
../arch.h:147:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token
ERROR -- no architecture selected
^
main.c:114:1: warning: conflicting types for ‘options’ [enabled by default]
options (argc, argv)
^
main.c:114:1: error: static declaration of ‘options’ follows non-static declaration
main.c:53:5: note: previous implicit declaration of ‘options’ was here
options (argc, argv); /* process options */
^
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/usr/local/src/sr/sr'
make: *** [all] Error 2
It gets rid of the initial pathing issues, but the compiler issues are still there.
With gcc 3.4 it gives
cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c
cd sr; make CC="cc" CFLAGS="-g "
make[1]: Entering directory `/usr/local/src/sr/sr'
cc -g -c -o main.o main.c
In file included from main.c:7:
../arch.h:147: error: syntax error before '--' token
main.c:115: error: conflicting types for 'options'
main.c:53: error: previous implicit declaration of 'options' was here
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/usr/local/src/sr/sr'
make: *** [all] Error 2
"SR" : Old files → → year 2001 !
"SR" compiles OK with gcc version 3.2.3 or gcc version 3.4.6 (
Edit the file 'Configuration'. (
No gcc32 for Ubuntu 14.04 ).)
# make install : Provides /usr/local/bin/sr
P.S. : gcc34 is available for Ubuntu 14.04 :
compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb, or compat-gcc34_3.4.6-ubuntu15_i386.deb