diff --git a/build/build.sh b/build/build.sh index eacfc213064..25b1a0f82e6 100755 --- a/build/build.sh +++ b/build/build.sh @@ -11,7 +11,7 @@ CMAKE_MAJOR_VERSION=`cmake --version | head -n 1 | awk '{print $3}' |awk -F. '{p CPU=`uname -m` if [[ $CMAKE_MAJOR_VERSION != 3 ]]; then - if [[ $OSDIST == "centos" ]] || [[ $OSDIST == "amzn" ]] || [[ $OSDIST == "rhel" ]] || [[ $OSDIST == "fedora" ]]; then + if [[ $OSDIST == "centos" ]] || [[ $OSDIST == "amzn" ]] || [[ $OSDIST == "rhel" ]] || [[ $OSDIST == "fedora" ]] || [[ $OSDIST == "mariner" ]]; then CMAKE=cmake3 if [[ ! -x "$(command -v $CMAKE)" ]]; then echo "$CMAKE is not installed, please run xrtdeps.sh" diff --git a/src/CMake/cpackLin.cmake b/src/CMake/cpackLin.cmake index 5b0628fa4ae..30c22df6e13 100644 --- a/src/CMake/cpackLin.cmake +++ b/src/CMake/cpackLin.cmake @@ -103,7 +103,7 @@ if (${LINUX_FLAVOR} MATCHES "^(ubuntu|debian)") SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_XRT_PACKAGE_DEPENDS}) endif() -elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles)") +elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles|mariner)") execute_process( COMMAND uname -m OUTPUT_VARIABLE CPACK_ARCH @@ -129,10 +129,12 @@ elseif (${LINUX_FLAVOR} MATCHES "^(rhel|centos|amzn|fedora|sles)") SET(CPACK_RPM_AZURE_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/azure/prerm") SET(CPACK_RPM_CONTAINER_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/container/postinst") SET(CPACK_RPM_CONTAINER_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/container/prerm") - SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/local" "/usr/src" "/opt" "/etc/OpenCL" "/etc/OpenCL/vendors" "/usr/lib" "/usr/lib/pkgconfig" "/usr/lib64/pkgconfig" "/lib" "/lib/firmware") + SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/local" "/usr/src" "/opt" "/etc/OpenCL" "/etc/OpenCL/vendors" "/usr/lib" "/usr/lib/pkgconfig" "/usr/lib64/pkgconfig" "/lib" "/lib/firmware" "/usr/share/pkgconfig") SET(CPACK_RPM_AWS_PACKAGE_REQUIRES "xrt >= ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}") if (${LINUX_FLAVOR} MATCHES "^(sles)") SET(CPACK_RPM_XRT_PACKAGE_REQUIRES "ocl-icd-devel >= 2.2, dkms >= 2.2.0, python3 >= 3.6") + elseif (${LINUX_FLAVOR} MATCHES "^(mariner)") + SET(CPACK_RPM_XRT_PACKAGE_REQUIRES "ocl-icd >= 2.2, dkms >= 2.5.0, python3 >= 3.6") else() SET(CPACK_RPM_XRT_PACKAGE_REQUIRES "ocl-icd >= 2.2, dkms >= 2.5.0, python3 >= 3.6") endif() diff --git a/src/runtime_src/core/common/CMakeLists.txt b/src/runtime_src/core/common/CMakeLists.txt index 58527470223..15e9e9fc076 100644 --- a/src/runtime_src/core/common/CMakeLists.txt +++ b/src/runtime_src/core/common/CMakeLists.txt @@ -69,7 +69,6 @@ set_target_properties(xrt_coreutil PROPERTIES # Private dependencies for fully resolved dynamic xrt_coreutil target_link_libraries(xrt_coreutil PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ) @@ -80,7 +79,6 @@ target_link_libraries(xrt_coreutil # libraries of boost target_link_libraries(xrt_coreutil_static INTERFACE - boost_filesystem boost_system ) diff --git a/src/runtime_src/core/common/api/xrt_xclbin.cpp b/src/runtime_src/core/common/api/xrt_xclbin.cpp index 780b3e18915..9ff2920595e 100644 --- a/src/runtime_src/core/common/api/xrt_xclbin.cpp +++ b/src/runtime_src/core/common/api/xrt_xclbin.cpp @@ -37,8 +37,6 @@ #include "xclbin_int.h" #include -#include -#include #include #include diff --git a/src/runtime_src/core/common/config_reader.cpp b/src/runtime_src/core/common/config_reader.cpp index af3f1e1db9b..539c5694f72 100644 --- a/src/runtime_src/core/common/config_reader.cpp +++ b/src/runtime_src/core/common/config_reader.cpp @@ -19,15 +19,14 @@ #include "message.h" #include "error.h" -#include +#include +#include #include +#include #include -#include #include #include -#include -#include #include #ifdef __linux__ @@ -99,14 +98,14 @@ get_self_path() * Look for xrt.ini and if not found look for legacy sdaccel.ini. */ static std::string -verify_ini_path(const boost::filesystem::path& dir) +verify_ini_path(const std::filesystem::path& dir) { auto file_path = dir / "xrt.ini"; - if (boost::filesystem::exists(file_path)) + if (std::filesystem::exists(file_path)) return file_path.string(); file_path = dir / "sdaccel.ini"; - if (boost::filesystem::exists(file_path)) + if (std::filesystem::exists(file_path)) return file_path.string(); return ""; @@ -118,27 +117,27 @@ get_ini_path() std::string full_path; try { //The env variable should be the full path which includes xrt.ini - auto xrt_path = boost::filesystem::path(value_or_empty(std::getenv("XRT_INI_PATH"))); - if (boost::filesystem::exists(xrt_path)) + auto xrt_path = std::filesystem::path(value_or_empty(std::getenv("XRT_INI_PATH"))); + if (std::filesystem::exists(xrt_path)) return xrt_path.string(); //The env variable should be the full path which includes sdaccel.ini - auto sda_path = boost::filesystem::path(value_or_empty(std::getenv("SDACCEL_INI_PATH"))); - if (boost::filesystem::exists(sda_path)) + auto sda_path = std::filesystem::path(value_or_empty(std::getenv("SDACCEL_INI_PATH"))); + if (std::filesystem::exists(sda_path)) return sda_path.string(); - auto exe_path = boost::filesystem::path(get_self_path()).parent_path(); + auto exe_path = std::filesystem::path(get_self_path()).parent_path(); full_path = verify_ini_path(exe_path); if (!full_path.empty()) return full_path; - auto self_path = boost::filesystem::current_path(); + auto self_path = std::filesystem::current_path(); full_path = verify_ini_path(self_path); if (!full_path.empty()) return full_path; } - catch (const boost::filesystem::filesystem_error&) { + catch (const std::filesystem::filesystem_error&) { } return full_path; } diff --git a/src/runtime_src/core/edge/common_em/CMakeLists.txt b/src/runtime_src/core/edge/common_em/CMakeLists.txt index 085f438f16a..b5dba906b07 100644 --- a/src/runtime_src/core/edge/common_em/CMakeLists.txt +++ b/src/runtime_src/core/edge/common_em/CMakeLists.txt @@ -17,7 +17,6 @@ PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${PROTO_SRC_FILES}) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ) @@ -49,7 +48,6 @@ set_target_properties(common_em PROPERTIES VERSION ${XRT_VERSION_STRING} target_link_libraries(common_em PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} xrt_coreutil diff --git a/src/runtime_src/core/edge/common_em/system_utils.cxx b/src/runtime_src/core/edge/common_em/system_utils.cxx index cb6cef88137..b1829439b16 100755 --- a/src/runtime_src/core/edge/common_em/system_utils.cxx +++ b/src/runtime_src/core/edge/common_em/system_utils.cxx @@ -29,18 +29,18 @@ namespace systemUtil { case CREATE : { operationStr = "CREATE"; - if (boost::filesystem::exists(operand1) == false) + if (std::filesystem::exists(operand1) == false) { - boost::filesystem::create_directories(operand1); + std::filesystem::create_directories(operand1); } break; } case REMOVE : { operationStr = "REMOVE"; - if (boost::filesystem::exists(operand1) ) + if (std::filesystem::exists(operand1) ) { - boost::filesystem::remove_all(operand1); + std::filesystem::remove_all(operand1); } break; } @@ -49,7 +49,7 @@ namespace systemUtil { operationStr = "COPY"; std::stringstream copyCommand; copyCommand <<"cp "<> "< #include #include #include @@ -13,9 +14,6 @@ #include #include -#include -#include - namespace systemUtil { enum systemOperation diff --git a/src/runtime_src/core/edge/hw_emu/CMakeLists.txt b/src/runtime_src/core/edge/hw_emu/CMakeLists.txt index f80da62f063..018f1a76ed2 100644 --- a/src/runtime_src/core/edge/hw_emu/CMakeLists.txt +++ b/src/runtime_src/core/edge/hw_emu/CMakeLists.txt @@ -11,7 +11,6 @@ include_directories( ${EM_SRC_DIR} ${DRM_INCLUDE_DIRS} ${COMMON_EM_SRC_DIR} - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ${CMAKE_BINARY_DIR} # includes version.h ) @@ -84,7 +83,6 @@ if (DEFINED XRT_AIE_BUILD) rt dl uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} xaiengine ) @@ -96,7 +94,6 @@ else() rt dl uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ) endif() diff --git a/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/CMakeLists.txt b/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/CMakeLists.txt index 9db668001c2..88b673cf14d 100644 --- a/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/CMakeLists.txt +++ b/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/CMakeLists.txt @@ -14,7 +14,6 @@ set_target_properties(instance_query PROPERTIES target_link_libraries(instance_query PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ) install (TARGETS instance_query diff --git a/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/instance_query.cpp b/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/instance_query.cpp index 407f48654db..2af583c96ec 100644 --- a/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/instance_query.cpp +++ b/src/runtime_src/core/edge/ps_kernels/xrt/instance_query/instance_query.cpp @@ -3,6 +3,7 @@ #include "xrt/xrt_kernel.h" #include +#include #include #include #include @@ -14,7 +15,6 @@ #include #include -#include #include #include #include @@ -242,14 +242,14 @@ get_ps_kernel_data( char *output, openlog("new_kernel_source", LOG_PID | LOG_CONS | LOG_NDELAY, LOG_NEWS); log_info("Stared new kernel\n", enable_debug); - boost::filesystem::path p("/sys/devices/platform/ert_hw/"); - boost::filesystem::directory_iterator dir(p); + std::filesystem::path p("/sys/devices/platform/ert_hw/"); + std::filesystem::directory_iterator dir(p); pt::ptree all_data; add_schema(all_data); get_os_release(all_data); pt::ptree all_ps_data; - while (dir != boost::filesystem::directory_iterator()) { + while (dir != std::filesystem::directory_iterator()) { // Get a copy of the current directories name. // Getting a reference cause a undesired change when the // the directory updates diff --git a/src/runtime_src/core/edge/skd/CMakeLists.txt b/src/runtime_src/core/edge/skd/CMakeLists.txt index 500be9c0a0d..11d5e459ecc 100644 --- a/src/runtime_src/core/edge/skd/CMakeLists.txt +++ b/src/runtime_src/core/edge/skd/CMakeLists.txt @@ -6,7 +6,6 @@ pkg_check_modules(LIBFFI REQUIRED libffi) find_package(libffi REQUIRED) include_directories( - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../include @@ -32,7 +31,6 @@ add_dependencies(skd target_link_libraries(skd PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} xrt_core xrt_coreutil diff --git a/src/runtime_src/core/edge/skd/xrt_skd.cpp b/src/runtime_src/core/edge/skd/xrt_skd.cpp index 9d4da2b5108..831af4c900c 100644 --- a/src/runtime_src/core/edge/skd/xrt_skd.cpp +++ b/src/runtime_src/core/edge/skd/xrt_skd.cpp @@ -359,13 +359,13 @@ namespace xrt { return -EINVAL; } - const boost::filesystem::path path(SOFT_KERNEL_FILE_PATH); + const std::filesystem::path path(SOFT_KERNEL_FILE_PATH); xrt_core::message::send(severity_level::debug, "SKD", path.string()); - boost::filesystem::create_directories(path); + std::filesystem::create_directories(path); // Check if file already exists and is the same size - if(boost::filesystem::exists(m_sk_path) && (boost::filesystem::file_size(m_sk_path) == prop.size)) { + if(std::filesystem::exists(m_sk_path) && (std::filesystem::file_size(m_sk_path) == prop.size)) { return 0; } @@ -408,7 +408,7 @@ namespace xrt { */ int skd::delete_softkernelfile() const { - return boost::filesystem::remove(m_sk_path); + return std::filesystem::remove(m_sk_path); } // Convert argument to ffi_type diff --git a/src/runtime_src/core/edge/skd/xrt_skd.h b/src/runtime_src/core/edge/skd/xrt_skd.h index 7a0c11c5263..4f84fa7895e 100644 --- a/src/runtime_src/core/edge/skd/xrt_skd.h +++ b/src/runtime_src/core/edge/skd/xrt_skd.h @@ -18,13 +18,13 @@ #ifndef _XRT_SKD_H_ #define _XRT_SKD_H_ -#include #include #include #include #include #include #include +#include #include #include #include @@ -115,7 +115,7 @@ class skd xrtDeviceHandle m_xrtdhdl = 0; uuid m_xclbin_uuid; // Path of PS kernel object file constructed from PS kernel path and PS kernel name - const boost::filesystem::path m_sk_path; + const std::filesystem::path m_sk_path; // PS Kernel instance name std::string m_sk_name = ""; // PS Kernel CU Index assigned from host diff --git a/src/runtime_src/core/edge/sw_emu/CMakeLists.txt b/src/runtime_src/core/edge/sw_emu/CMakeLists.txt index b4c13f5c729..6614ea1faae 100644 --- a/src/runtime_src/core/edge/sw_emu/CMakeLists.txt +++ b/src/runtime_src/core/edge/sw_emu/CMakeLists.txt @@ -15,7 +15,6 @@ include_directories( ${COMMON_SRC_DIR} ${COMMON_EM_SRC_DIR} ${COMMON_EM_GEN_DIR} - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ) @@ -49,7 +48,6 @@ set_target_properties(xrt_swemu PROPERTIES VERSION ${XRT_VERSION_STRING} target_link_libraries(xrt_swemu PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} xrt_coreutil diff --git a/src/runtime_src/core/edge/sw_emu/generic_pcie_hal2/shim.cxx b/src/runtime_src/core/edge/sw_emu/generic_pcie_hal2/shim.cxx index 8421edd75b7..98e9150eb55 100755 --- a/src/runtime_src/core/edge/sw_emu/generic_pcie_hal2/shim.cxx +++ b/src/runtime_src/core/edge/sw_emu/generic_pcie_hal2/shim.cxx @@ -530,7 +530,7 @@ namespace xclswemuhal2 { std::string modelDirectory(""); - if (boost::filesystem::exists(xilinxInstall + "/data/emulation/unified/sw_emu/generic_pcie/model/genericpciemodel")) + if (std::filesystem::exists(xilinxInstall + "/data/emulation/unified/sw_emu/generic_pcie/model/genericpciemodel")) modelDirectory = xilinxInstall + "/data/emulation/unified/sw_emu/generic_pcie/model/genericpciemodel"; else modelDirectory = xilinxInstall + "/data/emulation/unified/cpu_em/generic_pcie/model/genericpciemodel"; diff --git a/src/runtime_src/core/edge/user/CMakeLists.txt b/src/runtime_src/core/edge/user/CMakeLists.txt index c3fb74a3f50..fd07519a1d3 100644 --- a/src/runtime_src/core/edge/user/CMakeLists.txt +++ b/src/runtime_src/core/edge/user/CMakeLists.txt @@ -73,7 +73,6 @@ if (DEFINED XRT_AIE_BUILD) rt dl uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} xaiengine ) @@ -85,7 +84,6 @@ else() rt dl uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ) diff --git a/src/runtime_src/core/edge/user/aie_sys_parser.cpp b/src/runtime_src/core/edge/user/aie_sys_parser.cpp index 493a529d34b..46deeb8b09b 100644 --- a/src/runtime_src/core/edge/user/aie_sys_parser.cpp +++ b/src/runtime_src/core/edge/user/aie_sys_parser.cpp @@ -16,9 +16,10 @@ #include "aie_sys_parser.h" #include -#include #include +#include + std::fstream aie_sys_parser::sysfs_open_path(const std::string& path, bool write, bool binary) { diff --git a/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.cpp b/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.cpp index 05a13fa22d4..b1894f5f0a6 100644 --- a/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.cpp +++ b/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.cpp @@ -22,7 +22,7 @@ #include "core/include/xdp/hal_api.h" -namespace bfs = boost::filesystem; +namespace sfs = std::filesystem; namespace xdphalinterface { diff --git a/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.h b/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.h index 27f6db7196c..6d2563e6053 100644 --- a/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.h +++ b/src/runtime_src/core/edge/user/plugin/xdp/hal_api_interface.h @@ -18,8 +18,7 @@ #define XDP_PROFILE_HAL_INTERFACE_PLUGIN_H_ #include -#include -#include +#include #include #include #include diff --git a/src/runtime_src/core/edge/user/shim.cpp b/src/runtime_src/core/edge/user/shim.cpp index 8be83f51e09..c80f69f0f2a 100644 --- a/src/runtime_src/core/edge/user/shim.cpp +++ b/src/runtime_src/core/edge/user/shim.cpp @@ -28,12 +28,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include @@ -549,9 +549,9 @@ libdfxHelper(std::shared_ptr core_dev, std::string& dtbo_path, } else { // bitstream is loaded for first time - boost::filesystem::directory_iterator end_itr; + std::filesystem::directory_iterator end_itr; static const std::regex filter{".*_image_[0-9]+"}; - for (boost::filesystem::directory_iterator itr( dtbo_dir_path ); itr != end_itr; ++itr) { + for (std::filesystem::directory_iterator itr( dtbo_dir_path ); itr != end_itr; ++itr) { if (!std::regex_match(itr->path().filename().string(), filter)) continue; @@ -600,8 +600,8 @@ static void libdfxClean(const std::string& file_path) { try { - if (boost::filesystem::exists(boost::filesystem::path(file_path))) - boost::filesystem::remove_all(boost::filesystem::path(file_path)); + if (std::filesystem::exists(std::filesystem::path(file_path))) + std::filesystem::remove_all(std::filesystem::path(file_path)); } catch(std::exception& ex) { xclLog(XRT_WARNING, "%s: unable to remove '%s' folder",__func__,file_path); @@ -649,7 +649,7 @@ libdfxLoadAxlf(std::shared_ptr core_dev, const axlf *top, } // save dtbo_path as load is successful - dtbo_path = boost::filesystem::path(xclbin_dir_path).filename().string() + dtbo_path = std::filesystem::path(xclbin_dir_path).filename().string() + "_image_" + std::to_string(dtbo_id); // clean tmp files of libdfx @@ -663,7 +663,7 @@ libdfxLoadAxlf(std::shared_ptr core_dev, const axlf *top, std::string zocl_drm_device; while (count++ < timeout_sec) { zocl_drm_device = render_dev_dir + get_render_devname(); - if (boost::filesystem::exists(boost::filesystem::path(zocl_drm_device))) + if (std::filesystem::exists(std::filesystem::path(zocl_drm_device))) break; std::this_thread::sleep_for(std::chrono::seconds(1)); } @@ -1918,7 +1918,7 @@ xclProbe() const std::string zocl_drm_device = "/dev/dri/" + get_render_devname(); int fd; - if (boost::filesystem::exists(zocl_drm_device)) { + if (std::filesystem::exists(zocl_drm_device)) { fd = open(zocl_drm_device.c_str(), O_RDWR); if (fd < 0) return 0; diff --git a/src/runtime_src/core/edge/user/zynq_dev.cpp b/src/runtime_src/core/edge/user/zynq_dev.cpp index 141677d46ea..6874a72736d 100644 --- a/src/runtime_src/core/edge/user/zynq_dev.cpp +++ b/src/runtime_src/core/edge/user/zynq_dev.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include "zynq_dev.h" @@ -165,13 +165,13 @@ get_render_devname() try { static const std::regex filter{"platform.*zyxclmm_drm-render"}; - boost::filesystem::directory_iterator end_itr; - for (boost::filesystem::directory_iterator itr( render_dev_sym_dir ); itr != end_itr; ++itr) { + std::filesystem::directory_iterator end_itr; + for (std::filesystem::directory_iterator itr( render_dev_sym_dir ); itr != end_itr; ++itr) { if (!std::regex_match(itr->path().filename().string(), filter)) continue; - if (boost::filesystem::is_symlink(itr->path())) - render_devname = boost::filesystem::read_symlink(itr->path()).filename().string(); + if (std::filesystem::is_symlink(itr->path())) + render_devname = std::filesystem::read_symlink(itr->path()).filename().string(); break; } diff --git a/src/runtime_src/core/pcie/emulation/common_em/CMakeLists.txt b/src/runtime_src/core/pcie/emulation/common_em/CMakeLists.txt index ce8b021a5d8..e208b89a060 100644 --- a/src/runtime_src/core/pcie/emulation/common_em/CMakeLists.txt +++ b/src/runtime_src/core/pcie/emulation/common_em/CMakeLists.txt @@ -17,7 +17,6 @@ PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${PROTO_SRC_FILES}) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ) @@ -42,7 +41,6 @@ set_target_properties(common_em PROPERTIES VERSION ${XRT_VERSION_STRING} target_link_libraries(common_em PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} xrt_coreutil diff --git a/src/runtime_src/core/pcie/emulation/common_em/config.cxx b/src/runtime_src/core/pcie/emulation/common_em/config.cxx index 4183e323ef8..f750d54d871 100755 --- a/src/runtime_src/core/pcie/emulation/common_em/config.cxx +++ b/src/runtime_src/core/pcie/emulation/common_em/config.cxx @@ -102,16 +102,16 @@ namespace xclemulation{ return defaultValue; } - static boost::filesystem::path get_file_absolutepath(const std::string& filename) { + static std::filesystem::path get_file_absolutepath(const std::string& filename) { - boost::filesystem::path exe_parent_path {getExecutablePath()}; + std::filesystem::path exe_parent_path {getExecutablePath()}; auto filepath = exe_parent_path / filename; - if (boost::filesystem::exists(filepath) == false) { - auto current_path = boost::filesystem::current_path(); + if (std::filesystem::exists(filepath) == false) { + auto current_path = std::filesystem::current_path(); filepath = current_path / filename; - if (boost::filesystem::exists(filepath) == false) - return boost::filesystem::path{}; + if (std::filesystem::exists(filepath) == false) + return std::filesystem::path{}; } return filepath; @@ -400,7 +400,7 @@ namespace xclemulation{ return pathStr; } - return boost::filesystem::absolute(pathStr.c_str(), absBuildDirStr.c_str()).string(); + return std::filesystem::absolute(pathStr.c_str()).string(); } std::string getExecutablePath() @@ -423,10 +423,10 @@ namespace xclemulation{ { auto filename{"emconfig.json"}; auto filepath = get_file_absolutepath(filename); - boost::filesystem::path emconfig_env {valueOrEmpty(std::getenv("EMCONFIG_PATH"))}; + std::filesystem::path emconfig_env {valueOrEmpty(std::getenv("EMCONFIG_PATH"))}; if (emconfig_env.empty() == false) { auto filepath_env_value = emconfig_env / "emconfig.json"; - if (boost::filesystem::exists(filepath_env_value)) { + if (std::filesystem::exists(filepath_env_value)) { filepath = filepath_env_value; } } @@ -461,7 +461,7 @@ namespace xclemulation{ std::string getEmDebugLogFile() { - auto self_path = boost::filesystem::current_path(); + auto self_path = std::filesystem::current_path(); auto em_debug_file_path = self_path / "emulation_debug.log"; return em_debug_file_path.string(); } diff --git a/src/runtime_src/core/pcie/emulation/common_em/config.h b/src/runtime_src/core/pcie/emulation/common_em/config.h index 4ca0fc832af..584601fe0fb 100644 --- a/src/runtime_src/core/pcie/emulation/common_em/config.h +++ b/src/runtime_src/core/pcie/emulation/common_em/config.h @@ -13,8 +13,6 @@ #endif #include #include -#include -#include "boost/filesystem/path.hpp" #include #include #include @@ -22,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -172,7 +171,7 @@ struct sParseLog // mFileName might be created/updated by xsim, check its existence always. if (not mFileExists.load()) { - if (boost::filesystem::exists(mFileName)) + if (std::filesystem::exists(mFileName)) { mFileStream.open(mFileName); if (mFileStream.is_open()) diff --git a/src/runtime_src/core/pcie/emulation/common_em/system_utils.cxx b/src/runtime_src/core/pcie/emulation/common_em/system_utils.cxx index d3aeea32ec3..cb076f4d999 100755 --- a/src/runtime_src/core/pcie/emulation/common_em/system_utils.cxx +++ b/src/runtime_src/core/pcie/emulation/common_em/system_utils.cxx @@ -29,18 +29,18 @@ namespace systemUtil { case CREATE : { operationStr = "CREATE"; - if (boost::filesystem::exists(operand1) == false) + if (std::filesystem::exists(operand1) == false) { - boost::filesystem::create_directories(operand1); + std::filesystem::create_directories(operand1); } break; } case REMOVE : { operationStr = "REMOVE"; - if (boost::filesystem::exists(operand1) ) + if (std::filesystem::exists(operand1) ) { - boost::filesystem::remove_all(operand1); + std::filesystem::remove_all(operand1); } break; } @@ -49,7 +49,7 @@ namespace systemUtil { operationStr = "COPY"; std::stringstream copyCommand; copyCommand <<"cp "<> "< #include #include #include @@ -13,8 +14,7 @@ #include #include -#include -#include + namespace systemUtil { diff --git a/src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt b/src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt index b03a71431e5..5bf04bbd6c3 100644 --- a/src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt +++ b/src/runtime_src/core/pcie/emulation/hw_emu/CMakeLists.txt @@ -11,7 +11,6 @@ include_directories( ${EM_SRC_DIR} ${COMMON_EM_SRC_DIR} ${COMMON_EM_GEN_DIR} - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ) @@ -46,7 +45,6 @@ set_target_properties(xrt_hwemu PROPERTIES VERSION ${XRT_VERSION_STRING} target_link_libraries(xrt_hwemu PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} xrt_coreutil @@ -57,7 +55,6 @@ target_link_libraries(xrt_hwemu target_link_libraries(xrt_hwemu_static INTERFACE - boost_filesystem boost_system ${PROTOBUF_LIBRARY} xrt_coreutil_static diff --git a/src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim/shim.cxx b/src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim/shim.cxx index 21f0eb5ef87..ffbfd63cf13 100644 --- a/src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim/shim.cxx +++ b/src/runtime_src/core/pcie/emulation/hw_emu/alveo_shim/shim.cxx @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -67,7 +68,7 @@ namespace xclhwemhal2 { }; namespace pt = boost::property_tree; - namespace fs = boost::filesystem; + namespace bfs = std::filesystem; std::map devices; std::map HwEmShim::mEnvironmentNameValueMap(xclemulation::getEnvironmentByReadingIni()); @@ -265,7 +266,7 @@ namespace xclhwemhal2 { if (pPath) { std::string deadlockReportFile = simPath + "/kernel_deadlock_diagnosis.rpt"; - if (boost::filesystem::exists(deadlockReportFile)) + if (std::filesystem::exists(deadlockReportFile)) { std::string destPath = std::string(path) + "/pl_deadlock_diagnosis.txt"; systemUtil::makeSystemCall(deadlockReportFile, systemUtil::systemOperation::COPY, destPath, std::to_string(__LINE__)); @@ -729,7 +730,7 @@ namespace xclhwemhal2 { sim_path = binaryDirectory + "/behav_waveform/" + simulatorType; setSimPath(sim_path); - if (boost::filesystem::exists(sim_path) != false) { + if (std::filesystem::exists(sim_path) != false) { waveformDebugfilePath = sim_path + "/waveform_debug_enable.txt"; if (simulatorType == "xsim") { cmdLineOption << " -g --wdb " << wdbFileName << ".wdb" @@ -743,7 +744,7 @@ namespace xclhwemhal2 { std::string generatedWcfgFileName = sim_path + "/" + bdName + "_behav.wcfg"; unsetenv("VITIS_LAUNCH_WAVEFORM_BATCH"); - if (waveformDebugfilePath != "" && boost::filesystem::exists(waveformDebugfilePath) != false) { + if (waveformDebugfilePath != "" && std::filesystem::exists(waveformDebugfilePath) != false) { setenv("VITIS_WAVEFORM", generatedWcfgFileName.c_str(), true); setenv("VITIS_WAVEFORM_WDB_FILENAME", std::string(wdbFileName + ".wdb").c_str(), true); } else { @@ -784,7 +785,7 @@ namespace xclhwemhal2 { std::string generatedWcfgFileName = sim_path + "/" + bdName + "_behav.wcfg"; setenv("VITIS_LAUNCH_WAVEFORM_BATCH", "1", true); - if (boost::filesystem::exists(waveformDebugfilePath) != false) { + if (std::filesystem::exists(waveformDebugfilePath) != false) { setenv("VITIS_WAVEFORM", generatedWcfgFileName.c_str(), true); setenv("VITIS_WAVEFORM_WDB_FILENAME", std::string(wdbFileName + ".wdb").c_str(), true); } else { @@ -829,7 +830,7 @@ namespace xclhwemhal2 { } // As gdb feature is unsupported for 2021.1, we removed this cross check. We will re-enable it once we have 2 possibilities - /*if (boost::filesystem::exists(sim_path) == false) + /*if (std::filesystem::exists(sim_path) == false) { if (lWaveform == xclemulation::debug_mode::gdb) { sim_path = binaryDirectory + "/behav_waveform/" + simulatorType; @@ -847,7 +848,7 @@ namespace xclhwemhal2 { launcherArgs = launcherArgs + cmdLineOption.str(); std::string generatedWcfgFileName = sim_path + "/" + bdName + "_behav.wcfg"; setenv("VITIS_LAUNCH_WAVEFORM_BATCH", "1", true); - if (boost::filesystem::exists(waveformDebugfilePath) != false) { + if (std::filesystem::exists(waveformDebugfilePath) != false) { setenv("VITIS_WAVEFORM", generatedWcfgFileName.c_str(), true); setenv("VITIS_WAVEFORM_WDB_FILENAME", std::string(wdbFileName + ".wdb").c_str(), true); } @@ -906,7 +907,7 @@ namespace xclhwemhal2 { } //launch simulation - if (boost::filesystem::exists(sim_path) == true) { + if (std::filesystem::exists(sim_path) == true) { #ifndef _WINDOWS // TODO: Windows build support // pid_t, fork, chdir, execl is defined in unistd.h @@ -971,12 +972,12 @@ namespace xclhwemhal2 { //Assuming that we will have only one AIE Kernel, need to //update this logic when we have suport for multiple AIE Kernels - if (fs::exists(sim_path + "/emulation_data/libsdf/cfg/aie.sim.config.txt")) + if (bfs::exists(sim_path + "/emulation_data/libsdf/cfg/aie.sim.config.txt")) { launcherArgs += " -emuData " + sim_path + "/emulation_data/libsdf/cfg/aie.sim.config.txt"; launcherArgs += " -aie-sim-config " + sim_path + "/emulation_data/libsdf/cfg/aie.sim.config.txt"; } - else if (fs::exists(sim_path + "/emulation_data/libadf/cfg/aie.sim.config.txt")) { + else if (bfs::exists(sim_path + "/emulation_data/libadf/cfg/aie.sim.config.txt")) { launcherArgs += " -emuData " + sim_path + "/emulation_data/libadf/cfg/aie.sim.config.txt"; launcherArgs += " -aie-sim-config " + sim_path + "/emulation_data/libadf/cfg/aie.sim.config.txt"; } else { @@ -984,36 +985,36 @@ namespace xclhwemhal2 { launcherArgs += " -aie-sim-config " + sim_path + "/emulation_data/cfg/aie.sim.config.txt"; } - if (fs::exists(sim_path + "/emulation_data/BOOT_bh.bin")) { + if (bfs::exists(sim_path + "/emulation_data/BOOT_bh.bin")) { launcherArgs += " -boot-bh " + sim_path + "/emulation_data/BOOT_bh.bin"; } - if (fs::exists(sim_path + "/emulation_data/qemu_ospi.bin")) { + if (bfs::exists(sim_path + "/emulation_data/qemu_ospi.bin")) { launcherArgs += " -ospi-image " + sim_path + "/emulation_data/qemu_ospi.bin"; } - if (fs::exists(sim_path + "/emulation_data/qemu_qspi_low.bin")) { + if (bfs::exists(sim_path + "/emulation_data/qemu_qspi_low.bin")) { launcherArgs += " -qspi-low-image " + sim_path + "/emulation_data/qemu_qspi_low.bin"; } - if (fs::exists(sim_path + "/emulation_data/qemu_qspi_high.bin")) { + if (bfs::exists(sim_path + "/emulation_data/qemu_qspi_high.bin")) { launcherArgs += " -qspi-high-image " + sim_path + "/emulation_data/qemu_qspi_high.bin"; } // V70 support: Setting this option, launch_emulator does not set the NOCSIM_DRAM_FILE file, it auto sets the // NOCSIM_MULTI_DRAM_FILE - if (fs::exists(sim_path + "/emulation_data/noc_memory_config.txt")) { + if (bfs::exists(sim_path + "/emulation_data/noc_memory_config.txt")) { launcherArgs += " -noc-memory-config " + sim_path + "/emulation_data/noc_memory_config.txt"; } - if (fs::exists(sim_path + "/emulation_data/qemu_args.txt")) { + if (bfs::exists(sim_path + "/emulation_data/qemu_args.txt")) { launcherArgs += " -qemu-args-file " + sim_path + "/emulation_data/qemu_args.txt"; } - if (fs::exists(sim_path + "/emulation_data/pmc_args.txt")) { + if (bfs::exists(sim_path + "/emulation_data/pmc_args.txt")) { launcherArgs += " -pmc-args-file " + sim_path + "/emulation_data/pmc_args.txt"; } - else if (fs::exists(sim_path + "/emulation_data/pmu_args.txt")) { + else if (bfs::exists(sim_path + "/emulation_data/pmu_args.txt")) { launcherArgs += " -pmc-args-file " + sim_path + "/emulation_data/pmu_args.txt"; } else { @@ -1057,7 +1058,7 @@ namespace xclhwemhal2 { simMode = launcherArgs.c_str(); //if (!xclemulation::file_exists(sim_file)) - if (!boost::filesystem::exists(sim_file)) + if (!std::filesystem::exists(sim_file)) sim_file = "simulate.sh"; if (mLogStream.is_open() ) @@ -1141,7 +1142,7 @@ namespace xclhwemhal2 { bool HwEmShim::readEmuSettingsJsonFile(const std::string& emuSettingsFilePath) { - if (emuSettingsFilePath.empty() || !boost::filesystem::exists(emuSettingsFilePath)) { + if (emuSettingsFilePath.empty() || !std::filesystem::exists(emuSettingsFilePath)) { return false; } @@ -1196,7 +1197,7 @@ namespace xclhwemhal2 { if (xclemulation::config::getInstance()->isFastNocDDRAccessEnabled()) { std::string nocMemSpecFilePath = simPath + "/emulation_data/noc_memory_config.txt"; - if (fs::exists(nocMemSpecFilePath)) + if (bfs::exists(nocMemSpecFilePath)) this->mNocFastAccess.init(nocMemSpecFilePath, simPath); } } @@ -1225,10 +1226,10 @@ namespace xclhwemhal2 { void HwEmShim::getDtbs(const std::string& emu_data_path, std::string& qemu_dtb, std::string& pmc_dtb) { - boost::filesystem::path dts_dir = emu_data_path; - boost::filesystem::directory_iterator end_itr; + std::filesystem::path dts_dir = emu_data_path; + std::filesystem::directory_iterator end_itr; - for (boost::filesystem::directory_iterator itr(dts_dir); itr != end_itr; ++itr) + for (std::filesystem::directory_iterator itr(dts_dir); itr != end_itr; ++itr) { std::string current_file = itr->path().string(); std::string file_str = itr->path().filename().string(); @@ -1760,7 +1761,7 @@ namespace xclhwemhal2 { // Copy waveform database if (lWaveform != xclemulation::debug_mode::off) { std::string extension = "wdb"; - if (boost::filesystem::exists(binaryDirectory+"/msim")) { + if (std::filesystem::exists(binaryDirectory+"/msim")) { extension = "wlf"; } std::string wdbFileName = binaryDirectory + "/" + fileName + "."+extension; @@ -2156,22 +2157,22 @@ namespace xclhwemhal2 { std::string sim_path4 = binaryDirectory + "/behav_waveform/xcelium"; std::string sim_path5 = binaryDirectory + "/behav_waveform/vcs"; - if (boost::filesystem::exists(sim_path1) || boost::filesystem::exists(sim_path2)) { + if (std::filesystem::exists(sim_path1) || std::filesystem::exists(sim_path2)) { simulator = "xsim"; } - else if (boost::filesystem::exists(sim_path3)) { + else if (std::filesystem::exists(sim_path3)) { simulator = "questa"; } - else if (boost::filesystem::exists(sim_path4)) { + else if (std::filesystem::exists(sim_path4)) { simulator = "xcelium"; } - else if (boost::filesystem::exists(sim_path5)) { + else if (std::filesystem::exists(sim_path5)) { simulator = "vcs"; } - if (!boost::filesystem::exists(sim_path1) && !boost::filesystem::exists(sim_path2) - && !boost::filesystem::exists(sim_path3) && !boost::filesystem::exists(sim_path4) - && !boost::filesystem::exists(sim_path5)) { + if (!std::filesystem::exists(sim_path1) && !std::filesystem::exists(sim_path2) + && !std::filesystem::exists(sim_path3) && !std::filesystem::exists(sim_path4) + && !std::filesystem::exists(sim_path5)) { std::string dMsg = "ERROR: [HW-EMU 11] UNZIP operation failed. Not to able to get the required simulation binaries from xclbin"; logMessage(dMsg, 0); diff --git a/src/runtime_src/core/pcie/emulation/sw_emu/CMakeLists.txt b/src/runtime_src/core/pcie/emulation/sw_emu/CMakeLists.txt index 30c86cbb8ab..247b50602c1 100644 --- a/src/runtime_src/core/pcie/emulation/sw_emu/CMakeLists.txt +++ b/src/runtime_src/core/pcie/emulation/sw_emu/CMakeLists.txt @@ -10,7 +10,6 @@ include_directories( ${EM_SRC_DIR} ${COMMON_EM_SRC_DIR} ${COMMON_EM_GEN_DIR} - ${BOOST_FILESYSTEM_INCLUDE_DIRS} ${BOOST_SYSTEM_INCLUDE_DIRS} ) @@ -42,7 +41,6 @@ set_target_properties(xrt_swemu PROPERTIES VERSION ${XRT_VERSION_STRING} target_link_libraries(xrt_swemu PRIVATE - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} xrt_coreutil @@ -53,7 +51,6 @@ target_link_libraries(xrt_swemu target_link_libraries(xrt_swemu_static INTERFACE - boost_filesystem boost_system ${PROTOBUF_LIBRARY} xrt_coreutil_static diff --git a/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.cxx b/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.cxx index 1c4dccf22b4..9b62feaf020 100644 --- a/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.cxx +++ b/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.cxx @@ -33,7 +33,7 @@ namespace xclswemuhal2 std::map SwEmuShim::mEnvironmentNameValueMap(xclemulation::getEnvironmentByReadingIni()); - namespace bf = boost::filesystem; + namespace sf = std::filesystem; #define PRINTENDFUNC \ if (mLogStream.is_open()) \ mLogStream << __func__ << " ended " << std::endl; @@ -433,7 +433,7 @@ namespace xclswemuhal2 std::string modelDirectory(""); - if (boost::filesystem::exists(xilinxInstall + "/data/emulation/unified/sw_emu/generic_pcie/model/genericpciemodel")) + if (std::filesystem::exists(xilinxInstall + "/data/emulation/unified/sw_emu/generic_pcie/model/genericpciemodel")) modelDirectory = xilinxInstall + "/data/emulation/unified/sw_emu/generic_pcie/model/genericpciemodel"; else modelDirectory = xilinxInstall + "/data/emulation/unified/cpu_em/generic_pcie/model/genericpciemodel"; @@ -564,8 +564,8 @@ namespace xclswemuhal2 //Check if device_process.log already exists. Remove if exists. auto extIoTxtFile = getDeviceProcessLogPath(); - if (boost::filesystem::exists(extIoTxtFile)) - boost::filesystem::remove(extIoTxtFile); + if (std::filesystem::exists(extIoTxtFile)) + std::filesystem::remove(extIoTxtFile); if (launchDeviceProcess(debuggable, binaryDirectory) == false) return -1; @@ -774,11 +774,11 @@ namespace xclswemuhal2 if (isVersal) { std::string aieLibSimPath = binaryDirectory + "/aie/aie.libsim"; - bf::path fp(aieLibSimPath); + sf::path fp(aieLibSimPath); // Setting the aiesim_sock to null when we have the aie.libsim which is ideally generated only for the x86sim target // This determines the whether we are running the sw_emu interacting with the x86sim process or the aiesim process - if (bf::exists(fp) && !bf::is_empty(fp)) + if (sf::exists(fp) && !sf::is_empty(fp)) aiesim_sock = nullptr; else aiesim_sock = new unix_socket("AIESIM_SOCKETID"); diff --git a/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.h b/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.h index ff893d8edbf..aee840d4827 100644 --- a/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.h +++ b/src/runtime_src/core/pcie/emulation/sw_emu/generic_pcie_hal2/shim.h @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -820,7 +821,7 @@ namespace xclswemuhal2 { if (!mFileExists) { - if (boost::filesystem::exists(mFileName)) + if (std::filesystem::exists(mFileName)) { file.open(mFileName,std::ios::in); if (file.is_open()) diff --git a/src/runtime_src/core/pcie/linux/CMakeLists.txt b/src/runtime_src/core/pcie/linux/CMakeLists.txt index b3cac2ebba1..b98e457d9c1 100644 --- a/src/runtime_src/core/pcie/linux/CMakeLists.txt +++ b/src/runtime_src/core/pcie/linux/CMakeLists.txt @@ -47,7 +47,6 @@ set_target_properties(xrt_core PROPERTIES target_link_libraries(xrt_core PRIVATE xrt_coreutil - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} pthread rt @@ -63,7 +62,6 @@ target_link_libraries(xrt_core target_link_libraries(xrt_core_static INTERFACE xrt_coreutil_static - boost_filesystem boost_system uuid dl diff --git a/src/runtime_src/core/pcie/linux/device_linux.cpp b/src/runtime_src/core/pcie/linux/device_linux.cpp index c31d9d1d485..096c3596427 100644 --- a/src/runtime_src/core/pcie/linux/device_linux.cpp +++ b/src/runtime_src/core/pcie/linux/device_linux.cpp @@ -19,6 +19,7 @@ #include "xrt.h" #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include -#include #include #include @@ -46,12 +46,12 @@ get_render_value(const std::string& dir) static const std::string render_name = "renderD"; int instance_num = INVALID_ID; // argh, what is this? - boost::filesystem::path render_dirs(dir); - if (!boost::filesystem::is_directory(render_dirs)) + std::filesystem::path render_dirs(dir); + if (!std::filesystem::is_directory(render_dirs)) return instance_num; - boost::filesystem::recursive_directory_iterator end_iter; - for(boost::filesystem::recursive_directory_iterator iter(render_dirs); iter != end_iter; ++iter) { + std::filesystem::recursive_directory_iterator end_iter; + for(std::filesystem::recursive_directory_iterator iter(render_dirs); iter != end_iter; ++iter) { auto path = iter->path().filename().string(); if (!path.compare(0, render_name.size(), render_name)) { auto sub = path.substr(render_name.size()); @@ -312,15 +312,15 @@ struct sdm_sensor_info * hwmon sysfs directory has a sysfs node called "name", and it is decision factor. * So, the target hwmon sysfs dir is the one whose name contains target_name. */ - boost::filesystem::path render_dirs(parent_path); - if (!boost::filesystem::is_directory(render_dirs)) + std::filesystem::path render_dirs(parent_path); + if (!std::filesystem::is_directory(render_dirs)) return result_type(); //iterate over list of hwmon syfs directory's directories - boost::filesystem::directory_iterator iter(render_dirs); - while (iter != boost::filesystem::directory_iterator{}) + std::filesystem::directory_iterator iter(render_dirs); + while (iter != std::filesystem::directory_iterator{}) { - if (!boost::filesystem::is_directory(iter->path())) + if (!std::filesystem::is_directory(iter->path())) { ++iter; continue; diff --git a/src/runtime_src/core/pcie/linux/pcidev.cpp b/src/runtime_src/core/pcie/linux/pcidev.cpp index f61c6eba352..058408627bc 100644 --- a/src/runtime_src/core/pcie/linux/pcidev.cpp +++ b/src/runtime_src/core/pcie/linux/pcidev.cpp @@ -7,13 +7,11 @@ #include "core/common/utils.h" -#include -#include - #include #include #include #include +#include #include #include #include @@ -30,7 +28,7 @@ namespace { -namespace bfs = boost::filesystem; +namespace sfs = std::filesystem; static std::string get_name(const std::string& dir, const std::string& subdir) @@ -699,19 +697,19 @@ int get_runtime_active_kids(std::string &pci_bridge_path) { int curr_act_dev = 0; - std::vector vec{bfs::directory_iterator(pci_bridge_path), bfs::directory_iterator()}; + std::vector vec{sfs::directory_iterator(pci_bridge_path), sfs::directory_iterator()}; // Check number of Xilinx devices under this bridge. for (auto& path : vec) { - if (!bfs::is_directory(path)) + if (!sfs::is_directory(path)) continue; path += "/vendor"; - if(!bfs::exists(path)) + if(!sfs::exists(path)) continue; unsigned int vendor_id; - bfs::ifstream file(path); + std::ifstream file(path); file >> std::hex >> vendor_id; if (vendor_id != XILINX_ID) continue; @@ -781,7 +779,7 @@ shutdown(dev *mgmt_dev, bool remove_user, bool remove_mgmt) /* Cache the parent sysfs path before remove the PF */ std::string parent_path = mgmt_dev->get_sysfs_path("", "dparent"); /* Get the absolute path from the symbolic link */ - parent_path = (bfs::canonical(parent_path)).c_str(); + parent_path = (sfs::canonical(parent_path)).c_str(); int active_dev_num; mgmt_dev->sysfs_get("", "dparent/power/runtime_active_kids", errmsg, active_dev_num, EINVAL); @@ -816,12 +814,12 @@ shutdown(dev *mgmt_dev, bool remove_user, bool remove_mgmt) for (int wait = 0; wait < DEV_TIMEOUT; wait++) { int curr_act_dev; std::string active_kids_path = parent_path + "/power/runtime_active_kids"; - if (!bfs::exists(active_kids_path)) { + if (!sfs::exists(active_kids_path)) { // RHEL 8.x specific curr_act_dev = get_runtime_active_kids(parent_path); } else { - bfs::ifstream file(active_kids_path); + std::ifstream file(active_kids_path); file >> curr_act_dev; } diff --git a/src/runtime_src/core/pcie/linux/pcidrv.cpp b/src/runtime_src/core/pcie/linux/pcidrv.cpp index 7acbd8b011a..08775894aa0 100644 --- a/src/runtime_src/core/pcie/linux/pcidrv.cpp +++ b/src/runtime_src/core/pcie/linux/pcidrv.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved. #include "pcidrv.h" -#include +#include namespace xrt_core { namespace pci { @@ -11,15 +11,15 @@ drv:: scan_devices(std::vector>& ready_list, std::vector>& nonready_list) const { - namespace bfs = boost::filesystem; + namespace sfs = std::filesystem; const std::string drv_root = "/sys/bus/pci/drivers/"; const std::string drvpath = drv_root + name(); - if (!bfs::exists(drvpath)) + if (!sfs::exists(drvpath)) return; // Gather all sysfs directory and sort - std::vector vec{ bfs::directory_iterator(drvpath), bfs::directory_iterator() }; + std::vector vec{ sfs::directory_iterator(drvpath), sfs::directory_iterator() }; std::sort(vec.begin(), vec.end()); for (auto& path : vec) { @@ -28,7 +28,7 @@ scan_devices(std::vector>& ready_list, // In docker, all host sysfs nodes are available. So, we need to check // devnode to make sure the device is really assigned to docker. - if (!bfs::exists(pf->get_subdev_path("", -1))) + if (!sfs::exists(pf->get_subdev_path("", -1))) continue; // Insert detected device into proper list. diff --git a/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.cpp b/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.cpp index a7046dd6be2..a5c7c6f95d7 100644 --- a/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.cpp +++ b/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.cpp @@ -20,7 +20,7 @@ #include "core/common/message.h" #include "core/common/dlfcn.h" -namespace bfs = boost::filesystem; +namespace sfs = std::filesystem; namespace xdphalinterface { diff --git a/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.h b/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.h index 83f5a162fe0..31ad9570e04 100644 --- a/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.h +++ b/src/runtime_src/core/pcie/linux/plugin/xdp/hal_api_interface.h @@ -21,8 +21,7 @@ #include #include #include -#include -#include +#include #include "core/include/xclhal2.h" #include "core/include/xdp/hal_api.h" diff --git a/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt b/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt index 08312dc039d..bff16523a17 100644 --- a/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt +++ b/src/runtime_src/core/pcie/tools/cloud-daemon/CMakeLists.txt @@ -22,7 +22,6 @@ target_link_libraries(mpd xrt_core_static xrt_coreutil_static pthread - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} uuid dl @@ -47,7 +46,6 @@ target_link_libraries(msd xrt_core_static xrt_coreutil_static pthread - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} uuid dl diff --git a/src/runtime_src/core/pcie/tools/cloud-daemon/aws/CMakeLists.txt b/src/runtime_src/core/pcie/tools/cloud-daemon/aws/CMakeLists.txt index 67d15bbdedd..048cafb0587 100644 --- a/src/runtime_src/core/pcie/tools/cloud-daemon/aws/CMakeLists.txt +++ b/src/runtime_src/core/pcie/tools/cloud-daemon/aws/CMakeLists.txt @@ -40,7 +40,6 @@ if(${INTERNAL_TESTING_FOR_AWS}) xrt_core_static xrt_coreutil_static uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} pthread rt @@ -55,7 +54,6 @@ else() xrt_core_static xrt_coreutil_static uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} pthread rt diff --git a/src/runtime_src/core/pcie/tools/cloud-daemon/azure/CMakeLists.txt b/src/runtime_src/core/pcie/tools/cloud-daemon/azure/CMakeLists.txt index 42fe842804a..1d582413e7e 100644 --- a/src/runtime_src/core/pcie/tools/cloud-daemon/azure/CMakeLists.txt +++ b/src/runtime_src/core/pcie/tools/cloud-daemon/azure/CMakeLists.txt @@ -31,7 +31,6 @@ target_link_libraries(azure_mpd_plugin xrt_core_static xrt_coreutil_static uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} pthread rt diff --git a/src/runtime_src/core/pcie/tools/cloud-daemon/container/CMakeLists.txt b/src/runtime_src/core/pcie/tools/cloud-daemon/container/CMakeLists.txt index 8fa50925653..317cedbfd36 100644 --- a/src/runtime_src/core/pcie/tools/cloud-daemon/container/CMakeLists.txt +++ b/src/runtime_src/core/pcie/tools/cloud-daemon/container/CMakeLists.txt @@ -25,7 +25,6 @@ target_link_libraries(container_mpd_plugin xrt_core_static xrt_coreutil_static uuid - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} pthread rt diff --git a/src/runtime_src/core/pcie/tools/cloud-daemon/mpd.cpp b/src/runtime_src/core/pcie/tools/cloud-daemon/mpd.cpp index d0e2cd49337..2d4df225455 100644 --- a/src/runtime_src/core/pcie/tools/cloud-daemon/mpd.cpp +++ b/src/runtime_src/core/pcie/tools/cloud-daemon/mpd.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "boost/filesystem.hpp" +#include #include #include @@ -109,7 +109,7 @@ std::string Mpd::get_xocl_major_minor(const std::string &sysfs_name) if (!file_exist(sysfs_base + sysfs_name + "/drm")) return ""; - boost::filesystem::directory_iterator dir(sysfs_base + sysfs_name + "/drm"), end; + std::filesystem::directory_iterator dir(sysfs_base + sysfs_name + "/drm"), end; while (dir != end) { std::string fn = dir->path().filename().string(); if (fn.find("render") != std::string::npos) { @@ -169,7 +169,7 @@ bool Mpd::device_in_container(const std::string major_minor, std::string &path) for (auto &t : folder) { if (!file_exist(cgroup_base + t)) continue; - boost::filesystem::recursive_directory_iterator dir(cgroup_base + t), end; + std::filesystem::recursive_directory_iterator dir(cgroup_base + t), end; while (dir != end) { std::string fn = dir->path().filename().string(); if (!fn.compare(target)) { diff --git a/src/runtime_src/core/tools/common/Process.cpp b/src/runtime_src/core/tools/common/Process.cpp index 4f39965a976..73a6841696f 100644 --- a/src/runtime_src/core/tools/common/Process.cpp +++ b/src/runtime_src/core/tools/common/Process.cpp @@ -54,8 +54,10 @@ #endif // System - Include Files +#include #include #include + // ------ S T A T I C V A R I A B L E S ------------------------------------- // ------ F U N C T I O N S --------------------------------------------------- @@ -190,16 +192,17 @@ XBUtilities::runScript( const std::string & env, -boost::filesystem::path +std::filesystem::path findEnvPath(const std::string & env) { - boost::filesystem::path absPath; + std::filesystem::path absPath; if (env.compare("python") == 0) { // Find the python executable - absPath = boost::process::search_path("py"); + auto path = boost::process::search_path("py"); + absPath = path.string(); // Find python3 path on linux if (absPath.string().empty()) - absPath = boost::process::search_path("python3"); + absPath = boost::process::search_path("python3").string(); if (absPath.string().empty()) throw std::runtime_error("Error: Python executable not found in search path."); @@ -219,7 +222,7 @@ XBUtilities::runScript( const std::string & env, auto envPath = findEnvPath(env); // Make sure the script exists - if ( !boost::filesystem::exists( script ) ) { + if ( !std::filesystem::exists( script ) ) { std::string errMsg = (boost::format("Error: Given python script does not exist: '%s'") % script).str(); throw std::runtime_error(errMsg); } @@ -242,7 +245,7 @@ XBUtilities::runScript( const std::string & env, // Execute the python script and capture the outputs boost::process::ipstream ip_stdout; boost::process::ipstream ip_stderr; - boost::process::child runningProcess( envPath, + boost::process::child runningProcess( envPath.string(), cmdArgs, boost::process::std_out > ip_stdout, boost::process::std_err > ip_stderr, diff --git a/src/runtime_src/core/tools/common/SubCmdConfigureInternal.cpp b/src/runtime_src/core/tools/common/SubCmdConfigureInternal.cpp index 21856495e54..f19d06147c4 100644 --- a/src/runtime_src/core/tools/common/SubCmdConfigureInternal.cpp +++ b/src/runtime_src/core/tools/common/SubCmdConfigureInternal.cpp @@ -15,14 +15,14 @@ namespace XBU = XBUtilities; #include "common/device.h" // 3rd Party Library - Include Files -#include #include #include namespace po = boost::program_options; // System - Include Files -#include +#include #include +#include #include "common/system.h" #include "common/device.h" @@ -252,11 +252,11 @@ remove_daemon_config() throw xrt_core::error(std::errc::operation_canceled); try { - if (boost::filesystem::remove(config_file)) + if (std::filesystem::remove(config_file)) std::cout << boost::format("Succesfully removed the Daemon configuration file.\n"); else std::cout << boost::format("WARNING: Daemon configuration file does not exist.\n"); - } catch (const boost::filesystem::filesystem_error &e) { + } catch (const std::filesystem::filesystem_error &e) { std::cerr << boost::format("ERROR: %s\n") % e.what(); throw xrt_core::error(std::errc::operation_canceled); } diff --git a/src/runtime_src/core/tools/common/SubCmdExamineInternal.cpp b/src/runtime_src/core/tools/common/SubCmdExamineInternal.cpp index 5a6ae397ee6..86c5fe469eb 100644 --- a/src/runtime_src/core/tools/common/SubCmdExamineInternal.cpp +++ b/src/runtime_src/core/tools/common/SubCmdExamineInternal.cpp @@ -15,15 +15,15 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include #include namespace po = boost::program_options; // System - Include Files -#include +#include #include +#include #include static ReportCollection fullReportCollection = {}; @@ -137,7 +137,7 @@ SubCmdExamineInternal::execute(const SubCmdOptions& _options) const } // DRC: Output file - if (!m_output.empty() && boost::filesystem::exists(m_output) && !XBU::getForce()) { + if (!m_output.empty() && std::filesystem::exists(m_output) && !XBU::getForce()) { std::cerr << boost::format("ERROR: The output file '%s' already exists. Please either remove it or execute this command again with the '--force' option to overwrite it.") % m_output << std::endl; throw xrt_core::error(std::errc::operation_canceled); } diff --git a/src/runtime_src/core/tools/common/SubCmdJSON.cpp b/src/runtime_src/core/tools/common/SubCmdJSON.cpp index 28a6a70a16f..2d2e205926d 100644 --- a/src/runtime_src/core/tools/common/SubCmdJSON.cpp +++ b/src/runtime_src/core/tools/common/SubCmdJSON.cpp @@ -30,7 +30,6 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include -#include #include #include #include @@ -41,6 +40,7 @@ namespace pt = boost::property_tree; // System - Include Files #include +#include #include #include @@ -199,7 +199,7 @@ void populateSubCommandsFromJSON(SubCmdsCollection &subCmds, const std::string& for(auto &path : jsonPaths) { - if(boost::filesystem::is_regular_file(path)) + if(std::filesystem::is_regular_file(path)) populateSubCommandsFromJSONHelper(subCmds, path, exeName); } } diff --git a/src/runtime_src/core/tools/common/TestRunner.cpp b/src/runtime_src/core/tools/common/TestRunner.cpp index a70b0984870..17a2dcda320 100644 --- a/src/runtime_src/core/tools/common/TestRunner.cpp +++ b/src/runtime_src/core/tools/common/TestRunner.cpp @@ -1,4 +1,4 @@ -/** + /** * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may @@ -27,10 +27,10 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include -#include #include // System - Include Files +#include #include #include @@ -110,8 +110,8 @@ TestRunner::searchSSV2Xclbin(const std::string& logic_uuid, boost::property_tree::ptree& _ptTest) { std::string formatted_fw_path("/opt/xilinx/firmware/"); - boost::filesystem::path fw_dir(formatted_fw_path); - if (!boost::filesystem::is_directory(fw_dir)) { + std::filesystem::path fw_dir(formatted_fw_path); + if (!std::filesystem::is_directory(fw_dir)) { logger(_ptTest, "Error", boost::str(boost::format("Failed to find %s") % fw_dir)); logger(_ptTest, "Error", "Please check if the platform package is installed correctly"); _ptTest.put("status", test_token_failed); @@ -122,15 +122,12 @@ TestRunner::searchSSV2Xclbin(const std::string& logic_uuid, for (const std::string& t : suffix) { std::regex e("(^" + formatted_fw_path + "[^/]+/[^/]+/[^/]+/).+\\." + t); - for (boost::filesystem::recursive_directory_iterator iter(fw_dir, - boost::filesystem::symlink_option::recurse), end; iter != end;) { + for (std::filesystem::recursive_directory_iterator iter(fw_dir, + std::filesystem::directory_options::follow_directory_symlink ), end; iter != end;) { std::string name = iter->path().string(); std::smatch cm; - if (!boost::filesystem::is_directory(boost::filesystem::path(name.c_str()))) { - iter.no_push(); - } - else { - iter.no_push(false); + if (!std::filesystem::is_directory(std::filesystem::path(name.c_str()))) { + iter.disable_recursion_pending(); } std::regex_match(name, cm, e); @@ -148,7 +145,7 @@ TestRunner::searchSSV2Xclbin(const std::string& logic_uuid, return cm.str(1) + "test/"; } } - else if (iter.level() > 4) { + else if (iter.depth() > 4) { iter.pop(); continue; } @@ -170,7 +167,7 @@ TestRunner::searchLegacyXclbin(const uint16_t vendor, const std::string& dev_nam const std::string dsapath("/opt/xilinx/dsa/"); const std::string xsapath(getXsaPath(vendor)); - if (!boost::filesystem::is_directory(dsapath) && !boost::filesystem::is_directory(xsapath)) { + if (!std::filesystem::is_directory(dsapath) && !std::filesystem::is_directory(xsapath)) { const auto fmt = boost::format("Failed to find '%s' or '%s'") % dsapath % xsapath; logger(_ptTest, "Error", boost::str(fmt)); logger(_ptTest, "Error", "Please check if the platform package is installed correctly"); @@ -181,11 +178,11 @@ TestRunner::searchLegacyXclbin(const uint16_t vendor, const std::string& dev_nam //create possible xclbin paths std::string xsaXclbinPath = xsapath + dev_name + "/test/"; std::string dsaXclbinPath = dsapath + dev_name + "/test/"; - boost::filesystem::path xsa_xclbin(xsaXclbinPath); - boost::filesystem::path dsa_xclbin(dsaXclbinPath); - if (boost::filesystem::exists(xsa_xclbin)) + std::filesystem::path xsa_xclbin(xsaXclbinPath); + std::filesystem::path dsa_xclbin(dsaXclbinPath); + if (std::filesystem::exists(xsa_xclbin)) return xsaXclbinPath; - else if (boost::filesystem::exists(dsa_xclbin)) + else if (std::filesystem::exists(dsa_xclbin)) return dsaXclbinPath; const std::string fmt = "Platform path not available. Skipping validation"; @@ -214,14 +211,14 @@ TestRunner::runTestCase( const std::shared_ptr& _dev, const st // Currently, there isn't a clean way to determine if a nonDFX shell's interface is truly flat. // At this time, this is determined by whether or not it delivers an accelerator (e.g., verify.xclbin) const auto logic_uuid = xrt_core::device_query_default(_dev, {}); - if (!logic_uuid.empty() && !boost::filesystem::exists(xclbinPath)) { + if (!logic_uuid.empty() && !std::filesystem::exists(xclbinPath)) { logger(_ptTest, "Details", "Verify xclbin not available or shell partition is not programmed. Skipping validation."); _ptTest.put("status", test_token_skipped); return; } // log xclbin test dir for debugging purposes - boost::filesystem::path xclbin_path(xclbinPath); + std::filesystem::path xclbin_path(xclbinPath); auto xclbin_parent_path = xclbin_path.parent_path().string(); logger(_ptTest, "Xclbin", xclbin_parent_path); @@ -229,7 +226,7 @@ TestRunner::runTestCase( const std::shared_ptr& _dev, const st auto json_exists = [platform_path]() { const static std::string platform_metadata = "/platform.json"; std::string platform_json_path(platform_path + platform_metadata); - return boost::filesystem::exists(platform_json_path) ? true : false; + return std::filesystem::exists(platform_json_path) ? true : false; }; // Some testcases require additional binaries to be present on the device @@ -262,8 +259,8 @@ TestRunner::runTestCase( const std::shared_ptr& _dev, const st // Parse if the file exists here std::string xrtTestCasePath = "/opt/xilinx/xrt/test/" + test_name; - boost::filesystem::path xrt_path(xrtTestCasePath); - if (!boost::filesystem::exists(xrt_path)) { + std::filesystem::path xrt_path(xrtTestCasePath); + if (!std::filesystem::exists(xrt_path)) { logger(_ptTest, "Error", boost::str(boost::format("Failed to find %s") % xrtTestCasePath)); logger(_ptTest, "Error", "Please check if the platform package is installed correctly"); _ptTest.put("status", test_token_failed); @@ -303,8 +300,8 @@ TestRunner::runTestCase( const std::shared_ptr& _dev, const st else { //check if testcase is present std::string xrtTestCasePath = "/opt/xilinx/xrt/test/" + py; - boost::filesystem::path xrt_path(xrtTestCasePath); - if (!boost::filesystem::exists(xrt_path)) { + std::filesystem::path xrt_path(xrtTestCasePath); + if (!std::filesystem::exists(xrt_path)) { logger(_ptTest, "Error", boost::str(boost::format("Failed to find %s") % xrtTestCasePath)); logger(_ptTest, "Error", "Please check if the platform package is installed correctly"); _ptTest.put("status", test_token_failed); @@ -432,7 +429,7 @@ TestRunner::findXclbinPath( const std::shared_ptr& _dev, #else const auto platform_path = findPlatformPath(_dev, _ptTest); xclbin_path = _ptTest.get("xclbin_directory", platform_path) + xclbin_name; - if (!boost::filesystem::exists(xclbin_path)) { + if (!std::filesystem::exists(xclbin_path)) { const auto fmt = boost::format("%s not available. Skipping validation.") % xclbin_path; logger(_ptTest, "Details", boost::str(fmt)); _ptTest.put("status", test_token_skipped); @@ -446,8 +443,8 @@ TestRunner::findDependencies( const std::string& test_path, const std::string& ps_kernel_name) { const std::string dependency_json = "/lib/firmware/xilinx/ps_kernels/test_dependencies.json"; - boost::filesystem::path dep_path(dependency_json); - if (!boost::filesystem::exists(dep_path)) + std::filesystem::path dep_path(dependency_json); + if (!std::filesystem::exists(dep_path)) return {}; std::vector dependencies; diff --git a/src/runtime_src/core/tools/common/XBMain.cpp b/src/runtime_src/core/tools/common/XBMain.cpp index c7788bffc28..a33446191b3 100644 --- a/src/runtime_src/core/tools/common/XBMain.cpp +++ b/src/runtime_src/core/tools/common/XBMain.cpp @@ -26,14 +26,13 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include -#include namespace po = boost::program_options; // System - Include Files +#include #include // ------ Program entry point ------------------------------------------------- diff --git a/src/runtime_src/core/tools/common/tests/TestIPU.cpp b/src/runtime_src/core/tools/common/tests/TestIPU.cpp index 3995ddc3423..513db5dfd24 100644 --- a/src/runtime_src/core/tools/common/tests/TestIPU.cpp +++ b/src/runtime_src/core/tools/common/tests/TestIPU.cpp @@ -10,7 +10,7 @@ #include "xrt/xrt_kernel.h" namespace XBU = XBUtilities; -#include +#include static constexpr size_t host_app = 1; //opcode static constexpr size_t buffer_size = 128; @@ -27,7 +27,7 @@ TestIPU::run(std::shared_ptr dev) boost::property_tree::ptree ptree = get_test_header(); auto xclbin_path = findXclbinPath(dev, ptree); - if (!boost::filesystem::exists(xclbin_path)) { + if (!std::filesystem::exists(xclbin_path)) { return ptree; } // log xclbin test dir for debugging purposes diff --git a/src/runtime_src/core/tools/xbflash2/CMakeLists.txt b/src/runtime_src/core/tools/xbflash2/CMakeLists.txt index c7cd7a7a8cf..ecfc22e6638 100755 --- a/src/runtime_src/core/tools/xbflash2/CMakeLists.txt +++ b/src/runtime_src/core/tools/xbflash2/CMakeLists.txt @@ -3,7 +3,7 @@ # find_package(Boost - REQUIRED COMPONENTS filesystem system program_options) + REQUIRED COMPONENTS system program_options) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} @@ -37,7 +37,6 @@ add_executable(${XBFLASH_NAME} ${XBFLASH_QSPI_SRC}) set(Boost_USE_STATIC_LIBS ON) target_link_libraries(${XBFLASH_NAME} PRIVATE - boost_filesystem boost_system boost_program_options ) diff --git a/src/runtime_src/core/tools/xbflash2/OO_Dump_Qspips.cpp b/src/runtime_src/core/tools/xbflash2/OO_Dump_Qspips.cpp index 8d5fa3d2bf9..b40861e6a2c 100755 --- a/src/runtime_src/core/tools/xbflash2/OO_Dump_Qspips.cpp +++ b/src/runtime_src/core/tools/xbflash2/OO_Dump_Qspips.cpp @@ -25,13 +25,13 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include namespace po = boost::program_options; // System - Include Files +#include #include namespace { diff --git a/src/runtime_src/core/tools/xbflash2/xbflash.cpp b/src/runtime_src/core/tools/xbflash2/xbflash.cpp index 78190623397..f0cf37ee979 100755 --- a/src/runtime_src/core/tools/xbflash2/xbflash.cpp +++ b/src/runtime_src/core/tools/xbflash2/xbflash.cpp @@ -23,8 +23,8 @@ #include "XBFMain.h" // System include files -#include #include +#include #include #include diff --git a/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt b/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt index 0281c934abf..69cafe15d30 100644 --- a/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt +++ b/src/runtime_src/core/tools/xbmgmt2/CMakeLists.txt @@ -76,7 +76,6 @@ if (XRT_STATIC_BUILD) PRIVATE xrt_coreutil_static boost_system - boost_filesystem boost_program_options -Wl,--whole-archive rt pthread -Wl,--no-whole-archive uuid diff --git a/src/runtime_src/core/tools/xbmgmt2/OO_Hotplug.cpp b/src/runtime_src/core/tools/xbmgmt2/OO_Hotplug.cpp index a4f1f0e16d6..6b8c5d42783 100644 --- a/src/runtime_src/core/tools/xbmgmt2/OO_Hotplug.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/OO_Hotplug.cpp @@ -12,12 +12,12 @@ #include "core/common/system.h" // 3rd Party Library - Include Files -#include #include #include namespace po = boost::program_options; // System - Include Files +#include #include // ============================================================================= @@ -27,7 +27,7 @@ hotplug_online() { static const std::string rescan_path = "/sys/bus/pci/rescan"; - if (!boost::filesystem::exists(rescan_path)) + if (!std::filesystem::exists(rescan_path)) throw xrt_core::error((boost::format("Invalid sysfs file path '%s'.") % rescan_path).str()); std::ofstream rescan_file(rescan_path); diff --git a/src/runtime_src/core/tools/xbmgmt2/OO_Input.cpp b/src/runtime_src/core/tools/xbmgmt2/OO_Input.cpp index 5e9d5777d09..347a7966b2e 100644 --- a/src/runtime_src/core/tools/xbmgmt2/OO_Input.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/OO_Input.cpp @@ -11,11 +11,11 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include #include -#include #include #include namespace po = boost::program_options; +#include #include OO_Input::OO_Input( const std::string &_longName, bool _isHidden ) @@ -137,12 +137,12 @@ OO_Input::execute(const SubCmdOptions& _options) const // Load Config commands // -- process "input" option ----------------------------------------------- if (!m_path.empty()) { - if (!boost::filesystem::exists(m_path)) { + if (!std::filesystem::exists(m_path)) { std::cerr << boost::format("ERROR: Input file does not exist: '%s'") % m_path << "\n\n"; throw xrt_core::error(std::errc::operation_canceled); } - if (boost::filesystem::extension(m_path).compare(".ini") != 0) { + if (std::filesystem::path(m_path).extension().string() == ".ini") { std::cerr << boost::format("ERROR: Input file should be an INI file: '%s'") % m_path << "\n\n"; throw xrt_core::error(std::errc::operation_canceled); } diff --git a/src/runtime_src/core/tools/xbmgmt2/OO_Retention.cpp b/src/runtime_src/core/tools/xbmgmt2/OO_Retention.cpp index a1a512de996..8ac59492300 100644 --- a/src/runtime_src/core/tools/xbmgmt2/OO_Retention.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/OO_Retention.cpp @@ -11,9 +11,9 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include #include -#include namespace po = boost::program_options; +#include #include OO_Retention::OO_Retention( const std::string &_longName, bool _isHidden ) diff --git a/src/runtime_src/core/tools/xbmgmt2/OO_UpdateBase.cpp b/src/runtime_src/core/tools/xbmgmt2/OO_UpdateBase.cpp index 04c72643911..e0ba3745f67 100644 --- a/src/runtime_src/core/tools/xbmgmt2/OO_UpdateBase.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/OO_UpdateBase.cpp @@ -14,7 +14,6 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include #include @@ -24,6 +23,7 @@ namespace po = boost::program_options; #include #include #include +#include #include #include #include @@ -227,16 +227,24 @@ deployment_path_and_filename(std::string file) return std::make_pair(dsafile, path); } - +template +std::time_t to_time_t(TP tp) +{ + using namespace std::chrono; + auto sctp = time_point_cast(tp - TP::clock::now() + + system_clock::now()); + return system_clock::to_time_t(sctp); +} // Helper function for header info static std::string get_file_timestamp(const std::string & _file) { - boost::filesystem::path p(_file); - if (!boost::filesystem::exists(p)) { + std::filesystem::path p(_file); + if (!std::filesystem::exists(p)) { throw xrt_core::error("Invalid platform path."); } - std::time_t ftime = boost::filesystem::last_write_time(boost::filesystem::path(_file)); + std::filesystem::file_time_type file_time = std::filesystem::last_write_time(std::filesystem::path(_file)); + std::time_t ftime = to_time_t(file_time); std::string timeStr(std::asctime(std::localtime(&ftime))); timeStr.pop_back(); // Remove the new-line character that gets inserted by asctime. return timeStr; @@ -608,8 +616,8 @@ find_flash_image_paths(const std::vector& image_list) for (const auto& img : image_list) { // Check if the passed in image is absolute path - if (boost::filesystem::is_regular_file(img)){ - if (boost::filesystem::extension(img).compare(".xsabin") != 0) { + if (std::filesystem::is_regular_file(img)){ + if (std::filesystem::path(img).extension() == ".xsabin") { std::cout << "Warning: Non-xsabin file detected. Development usage, this may damage the card\n"; if (!XBU::can_proceed(XBU::getForce())) throw xrt_core::error(std::errc::operation_canceled); diff --git a/src/runtime_src/core/tools/xbmgmt2/OO_UpdateShell.cpp b/src/runtime_src/core/tools/xbmgmt2/OO_UpdateShell.cpp index 9616ba0eab2..02c132a26e4 100644 --- a/src/runtime_src/core/tools/xbmgmt2/OO_UpdateShell.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/OO_UpdateShell.cpp @@ -14,12 +14,12 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include namespace po = boost::program_options; // System - Include Files +#include #include #include @@ -113,7 +113,7 @@ OO_UpdateShell::execute(const SubCmdOptions& _options) const " is installed."); // Check if file exists - if (!boost::filesystem::exists(m_plp)) + if (!std::filesystem::exists(m_plp)) throw xrt_core::error("File not found. Please specify the correct path"); DSAInfo dsa(m_plp); diff --git a/src/runtime_src/core/tools/xbmgmt2/SubCmdDump.cpp b/src/runtime_src/core/tools/xbmgmt2/SubCmdDump.cpp index 99e656cc07d..c6d63a285fe 100644 --- a/src/runtime_src/core/tools/xbmgmt2/SubCmdDump.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/SubCmdDump.cpp @@ -15,13 +15,13 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include #include -#include #include namespace po = boost::program_options; // System - Include Files -#include +#include #include +#include // ------ L O C A L F U N C T I O N S --------------------------------------- @@ -180,7 +180,7 @@ SubCmdDump::execute(const SubCmdOptions& _options) const printHelp(); throw xrt_core::error(std::errc::operation_canceled); } - if (!m_output.empty() && boost::filesystem::exists(m_output) && !XBU::getForce()) { + if (!m_output.empty() && std::filesystem::exists(m_output) && !XBU::getForce()) { std::cerr << boost::format("m_output file already exists: '%s'") % m_output << "\n\n"; throw xrt_core::error(std::errc::operation_canceled); } diff --git a/src/runtime_src/core/tools/xbmgmt2/flash/firmware_image.cpp b/src/runtime_src/core/tools/xbmgmt2/flash/firmware_image.cpp index e7b2a426ee3..7fe5c758c43 100644 --- a/src/runtime_src/core/tools/xbmgmt2/flash/firmware_image.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/flash/firmware_image.cpp @@ -22,10 +22,10 @@ // 3rd Party Library - Include Files #include #include -#include "boost/filesystem.hpp" #include #include +#include #include #include #include @@ -423,7 +423,7 @@ std::vector firmwareImage::getIntalledDSAs() // Obtain installed DSA info. for (auto root : FIRMWARE_DIRS) { try { - if (!boost::filesystem::exists(root) || !boost::filesystem::is_directory(root)) + if (!std::filesystem::exists(root) || !std::filesystem::is_directory(root)) continue; } catch (const std::exception&) { @@ -432,9 +432,9 @@ std::vector firmwareImage::getIntalledDSAs() continue; } - boost::filesystem::recursive_directory_iterator end_iter; - // for (auto const & iter : boost::filesystem::recursive_directory_iterator(root)) { - for(boost::filesystem::recursive_directory_iterator iter(root); iter != end_iter; ++iter) { + std::filesystem::recursive_directory_iterator end_iter; + // for (auto const & iter : std::filesystem::recursive_directory_iterator(root)) { + for(std::filesystem::recursive_directory_iterator iter(root); iter != end_iter; ++iter) { if ((iter->path().extension() == ".xsabin" || iter->path().extension() == ".dsabin")) { DSAInfo dsa(iter->path().string()); installedDSA.push_back(dsa); diff --git a/src/runtime_src/core/tools/xbmgmt2/flash/flasher.cpp b/src/runtime_src/core/tools/xbmgmt2/flash/flasher.cpp index 3cc9d52693e..70fb698dd8e 100644 --- a/src/runtime_src/core/tools/xbmgmt2/flash/flasher.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/flash/flasher.cpp @@ -25,12 +25,12 @@ #include #include #include +#include #include #include #include #include "boost/format.hpp" #include -#include "boost/filesystem.hpp" #define INVALID_ID 0xffff @@ -501,7 +501,7 @@ std::string Flasher::getQspiGolden() std::string start = FORMATTED_FW_DIR; start += "/"; start += board_name; - boost::filesystem::recursive_directory_iterator dir(start), end; + std::filesystem::recursive_directory_iterator dir(start), end; while (dir != end) { std::string fn = dir->path().filename().string(); if (!fn.compare(QSPI_GOLDEN_IMAGE)) { diff --git a/src/runtime_src/core/tools/xbmgmt2/xbmgmt.cpp b/src/runtime_src/core/tools/xbmgmt2/xbmgmt.cpp index 8bce5670ad4..0f309f3c0f6 100644 --- a/src/runtime_src/core/tools/xbmgmt2/xbmgmt.cpp +++ b/src/runtime_src/core/tools/xbmgmt2/xbmgmt.cpp @@ -19,12 +19,13 @@ #include "xrt.h" // System include files -#include #include #include -#include -#include #include +#include +#include +#include + const std::string& command_config = R"( diff --git a/src/runtime_src/core/tools/xbutil2/CMakeLists.txt b/src/runtime_src/core/tools/xbutil2/CMakeLists.txt index 61cc3aa93df..423550b56bd 100644 --- a/src/runtime_src/core/tools/xbutil2/CMakeLists.txt +++ b/src/runtime_src/core/tools/xbutil2/CMakeLists.txt @@ -78,7 +78,6 @@ if (XRT_STATIC_BUILD) PRIVATE xrt_coreutil_static boost_system - boost_filesystem boost_program_options -Wl,--whole-archive rt pthread -Wl,--no-whole-archive uuid diff --git a/src/runtime_src/core/tools/xbutil2/OO_MemRead.cpp b/src/runtime_src/core/tools/xbutil2/OO_MemRead.cpp index 84a281619c0..0dcba495d43 100644 --- a/src/runtime_src/core/tools/xbutil2/OO_MemRead.cpp +++ b/src/runtime_src/core/tools/xbutil2/OO_MemRead.cpp @@ -14,12 +14,12 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include namespace po = boost::program_options; // System - Include Files +#include #include #include #include @@ -74,7 +74,7 @@ OO_MemRead::execute(const SubCmdOptions& _options) const device = XBU::get_device(boost::algorithm::to_lower_copy(m_device), true /*inUserDomain*/); //-- Output file - if (!m_outputFile.empty() && boost::filesystem::exists(m_outputFile) && !XBU::getForce()) + if (!m_outputFile.empty() && std::filesystem::exists(m_outputFile) && !XBU::getForce()) throw xrt_core::error((boost::format("Output file already exists: '%s'") % m_outputFile).str()); } catch (const xrt_core::error&) { diff --git a/src/runtime_src/core/tools/xbutil2/OO_MemWrite.cpp b/src/runtime_src/core/tools/xbutil2/OO_MemWrite.cpp index 19fb34f7d12..8a51a7e15c2 100644 --- a/src/runtime_src/core/tools/xbutil2/OO_MemWrite.cpp +++ b/src/runtime_src/core/tools/xbutil2/OO_MemWrite.cpp @@ -13,12 +13,12 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files -#include #include #include namespace po = boost::program_options; // System - Include Files +#include #include #include #include @@ -114,7 +114,7 @@ OO_MemWrite::execute(const SubCmdOptions& _options) const // Parse the input option path if (!m_inputFile.empty()) { // Verify that the file exists and is not a directory - if (!boost::filesystem::exists(m_inputFile) && boost::filesystem::is_regular_file(m_inputFile)) + if (!std::filesystem::exists(m_inputFile) && std::filesystem::is_regular_file(m_inputFile)) XBU::throw_cancel(boost::format("Input file does not exist: '%s'") % m_inputFile); // Open the input file stream after validating the file path and name diff --git a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp index 113e8e03674..7780e6da2ec 100644 --- a/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp +++ b/src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp @@ -37,13 +37,13 @@ namespace XBU = XBUtilities; // 3rd Party Library - Include Files #include -#include #include #include namespace po = boost::program_options; // System - Include Files #include +#include #ifdef __linux__ #include //munmap #endif @@ -516,7 +516,7 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const throw xrt_core::error((boost::format("Unknown output format: '%s'") % m_format).str()); // Output file - if (!m_output.empty() && !XBU::getForce() && boost::filesystem::exists(m_output)) + if (!m_output.empty() && !XBU::getForce() && std::filesystem::exists(m_output)) throw xrt_core::error((boost::format("Output file already exists: '%s'") % m_output).str()); if (m_tests_to_run.empty()) @@ -540,10 +540,10 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const // check if xclbin folder path is provided if (!validateXclbinPath.empty()) { XBU::verbose("Sub command: --path"); - if (!boost::filesystem::exists(validateXclbinPath) || !boost::filesystem::is_directory(validateXclbinPath)) + if (!std::filesystem::exists(validateXclbinPath) || !std::filesystem::is_directory(validateXclbinPath)) throw xrt_core::error((boost::format("Invalid directory path : '%s'") % validateXclbinPath).str()); if (validateXclbinPath.compare(".") == 0 || validateXclbinPath.compare("./") == 0) - validateXclbinPath = boost::filesystem::current_path().string(); + validateXclbinPath = std::filesystem::current_path().string(); if (validateXclbinPath.back() != '/') validateXclbinPath.append("/"); } diff --git a/src/runtime_src/core/tools/xbutil2/xbutil.cpp b/src/runtime_src/core/tools/xbutil2/xbutil.cpp index b2ce527afd9..4f085c479a8 100644 --- a/src/runtime_src/core/tools/xbutil2/xbutil.cpp +++ b/src/runtime_src/core/tools/xbutil2/xbutil.cpp @@ -20,10 +20,10 @@ // System include files #include +#include #include #include -#include #include #include diff --git a/src/runtime_src/tools/scripts/xrtdeps.sh b/src/runtime_src/tools/scripts/xrtdeps.sh index c1c5fa61d46..f46f4cb6495 100755 --- a/src/runtime_src/tools/scripts/xrtdeps.sh +++ b/src/runtime_src/tools/scripts/xrtdeps.sh @@ -359,6 +359,68 @@ suse_package_list() ) } +mariner_package_list() +{ + MN_LIST=(\ + binutils \ + boost-devel \ + boost-static \ + cmake \ + cppcheck \ + curl \ + dkms \ + elfutils-devel \ + elfutils-libs \ + gcc \ + gcc-c++ \ + gdb \ + git \ + glibc-static \ + gmock-devel \ + gnuplot \ + gnutls-devel \ + gtest-devel \ + json-glib-devel \ + libcurl-devel \ + libdrm-devel \ + libffi-devel \ + libjpeg-turbo-devel \ + libpng12-devel \ + libstdc++-static \ + libtiff-devel \ + libudev-devel \ + libuuid-devel \ + libyaml-devel \ + lm_sensors \ + lsb-release \ + make \ + ncurses-devel \ + ocl-icd \ + ocl-icd-devel \ + opencl-headers \ + openssl-devel \ + openssl-static \ + pciutils \ + perl \ + pkgconfig \ + protobuf-compiler \ + protobuf-devel \ + protobuf-static \ + python3 \ + python3-pip \ + python3-devel \ + rapidjson-devel \ + rpm-build \ + strace \ + unzip \ + zlib-static \ + ) +} + + + + + update_package_list() { if [ $FLAVOR == "ubuntu" ] || [ $FLAVOR == "debian" ]; then @@ -369,6 +431,8 @@ update_package_list() fd_package_list elif [ $FLAVOR == "sles" ]; then suse_package_list + elif [ $FLAVOR == "mariner" ]; then + mariner_package_list else echo "unknown OS flavor $FLAVOR" exit 1 @@ -401,6 +465,15 @@ validate() rpm -q -i opencl-headers | grep '^Version' | grep ': 2\.' fi fi + + if [ $FLAVOR == "mariner" ]; then + rpm -q "${MN_LIST[@]}" + if [ $? == 0 ] ; then + # Validate we have OpenCL 2.X headers installed + rpm -q -i opencl-headers | grep '^Version' | grep ': 2\.' + fi + fi + } prep_ubuntu() @@ -527,6 +600,16 @@ prep_amzn() yum install -y ocl-icd ocl-icd-devel opencl-headers } +prep_mariner() +{ + echo "Installing Mariner extended repository ..." + dnf install -y mariner-repos-extended + # echo "Installing cmake3 from EPEL repository..." + # yum install -y cmake3 + echo "Installing opencl header from Mariner extended repository..." + yum install -y ocl-icd ocl-icd-devel opencl-headers +} + prep_sles() { echo "Preparing SLES for package dependencies..." @@ -563,6 +646,8 @@ install() prep_rhel elif [ $FLAVOR == "amzn" ]; then prep_amzn + elif [ $FLAVOR == "mariner" ]; then + prep_mariner elif [ $FLAVOR == "sles" ]; then prep_sles fi @@ -596,9 +681,19 @@ install() ${SUDO} zypper install -y "${SUSE_LIST[@]}" fi - # Install/upgrade pybind11 for building the XRT python bindings - # We need 2.6.0 minimum version - pip3 install -U pybind11 + if [ $FLAVOR == "mariner" ]; then + echo "Installing Mariner packages..." + dnf install -y "${MN_LIST[@]}" + fi + + if [ $FLAVOR == "mariner" ]; then + echo "Installing pybind..." + sudo dnf install -y pybind11-devel python3-pybind11 + else + # Install/upgrade pybind11 for building the XRT python bindings + # We need 2.6.0 minimum version + pip3 install -U pybind11 + fi } update_package_list diff --git a/src/xma/src/xmaapi/CMakeLists.txt b/src/xma/src/xmaapi/CMakeLists.txt index 9a8f431d0dd..3ba90bf790d 100644 --- a/src/xma/src/xmaapi/CMakeLists.txt +++ b/src/xma/src/xmaapi/CMakeLists.txt @@ -24,7 +24,6 @@ target_link_libraries(xma2api dl gcc_s stdc++ - ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ) diff --git a/src/xma/src/xmaapi/xma_utils.cpp b/src/xma/src/xmaapi/xma_utils.cpp index 09769aa0ad8..9357fc1eb20 100644 --- a/src/xma/src/xmaapi/xma_utils.cpp +++ b/src/xma/src/xmaapi/xma_utils.cpp @@ -16,8 +16,7 @@ #include "core/common/api/bo.h" #include "core/common/device.h" #include -#include -#include +#include #include #include #include @@ -142,7 +141,7 @@ namespace xma_core { namespace xma_core { namespace utils { constexpr std::uint64_t cu_base_min = 0x1800000; -namespace bfs = boost::filesystem; +namespace sfs = std::filesystem; static const char* emptyOrValue(const char* cstr) @@ -151,26 +150,26 @@ emptyOrValue(const char* cstr) } int32_t -directoryOrError(const bfs::path& path) +directoryOrError(const sfs::path& path) { - if (!bfs::is_directory(path)) + if (!sfs::is_directory(path)) return XMA_ERROR; return XMA_SUCCESS; } -static boost::filesystem::path& +static std::filesystem::path& dllExt() { - static boost::filesystem::path sDllExt(".so"); + static std::filesystem::path sDllExt(".so"); return sDllExt; } inline bool -isDLL(const bfs::path& path) +isDLL(const sfs::path& path) { - return (bfs::exists(path) - && bfs::is_regular_file(path) + return (sfs::exists(path) + && sfs::is_regular_file(path) && path.extension()==dllExt()); } @@ -196,10 +195,10 @@ load_libxrt() dlerror(); /* Clear any existing error */ // xrt - bfs::path xrt(emptyOrValue(std::getenv("XILINX_XRT"))); + sfs::path xrt(emptyOrValue(std::getenv("XILINX_XRT"))); if (xrt.empty()) { std::cout << "XMA INFO: XILINX_XRT env variable not set. Trying default /opt/xilinx/xrt" << std::endl; - xrt = bfs::path("/opt/xilinx/xrt"); + xrt = sfs::path("/opt/xilinx/xrt"); } if (directoryOrError(xrt) != XMA_SUCCESS) { std::cout << "XMA FATAL: XILINX_XRT env variable is not a directory: " << xrt.string() << std::endl; @@ -207,7 +206,7 @@ load_libxrt() } // Load the xmaplugin library as it is a dependency for all plugins - bfs::path xma2plugin_lib(xrt / "lib/libxma2plugin.so"); + sfs::path xma2plugin_lib(xrt / "lib/libxma2plugin.so"); if (!isDLL(xma2plugin_lib)) { std::cout << "XMA FATAL: xma2plugin lib not found. Lib: " << xma2plugin_lib.string() << std::endl; return XMA_ERROR; @@ -221,7 +220,7 @@ load_libxrt() } if (!isEmulationMode()) { - bfs::path p1(xrt / "lib/libxrt_core.so"); + sfs::path p1(xrt / "lib/libxrt_core.so"); if (isDLL(p1)) { void* xrthandle = dlopen(p1.string().c_str(), RTLD_NOW | RTLD_GLOBAL); if (!xrthandle) @@ -234,7 +233,7 @@ load_libxrt() return 1; } - bfs::path p2(xrt / "lib/libxrt_aws.so"); + sfs::path p2(xrt / "lib/libxrt_aws.so"); if (isDLL(p2)) { void* xrthandle = dlopen(p2.string().c_str(), RTLD_NOW | RTLD_GLOBAL); if (!xrthandle) @@ -269,7 +268,7 @@ load_libxrt() return XMA_ERROR; } - bfs::path p2(xrt / "lib/libxrt_swemu.so"); + sfs::path p2(xrt / "lib/libxrt_swemu.so"); sw_em_driver = p2.string(); if (isDLL(sw_em_driver)) { @@ -304,7 +303,7 @@ load_libxrt() return XMA_ERROR; } - bfs::path p1(xrt / "lib/libxrt_hwemu.so"); + sfs::path p1(xrt / "lib/libxrt_hwemu.so"); hw_em_driver = p1.string(); if (isDLL(hw_em_driver)) { diff --git a/tests/validate/aie_pl_test/CMakeLists.txt b/tests/validate/aie_pl_test/CMakeLists.txt index bf4f90458cb..17f986b061f 100644 --- a/tests/validate/aie_pl_test/CMakeLists.txt +++ b/tests/validate/aie_pl_test/CMakeLists.txt @@ -20,7 +20,7 @@ add_executable(${TESTNAME} src/host.cpp ) -target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) +target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) if (NOT WIN32) target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${xrt_coreutil_LIBRARY} ${xrt_core_LIBRARY}) diff --git a/tests/validate/aie_pl_test/src/host.cpp b/tests/validate/aie_pl_test/src/host.cpp index 7b1f58b9890..f7832085006 100644 --- a/tests/validate/aie_pl_test/src/host.cpp +++ b/tests/validate/aie_pl_test/src/host.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -281,7 +281,7 @@ main(int argc, char* argv[]) } std::string aie_control_file = "aie_control_config.json"; - auto aie_control = boost::filesystem::path(test_path) / aie_control_file; + auto aie_control = std::filesystem::path(test_path) / aie_control_file; std::ifstream aiefile(aie_control.string()); if (!aiefile.good()) { @@ -300,7 +300,7 @@ main(int argc, char* argv[]) if(hw_gen == 1) b_file = "vck5000_pcie_pl_controller.xclbin.xclbin"; - auto binaryFile = boost::filesystem::path(test_path) / b_file; + auto binaryFile = std::filesystem::path(test_path) / b_file; std::ifstream infile(binaryFile.string()); if (!infile.good()) { @@ -319,7 +319,7 @@ main(int argc, char* argv[]) // instance of plController std::string dma_lock_file = "dma_lock_report.json"; - auto dma_lock = boost::filesystem::path(test_path) / dma_lock_file; + auto dma_lock = std::filesystem::path(test_path) / dma_lock_file; bool match = false; // Check for AIE Hardware Generation diff --git a/tests/validate/bandwidth_test/CMakeLists.txt b/tests/validate/bandwidth_test/CMakeLists.txt index 4f6f351b845..877ba1a6516 100644 --- a/tests/validate/bandwidth_test/CMakeLists.txt +++ b/tests/validate/bandwidth_test/CMakeLists.txt @@ -15,7 +15,7 @@ endif(WIN32) include_directories(../../../src/include/1_2 ../../../src/runtime_src/core/include src/ ../common/includes/xcl2 ../common/includes/cmdparser ../common/includes/logger ) add_executable(${TESTNAME} ../common/includes/xcl2/xcl2.cpp ../common/includes/cmdparser/cmdlineparser.cpp ../common/includes/logger/logger.cpp src/host.cpp) -target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (NOT WIN32) target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${OpenCL_LIBRARY} ) diff --git a/tests/validate/bandwidth_test/src/host.cpp b/tests/validate/bandwidth_test/src/host.cpp index 16cf37cab28..563fbc21626 100644 --- a/tests/validate/bandwidth_test/src/host.cpp +++ b/tests/validate/bandwidth_test/src/host.cpp @@ -15,7 +15,7 @@ */ #include #include -#include +#include #include #include #include @@ -63,7 +63,7 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - auto binaryFile = boost::filesystem::path(test_path) / b_file; + auto binaryFile = std::filesystem::path(test_path) / b_file; std::ifstream infile(binaryFile.string()); if (flag_s) { if (!infile.good()) { @@ -78,7 +78,7 @@ int main(int argc, char** argv) { int num_kernel = 0, num_kernel_ddr = 0; bool chk_hbm_mem = false; std::string filename = "/platform.json"; - auto platform_json = boost::filesystem::path(test_path) / filename; + auto platform_json = std::filesystem::path(test_path) / filename; std::vector bank_names; try { diff --git a/tests/validate/hostmemory_test/CMakeLists.txt b/tests/validate/hostmemory_test/CMakeLists.txt index 41ffc14ffe7..4337d59d787 100644 --- a/tests/validate/hostmemory_test/CMakeLists.txt +++ b/tests/validate/hostmemory_test/CMakeLists.txt @@ -15,7 +15,7 @@ endif(WIN32) include_directories(../../../src/include/1_2 ../../../src/runtime_src/core/include src/ ../common/includes/xcl2 ../common/includes/cmdparser ../common/includes/logger ) add_executable(${TESTNAME} ../common/includes/xcl2/xcl2.cpp ../common/includes/cmdparser/cmdlineparser.cpp ../common/includes/logger/logger.cpp src/host.cpp) -target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (NOT WIN32) target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${OpenCL_LIBRARY} ) diff --git a/tests/validate/hostmemory_test/src/host.cpp b/tests/validate/hostmemory_test/src/host.cpp index ed82833500a..f33d8f42417 100644 --- a/tests/validate/hostmemory_test/src/host.cpp +++ b/tests/validate/hostmemory_test/src/host.cpp @@ -15,7 +15,7 @@ */ #include #include -#include +#include #include #include #include @@ -55,10 +55,10 @@ int main(int argc, char** argv) { std::cout << "ERROR : please provide the platform test path to -p option\n"; return EXIT_FAILURE; } - auto binary_file = boost::filesystem::path(test_path) / b_file; + auto binary_file = std::filesystem::path(test_path) / b_file; std::ifstream infile(binary_file.string()); // This is for backward compatibility support when older platforms still having slavebridge.xclbin. - auto old_binary_file = boost::filesystem::path(test_path) / old_b_file; + auto old_binary_file = std::filesystem::path(test_path) / old_b_file; std::ifstream old_infile(old_binary_file.string()); if (flag_s) { if (!infile.good()) { @@ -77,7 +77,7 @@ int main(int argc, char** argv) { int num_kernel; std::string filename = "/platform.json"; - auto platform_json = boost::filesystem::path(test_path) / filename; + auto platform_json = std::filesystem::path(test_path) / filename; try { boost::property_tree::ptree load_ptree_root; diff --git a/tests/validate/ps_aie_test/CMakeLists.txt b/tests/validate/ps_aie_test/CMakeLists.txt index c5c5c59e366..89f252abd8f 100644 --- a/tests/validate/ps_aie_test/CMakeLists.txt +++ b/tests/validate/ps_aie_test/CMakeLists.txt @@ -17,7 +17,7 @@ add_executable(${TESTNAME} ../common/includes/logger/logger.cpp src/host.cpp ) -target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (NOT WIN32) target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${xrt_coreutil_LIBRARY} ${xrt_core_LIBRARY}) diff --git a/tests/validate/ps_bandwidth_test/CMakeLists.txt b/tests/validate/ps_bandwidth_test/CMakeLists.txt index dd06d1f382d..bf5d50fd670 100644 --- a/tests/validate/ps_bandwidth_test/CMakeLists.txt +++ b/tests/validate/ps_bandwidth_test/CMakeLists.txt @@ -17,7 +17,7 @@ add_executable(${TESTNAME} ../common/includes/logger/logger.cpp src/host.cpp ) -target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (NOT WIN32) target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${xrt_coreutil_LIBRARY} ${xrt_core_LIBRARY}) diff --git a/tests/validate/ps_iops_test/CMakeLists.txt b/tests/validate/ps_iops_test/CMakeLists.txt index 046e41018a6..6561ba8ea4f 100644 --- a/tests/validate/ps_iops_test/CMakeLists.txt +++ b/tests/validate/ps_iops_test/CMakeLists.txt @@ -13,7 +13,7 @@ endif() if (NOT WIN32) include_directories(../common/includes/cmdparser ../common/includes/logger) add_executable(${TESTNAME} ../common/includes/cmdparser/cmdlineparser.cpp ../common/includes/logger/logger.cpp src/ps_iops.cpp) - target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${xrt_coreutil_LIBRARY} ${xrt_core_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) + target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${xrt_coreutil_LIBRARY} ${xrt_core_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY}) install(TARGETS ${TESTNAME} RUNTIME DESTINATION ${XRT_VALIDATE_DIR}) endif(NOT WIN32) diff --git a/tests/validate/ps_validate_test/CMakeLists.txt b/tests/validate/ps_validate_test/CMakeLists.txt index c3c37b380b2..3208cff6e52 100644 --- a/tests/validate/ps_validate_test/CMakeLists.txt +++ b/tests/validate/ps_validate_test/CMakeLists.txt @@ -18,7 +18,7 @@ add_executable(${TESTNAME} ../common/includes/logger/logger.cpp src/host.cpp ) -target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(${TESTNAME} PRIVATE ${xrt_coreutil_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (NOT WIN32) target_link_libraries(${TESTNAME} PRIVATE ${uuid_LIBRARY} pthread ${xrt_coreutil_LIBRARY} ${xrt_core_LIBRARY})