Building the example application skeleton or l2fwd or l3fwd via DPDK meson with option -Dexamples=, creates the binary executable without any warnings or error. But executing the same example as standalone build leads to DPDK build error
C:\dpdk\dpdk-21.02\examples\skeleton>gcc basicfwd.c -include rte_config.h -march=native -IC:/include -Wl,--as-needed -LC:/lib -lrte_cfgfile -lrte_hash -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
In file included from C:/include/rte_eal.h:21,
from basicfwd.c:7:
C:/include/rte_bus.h:22:10: fatal error: sys/queue.h: No such file or directory
#include <sys/queue.h>
^~~~~~~~~~~~~
compilation terminated.
Expectation:
C:\dpdk\dpdk-21.02\examples\skeleton>dir
Directory of C:\dpdk\dpdk-21.02\examples\skeleton
<DIR> .
<DIR> ..
163,348 a.exe
5,458 basicfwd.c
1,511 Makefile
322 meson.build
Steps to reproduce the error
Platform: x86_64, Intel E5 2680 Xeon
OS: windows server 2019
DPDK version: 21.02
Meson version: 0.57.1
Ninja version: 1.10.2
Pkg-config version: 0.26
Steps followed: http://doc.dpdk.org/guides/windows_gsg/index.html
compiler flags: execute pkg-config --cflags --libs libdpdk
There is a difference in the CFLAGS and LDFLAGS when one uses meson meson -Dexamples=l2fwd build and meson build. In the former scenario, the dependency is pulled from DPDK root folder directly and direct link to lib/librte_eal/windows/include. But when DPDK pkg has installed the files under lib/librte_eal/windows/include are not copied over which causes build failure.
Checking meson.build in lib/librte_eal/windows/ reveals the only install is for 'rte_os.h', 'rte_virt2phys.h', and 'rte_windows.h'. Folder 'netinet' and 'sys' are skipped. Based on the update from DPDK maintainer, since DPDK on windows is experimental only validation done is with meson -Dexamples=l2fwd build. Hence as temporary work around is to use -I[DPDK folder]\lib\librte_eal\windows\include\
Note:
Thanks to #stackinside for the comment
working on DPDK patch to plug the missing files.
Related
I have already used the Aravis library on a host running on Linux,
Aravis is a C open-source library for camera acquisition. You could find the GitHub repo in the link below:
https://github.com/AravisProject/aravis
I want to cross-compile the library for my ARM target running on a Mendel Linux machine.
The thing is I am not very familiar with the meson build and this library does not offer any makefile.
Do you have any idea or sample of the makefile that could help me cross-compile, please?
Thank you in advance
S.Tarik
I tried to change the configuration in Linux to call the g++ cross compiler first by changing the priority between the default gcc and aarch64-linux-gnu-g++.
https://github.com/highperformancecoder
the error message thrown by the compiler is the following:
www#www-virtual-machine:~/Downloads/aravis-main$ meson build
The Meson build system
Version: 0.63.3
Source dir: /home/www/Downloads/aravis-main
Build dir: /home/www/Downloads/aravis-main/build
Build type: native build
Project name: aravis
Project version: 0.8.23
meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/www/Downloads/aravis-main/build/meson-private/sanitycheckc.exe'.
A full log can be found at /home/www/Downloads/aravis-main/build/meson-logs/meson-log.txt
tar
I struggle with Caffe compilation. Unfortunately I failed to compile it.
Steps I followed:
git clone https://github.com/BVLC/caffe.git
cd caffe
mkdir build
cd build
cmake ..
make all
Running make all fails with the following error message:
[ 2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o
In file included from /usr/include/cuda_runtime.h:59:0,
from <command-line>:0:
/usr/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.9 and up are not supported!
#error -- unsupported GNU version! gcc 4.9 and up are not supported!
^
CMake Error at cuda_compile_generated_im2col.cu.o.cmake:207 (message):
Error generating /mydir/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_im2col.cu.o
Software version:
OS: Debian.
gcc version: 5.3.1.
nvcc version: 6.5.12.
cat /proc/driver/nvidia/version result:
NVRM version: NVIDIA UNIX x86_64 Kernel Module 352.63 Sat Nov 7 21:25:42 PST 2015
GCC version: gcc version 4.8.5 (Debian 4.8.5-3)
Attempts to solve the problem
1st try
Simple solutions are often best ones, so (as suggested here) I tried to comment out macro checking gcc version from /usr/include/host_config.h (line 82). Unfortunately it doesn't work and compilation fails badly:
1 catastrophic error detected in the compilation of "/tmp/tmpxft_000069c2_00000000-4_im2col.cpp4.ii".
2nd try
I tried to run:
cmake -D CMAKE_CXX_COMPILER=g++-4.8 ..
make
but it fails with exactly the same error message (even though g++-4.8 should be accepted).
3rd try
I've found similar problem (though not related to Caffe) and I tried to solve it as suggested in the accepted answer.
What I did:
I've ran grep -iR "find_package(CUDA" caffe command and found Cuda.cmake file which has find_package(CUDA 5.5 QUIET) in line 225.
I added set(CUDA_HOST_COMPILER /usr/bin/gcc-4.8) to Cuda.cmake, line before line: find_package(CUDA 5.5 QUIET).
I removed everything from build directory and ran cmake and make again - with and without -D CMAKE_CXX_COMPILER=g++-4.8.
Unfortunately result is exactly the same. Caffe probably overwrites it somehow - I didn't figure it out how.
make VERBOSE=1 2>&1 | grep -i compiler-bindir returns nothing.
What's interesting, make VERBOSE=1 prints command that fails, which is:
/usr/bin/nvcc -M -D__CUDACC__ /mydir/caffe/src/caffe/util/im2col.cu -o /mydir/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 -DUSE_LMDB -DUSE_LEVELDB -DUSE_OPENCV -DWITH_PYTHON_LAYER -DGTEST_USE_OWN_TR1_TUPLE -Xcompiler ,\"-fPIC\",\"-Wall\",\"-Wno-sign-compare\",\"-Wno-uninitialized\",\"-O3\",\"-DNDEBUG\" -gencode arch=compute_20,code=sm_21 -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=useless_using_declaration -Xcudafe --diag_suppress=set_but_not_used -Xcompiler -fPIC -DNVCC -I/usr/include -I/mydir/caffe/src -I/usr/include -I/mydir/caffe/build/include -I/usr/include/hdf5/serial -I/usr/include/opencv -I/usr/include/atlas -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/mydir/caffe/include -I/mydir/caffe/build
when I add --compiler-bindir /usr/bin/gcc-4.8 flag manually, it prints error:
nvcc fatal : redefinition of argument 'compiler-bindir'
which may be related to this bug report.
Edit: I didn't notice that --compiler-bindir and -ccbin are the same options, and the latter is already set in above command that failed. When I changed -ccbin /usr/bin/cc to -ccbin /usr/bin/gcc-4.8 in above command that failed, it completes successfully. Now I need to find option in Caffe's CMake file that overwrite -ccbin in all subsequent Caffe's CMakes. Looking at cmake/Cuda.cmake:252:list(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA} seems to be good way to go.
How can I successfully complete my compilation? Any help is appreciated.
Related SO questions:
host_config.h:unsupported GNU version! gcc versions later than 4.9 are not supported.
CUDA 6.5 complains about not supporting gcc 4.9 - what to do?.
cmake -D CUDA_NVCC_FLAGS="-ccbin gcc-4.8" .. && make causes successful compilation.
Now another problem showed up: linking Google's libgflags or libprotobuf fails probably due to fact that it was compiled with newer gcc version but it's not related to asked question.
My machine runs Ubuntu 15.10, and my default compiler version is gcc 5.2.1 .
Commenting out the #error directive in line 115 of file
/usr/local/cuda-7.5/include/host_config.h
(or whatever the path on your system is) did the trick for me. Caffe compiled fine, all tests ran smoothly.
On the other hand, if one chooses to ignore this and proceed to compile part of the project with one compiler version, part of the project with another (for me it was gcc-4.8 and gcc-5.2.1), linking problems will arise. The linking problems of protobuf and libgflags another answer mentions are not unrelated to this.
I followed V8 Build Instructions from here
Here are the steps that I'm following to build V8 on Mac OSX.
1. git clone git://github.com/v8/v8.git v8-src && cd v8-src
2. make dependencies
3. make x64 -j8 library=shared snapshot=on console=readline
But I do not see out/x64.release/obj.target/tools/gyp/libv8_base.x64.a (or snapshot.a)
The Folder only contains js2c.stamp
Here is the Gist: Build Output
What am I doing wrong ..
Ok, the documentation specifies the location for Linux Machines. For Mac OSX, these files are here :
out/x64.release/libv8_base.x64.a (& snapshot.a)
Finally, compile your C++ Module, by linking V8, as below:
g++ -Iinclude test.cc -o test out/x64.release/libv8_{base.x64,snapshot}.a -lpthread
I have strange thing happened to my CUDA Toolkit 5.0.
Few days ago both XCode and NSight Eclipse plugin lost ability to build even simplest CUDA related projects. XCode successfully building projects with custom build rule for C++ source files:
nvcc "INPUT_FILE_NAME"
But console output shows that run failed
error: executable doesn't exist: '/Users/geraldus/Library/Developer/Xcode/DerivedData/CUDA_Hello_World-gzfzqivvsmeamfghnovopxapkdsz/Build/Products/Debug/CUDA Hello World'
error: failed to launch '/Users/geraldus/Library/Developer/Xcode/DerivedData/CUDA_Hello_World-gzfzqivvsmeamfghnovopxapkdsz/Build/Products/Debug/CUDA Hello World' -- SBTarget is invaliderror: failed to launch '/Users/geraldus/Library/Developer/Xcode/DerivedData/CUDA_Hello_World-gzfzqivvsmeamfghnovopxapkdsz/Build/Products/Debug/CUDA Hello World' -- SBTarget is invalid
And Eclipse NSight output always shows that .o file is missing.
**** Build of configuration Release for project Simple CUDA RT ****
make all
Building file: ../src/Simple CUDA RT.cu
Invoking: NVCC Compiler
nvcc -O3 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_35,code=sm_35 -odir "src" -M -o "src/Simple CUDA RT.d" "../src/Simple CUDA RT.cu"
nvcc -O3 "src/Simple CUDA RT.o" "../src/Simple CUDA RT.cu"
i686-apple-darwin11-llvm-g++-4.2: src/Simple CUDA RT.o: No such file or directory
make: *** [src/Simple CUDA RT.o] Error 1
**** Build Finished ****
How can I fix it? Is it a bug or my incorrect actions?
UPDATE [10:03 UTC 6 NOV 2012]
I've tried to rebuild CUDA samples this way:
cd /Developer/NVIDIA/CUDA-5.0/samples
make clean
make
Everything was built without errors, binaries were successfully generated and they works. But still the same situation with XCode and Eclipse (even after reinstalling Eclipse and CUDA Toolkit)
This looks like a permissions issue. Verify the build folder (and all the files in it) are writable by the current user.
Update
Turns out the actual problem with Nsight EE was spaces in the file name.
I am attempting to compile gcc 4.4.0 on opensolaris 2009.6
Currently in the box (which is a AMD 64bit machine), I have the gcc 3.4.6 installed.
I unpacked the gcc 4.4.0 tarball.
I set the following env variables:
export CXX=/usr/local/bin/g++
export CC=/usr/local/bin/gcc
Then I ran "configure && make" and this is the error message that I got:
checking for i386-pc-solaris2.11-gcc... /export/home/me/wd/gcc/gcc-4.4.0/host-i386-pc-solaris2.11/gcc/xgcc -B/export/home/me/wd/gcc/gcc-4.4.0/host-i386-pc-solaris2.11/gcc/ -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -m64
checking for suffix of object files... configure: error: in `/export/home/me/wd/gcc/gcc-4.4.0/i386-pc-solaris2.11/amd64/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
Anyone has any suggestion as to how to work around this error message?
/Edit:
Content of the config.log is posted here: link text
Normally the GCC build is bootstrapped, i.e. first it uses the system compiler to build GCC C compiler, and then it uses the freshly built compiler to recompile GCC once again (and then even once more time again). The configure line shows that it is not the system compiler but the already-built GCC compiler which is used for configure test there.
Since it fails, the problem is that the freshly-built GCC is somehow "stillborn" here. If config.log will not help you, I'd suggest to ask at gcc-help#gcc.gnu.org.
EDIT: Ah-ha, I think it is the assembler. You are using GNU assembler, but the unsupported options look like they were meant for Sun assembler. This should be solved by adding --with-gnu-as configure option (and then possibly having to specify its path explicitly with --with-as=/usr/gnu/bin/as)
You can also take a look at Solaris-specific GCC build instructions.
There's a readily available build for gcc4, which you can try updating. Its current version is 4.3.3. To get started, install pkg-get from OpenCSW and check out the build from the subversion repository:
svn co https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/trunk/ gcc4
cd gcc4
gmake package