compile tensorrt sample not found NvOnnxParserTypedefs.h - tensorrt

i have install tensorrt
i have already checked python -c "import tensorrt"
but when i compile tensorrt sample
make
it throws out
../../include/NvOnnxParser.h:27:10: fatal error: NvOnnxParserTypedefs.h: No such file or directory
#include "NvOnnxParserTypedefs.h"
i find include file in the dictionary
ls ../../include
the result is
NvCaffeParser.h NvInferPlugin.h NvOnnxParser.h NvUffParser.h
NvInfer.h NvOnnxConfig.h NvOnnxParserRuntime.h NvUtils.h
who can help me?
there maybe some useful resources
https://github.com/NVIDIA/TensorRT/blob/release/6.0/samples/opensource/sampleMNIST/README.md
https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html#mnist_sample
https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html#installing-tar
https://github.com/NVIDIA/TensorRT/tree/release/5.1
https://github.com/onnx/onnx-tensorrt/tree/5.1
https://github.com/NVIDIA/TensorRT/blob/release/6.0/samples/opensource/sampleMNIST/README.md

i fixed this issues
may be your compiler not found the NvOnnxParserTypedefs.h file
try
sudo find / -name NvOnnxParserTypedefs.h
and do the follow script
sudo cp /your/path/to/NvOnnxParserTypedefs.h /your_tensorrt_path/include/
and it may work

Related

scan-build always reports No Bugs found with make but working with single file on Linux

I am trying to use scan-build to do static analysis for my project.
When I run the scan-build with single .cpp or .c file , it reports the bugs correctly.
But when I use with cmake/make , it always says No Bugs found.
Commands used:
scan-build --use-cc /usr/bin/gcc --use-c++ /usr/bin/c++ --keep-cc cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/c++
scan-build -V -v -v --use-cc /usr/bin/gcc --use-c++ /usr/bin/c++ --keep-cc --force-analyze-debug-code -analyze-headers -stats --status-bugs --use-analyzer=/llvm-project/build/bin/clang-15 --analyzer-target --keep-going -enable-checker all checkers separated by comma -o reports path
Actual Output:
scan-build: Analysis run complete.
scan-build: Removing directory '/tmp/scan-build-' because it contains no reports.
scan-build: No bugs found.
Expected Output:
scan-build bugs with html reports
Single file output:
11: warning: Division by zero [core.DivideZero]
return 5/(x-x); // warn
~^~~~~~
1 warning generated.
scan-build: Analysis run complete.
scan-build: 1 bug found.
scan-build: Run 'scan-view /tmp/scan-build-' to examine bug reports.
I have tried all the other options mentioned in this forum, but nothing worked for me.
Tried below also,
export CCC_CC=clang
export CCC_CXX=clang++
Would be very helpful if someone provide exact options that can work and generate bugs with gcc/make.

Compiling meshlab on Centos EL7

I'm have trouble compiling meshlab-2016.12 on Centos.EL7.
I got some of the way.
Updated QT to Qt-5.9.1 as latest on Centos is Qt version 5.6.1 - which I had previously installed
sudo yum install qt5-qtbase
sudo yum install qt5-qtx11extras
sudo yum install qt5-qtbase-devel
However at least Qt5.7 is needed for meshlab
Then set these env. variables
setenv QTDIR /usr/local/Qt-5.9.1
setenv QTINC /usr/local/Qt-5.9.1/include
setenv QTLIB /usr/local/Qt-5.9.1/lib
setenv PATH /usr/local/Qt-5.9.1/bin:$PATH
setenv PATH /usr/local/bin:/usr/local/Qt-5.9.1/bin:$PATH
Then followed instructions on a test machine, installing into /opt/TESTING
Installed vcglib into /opt/TESTING
downloaded meshlab-2016.12 into /opt/TESTING and unpacked it there
Ran the following
qmake -project
(This picks up the correct version of QT)
qmake src/external/external.pro
(To make the external libraries - including jhead-2.95
gmake
gmake install
(To make the external libraries - including jhead-2.95 )
qmake src/meshlab_mini.pro
(To build meshlab with a minimal set of plugins )
This is where it fails, as below;
../../vcglib/vcg/complex/algorithms/clean.h:1789:0:
warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
pragma omp parallel for schedule(dynamic, 10)
g++ -Wl,-O1 -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../distrib -Wl,-rpath,
/usr/local/Qt-5.9.1/lib -o ../distrib/meshlab main.o mainwindow_Init.o
mainwindow_RunTime.o glarea.o multiViewer_Container.o plugindialog.o
customDialog.o filterScriptDialog.o saveSnapshotDialog.o layerDialog.o
savemaskexporter.o changetexturename.o stdpardialog.o ml_std_par_dialog.o
xmlstdpardialog.o additionalgui.o xmlgeneratorgui.o ml_render_gui.o
ml_rendering_actions.o ml_default_decorators.o ml_selection_buffers.o
trackball.o trackmode.o coordinateframe.o glarea_setting.o filterthread.o
qrc_meshlab.o moc_interfaces.o moc_mainwindow.o moc_glarea.o
moc_multiViewer_Container.o moc_plugindialog.o moc_customDialog.o
moc_filterScriptDialog.o moc_saveSnapshotDialog.o moc_savemaskexporter.o
moc_changetexturename.o moc_layerDialog.o moc_stdpardialog.o
moc_ml_std_par_dialog.o moc_xmlstdpardialog.o moc_additionalgui.o
moc_xmlgeneratorgui.o moc_ml_render_gui.o moc_ml_rendering_actions.o
moc_filterthread.o -L../external/lib/linux-g++ -ljhead -L../distrib
-lcommon -lGLU -L/usr/local/Qt-5.9.1/lib -lQt5OpenGL -lQt5Widgets -lQt5Gui
-lQt5Xml -lQt5XmlPatterns -lQt5Network -lQt5Script -lQt5Core -lGL -lpthread
/bin/ld: cannot find -ljhead
collect2: error: ld returned 1 exit status
gmake[1]: *** [../distrib/meshlab] Error 1
gmake[1]: Leaving directory `/opt/TESTING/meshlab-2016.12/meshlab'
gmake: *** [sub-meshlab-make_first-ordered] Error 2
So it's saying ld can't find ljhead. Other parts of the compile do seem to be finding it though eg
-I../src/external/glew-1.7.0/include -I../src/external/jhead-2.95
Looking at ld
/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
and
/
usr/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
Any advice would be useful at this point. Hopefully I've just missed something out
Updated:
Tried workaround from William Brown below, which gave some progress. Failed at later point
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_layer'
cd meshlabplugins/filter_measure/ && ( test -e Makefile || /opt/bin/Qt5.7.1/5.7/gcc_64/bin/qmake
/opt/src/meshlab/src/meshlabplugins/filter_measure/filter_measure.pro -o Makefile ) && gmake -f Makefile
gmake[1]: Entering directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake[1]: *** No rule to make target `filter_measure.xml', needed by `../../distrib/plugins/libfilter_measure.so'. Stop.
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake: *** [sub-meshlabplugins-filter_measure-make_first-ordered] Error 2
I have managed to get past that problem on Centos 7 (7.3.1611).
There seem to be 2 issues, and I don't claim that this is the right fix, just a work-around.
After unpacking the tar file I cd to the top level (I have unpacked to /local/meshlab). I then create a link:
# ln -s ./src/external eternal
The reason being that the -L in the statement that fails seems to be pointed to an external folder at that top level, not in ./src.
Having done that I can build external.pro without any problem, and the output .a files all go into /local/meshlab/lib/linux-g++. Without the link they were deep down in a temporary build folder.
However the -L doesn't look there, it looks in /local/meshlab/src/external/lib/linux-g++/, where there are some pre-shipped .a files already. So I copy the .a files to there:
# cp /local/meshlab/lib/linux-g++/*.a /local/meshlab/src/external/lib/linux-g++/
Now when I use:
# qmake src/meshlab_mini.pro
# gmake
It works and builds a runnable meshlab binary in /local/meshlab/distrib.

R package with C code on Windows (win-build) fails to compile, ar: Command not found

I have a package that I'm trying to build on Windows using win-builder for CRAN. The compilation fails with this message:
ar -crs libmseed.a fileutils.o genutils.o gswap.o lmplatform.o lookup.o msrutils.o pack.o packdata.o traceutils.o tracelist.o parseutils.o unpack.o unpackdata.o selection.o logging.o
make[1]: ar: Command not found
This is my Makevars.win file:
PKG_CFLAGS=
PKG_CPPFLAGS=-Ilibmseed
PKG_LIBS=-Llibmseed -lmseed
$(SHLIB): libmseed/libmseed.a
libmseed/libmseed.a:
#(cd libmseed && $(MAKE) static CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)")
clean:
#(cd libmseed && $(MAKE) clean)
I have also tried modifying the Makevars.win file using AR="ar mingw" and without AR specified. I get the same "ar: Command not found" message. Does anyone know a solution to this problem?
This is solved. I changed the Makefile from
ar -crs $(LIB_A) $(LIB_OBJS)
to
$(AR) -crs $(LIB_A) $(LIB_OBJS)
and now it compiles.

Cannot load a plugin to frama-c with call to ocamlyices functions

I am trying to develop a plugin to frama-c.
I did build the application, which has several files, and then created the makefile referencing all the files i needed.
I am able to use make and then make install and execute the plugin. My problem appears when i call functions from the ocamlyices library in a function...
I am still able to do the make and make install and when i try to execute i get the following error:
[kernel] warning: cannot load plug-in 'name' (incompatible with Fluorine-20130601).
[kernel] user error: option `<name>' is unknown.
use `frama-c -help' for more information.
[kernel] Frama-C aborted: invalid user input.
So it says it is incompatible when I add the call to ocamlyices functions. Is there any option/configuration I am missing somewhere?
Thank you for your help.
The final solution looked like this:
FRAMAC_SHARE := $(shell frama-c.byte -print-path)
FRAMAC_LIBDIR := $(shell frama-c.byte -print-libpath)
PLUGIN_NAME = Fact
# All needed files
PLUGIN_CMO = ../base/basic_types concolic_search run_fact ../lib/lib
PLUGIN_DOCFLAGS = -I ../base -I ../lib -I $(YICES) -I /usr/lib/ocaml/batteries -I ../instrumentation
PLUGIN_BFLAGS = -I ../base -I ../lib -I $(YICES) -I ../instrumentation
PLUGIN_OFLAGS = -I ../base -I ../lib -I $(YICES) -I ../instrumentation
PLUGIN_EXTRA_BYTE = $(YICES)/ocamlyices.cma
PLUGIN_EXTRA_OPT = $(YICES)/ocamlyices.cmxa
include $(FRAMAC_SHARE)/Makefile.dynamic
The variable $(YICES) is defined as
export YICES="/usr/local/lib/ocaml/3.12.1/ocamlyices"
As mentioned by Anne, if your plug-in uses an external library that is not already included by Frama-C itself, you need a few more steps than for a basic plug-in, especially setting PLUGIN_EXTRA_BYTE and PLUGIN_EXTRA_OPT to the external libraries that you want to be linked to your plug-in. It might also be necessary to adapt the flags passed to the linker with PLUGIN_LINK_BFLAGS and PLUGIN_LINK_OFLAGS, but this is heavily dependent on ocamlyices itself. More information on the variables that can be used to customize the compilation of your plug-in can be found in section 5.3.3 of Frama-C's development guide.

Why is dh_usrlocal throwing a build error?

I am trying to compile a deb package for my server. When I go to build, everything looks good until it gets to dh_usrlocal The build stops and make returns an error. The problem is I am trying this for the first time and I really don't know where to look for the problem.
This is the output from my terminal, I also included the command I ran at the bottom of the output.
make[2]: Leaving directory `/home/ian/Desktop/scst-2.1.0/src'
make[1]: Leaving directory `/home/ian/Desktop/scst-2.1.0'
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installcatalogs
dh_installcron
dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime
dh_installmodules
dh_installlogcheck
dh_installlogrotate
dh_installpam
dh_installppp
dh_installudev
dh_installwm
dh_installxfonts
dh_bugfiles
dh_lintian
dh_gconf
dh_icons
dh_perl
dh_usrlocal
dh_usrlocal: debian/scst/usr/local/include/scst/scst.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_user.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/Module.symvers is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_debug.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_const.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_sgv.h is not a directory
rmdir: failed to remove `debian/scst/usr/local/include/scst': Directory not empty
dh_usrlocal: rmdir debian/scst/usr/local/include/scst returned exit code 1
make: *** [binary] Error 1
dpkg-buildpackage: error: debian/rules binary gave error exit status 2
ian#vm01:~/Desktop/scst-2.1.0$ sudo dpkg-buildpackage -rfakeroot
Any help would be appreciated.
you should skip running dh_usrlocal. to do it you just add this to debian/rules file: override_dh_usrlocal:
In general manner if you have a problem with a specific target, you just override it by adding override_{target} in your debian/rules file.
example, you have a problem with dh_icons. you just add this in your debian/rules file.
override_dh_icons:
{insert your processing commands or do nothing to skip it when building package}
A proper Debian package is not allowed to generate stuff there but empty directories.That is why it is complaining that it can not delete the directory. It doesnt expect files to be there.the only thing you can have is a directory in /usr/local and that's what dh_usrlocal tries to handle
but you shouldn't have files
Users only put files in /usr/local/.
Also i think if you have usr/local name in your directory path it will cause the error also like even though it is not the correct usr/local. An example of what could cause the problem also. I think the regex in build software looks for usr/local.
/var/tmp/usr/local/
I know this is an old post but it is ranked #1 on google so needs a good answer so people solve this problem quickly.
IMPORTANT: This error ONLY occurs when you try to install to /usr/local/
I moved my package to install from /usr/local/lib/python3/dist-packages/ to /usr/lib/python3/dist-packages and the error disappeared. dh_usrlocal seems to be broken or my package is not abiding by rules it expects.
I started getting the error after adding a package.install file to my debian package so it would copy the package contents to the filesystem. (I was installing to /usr/local/ at the time)
Contents of my install file when it failed:
usr/* usr/
Contents when it works correctly:
usr/ usr/
File structure of debian package:
packagename-0.1/
debian/
usr/
local/
lib/
python3/
packagename/
Edit:
This seems only to work when copying root directories. Once I try to specify copying past usr/, it breaks with the same error. See top of answer to find my solution.

Resources