TensorRT: Unable to run sampleOnnxMNIST with CMake
I’m using cmake 3.18. I tried the 1st step in “Running the sample” in https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/sampleOnnxMNIST
I went to <TensorRT root directory>/samples/sampleOnnxMNIST, entered cmake ..
and got
unknown CMake command "set_ifndef" in sampleAlgorithmSelector/CMakeLists.txt
I then changed that to set
. I then got this error
CMakeError at <TensorRT root directory>/samples/CMakeSamplesTemplate.txt`:
(if):
if given arguments:
"caffe" "IN_LIST" "SAMPLE_PARSERS"
any help?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19
I used 3.14.5, and got the same problem.
Build under ‘TensorRT/’ instead of ‘TensorRT/samples/’ and the errors go away. My bad.
@HXPRedBlue for the “Unknown CMake command “set_ifndef”” error, please consider put “include(…/…/cmake/modules/set_ifndef.cmake)” in “CMakeList.txt” file (Zhou’s suggestion)
I come across the same issue, When include : CMakeSamplesTemplate.txt
– Detecting CXX compile features – Detecting CXX compile features - done CMake Error at /TensorRT/samples/CMakeSamplesTemplate.txt:22 (set_ifndef): Unknown CMake command “set_ifndef”. Call Stack (most recent call first): CMakeLists.txt:22 (include)
CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as
should be added at the top of the file. The version specified may be lower if you wish to support older CMake versions for this project. For more information run “cmake --help-policy CMP0000”. This warning is for project developers. Use -Wno-dev to suppress it.
– Configuring incomplete, errors occurred! See also “/TensorRT/samples/sampleMNIST/build/CMakeFiles/CMakeOutput.log”
So is there any other method to resolve this issue, my cmake version is 3.14.4, I used the docker container to build the TensorRT OSS code, follow the offical method , I can build all the project , but when I try to build one project , it failed
We have not tested the native build internally. We use cross compile inside docker, the detail instructions is in https://github.com/NVIDIA/TensorRT/tree/release/8.0#setting-up-the-build-environment, and the cmake version is 3.14.4 according to https://github.com/NVIDIA/TensorRT/blob/release/8.0/docker/ubuntu-20.04.Dockerfile#L86
Can confirm, am seeing the same issue.
CMake Error at CMakeSamplesTemplate.txt:22 (set_ifndef): Unknown CMake command "set_ifndef"
When running
cmake ./
in the directory<TensorRT root directory>/samples/sampleOnnxMNIST
Running:
bbcda320
As far as I know this is the latest stable version of everything on the Jetson AGX Xavier (e.g. JetPack and all packages installed via official apt-get repos). Are these samples not meant to be compatible with it? It was mentioned above that the CMake is out of date but it looks like that didn’t help according to one of the users that commented here. I’d be surprised about the decision to use a version that isn’t the default latest version on apt-get for NVIDIA’s JetPack releases…
Given this is a fairly simple sample, I’m just going to move on, but figured I’d share for any future folks that stumble upon this problem.
I got same issue and cmake files should got error in it?