🐛 [Bug] Windows build broken after 1.2.0 - experimental:filesystem in TRTEngine (original) (raw)

Bug Description

At some point after v1.2.0 the TensorRT\core\runtime\TRTEngine.h file was added and it brought the #include <experimental/filesystem> with it. I had some issues trying to build due to this. A #define is needed to build, the path cannot implicitly be converted to a std::string, an extra #include is needed to use std::stringbuilder and there is no stdc++fs to link against.

Environment

Rough fix

The below changes were needed to get a compile. They probably would break the build on other systems - so maybe need to be based on some platform detection.

Additional CMAKE flag

{ "name": "CMAKE_CXX_FLAGS", "value": "-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING", "type": "STRING" }

Code changes

diff --git a/core/runtime/CMakeLists.txt b/core/runtime/CMakeLists.txt index d21c661a..b3632e8f 100644 --- a/core/runtime/CMakeLists.txt +++ b/core/runtime/CMakeLists.txt @@ -33,7 +33,6 @@ target_link_libraries(${lib_name} TensorRT::nvinfer torch core_util

)

Install

diff --git a/core/runtime/TRTEngine.h b/core/runtime/TRTEngine.h index 5615a824..1a2df1f2 100644 --- a/core/runtime/TRTEngine.h +++ b/core/runtime/TRTEngine.h @@ -25,7 +25,7 @@ struct TRTEngine : torch::CustomClassHolder { std::string name; RTDevice device_info;

diff --git a/core/runtime/TRTEngineProfiler.cpp b/core/runtime/TRTEngineProfiler.cpp index a1159516..7857a467 100644 --- a/core/runtime/TRTEngineProfiler.cpp +++ b/core/runtime/TRTEngineProfiler.cpp @@ -1,5 +1,6 @@ #include #include +#include #include

#include "core/runtime/TRTEngineProfiler.h"