IMPROVING THE PORTABILITY OF C++ SOURCE CODE FOR MULTIPLATFORM COMPUTING SYSTEMS - STARODUBSKYI, IGOR; BERDNYK, MYKHAILO (Herald of Khmelnytskyi National University. Technical sciences, 2025)
Software portability is one of the key factors for successful development in the context of rapid hardware evolution and increasing diversity of computing architectures. The emergence of alternative platforms such as ARM and RISC-V, alongside traditional x86_64, as well as the widespread adoption of mobile, embedded, and cloud computing, necessitates the development of source code that can be adapted across different environments with minimal resource cost. This issue is especially relevant for system-level programming languages such as C++, which is widely used for building high-performance and resource-efficient applications. Ensuring code portability without sacrificing performance is a critical objective for enhancing the competitiveness of software products in global markets.    The aim of this study is to develop an effective methodology for improving the portability of C++ source code for multiplatform computing systems, which enables the minimization of costs related to adapting software solutions to diverse hardware and software platforms.  To achieve this goal, the study analyzes common challenges encountered when porting C++ applications between computing environments. A comprehensive approach is proposed, which includes strict adherence to modern C++ standards (with a focus on C++17 and C++20), the use of cross-platform libraries such as Boost and POCO, unified build configuration through CMake, and automation of testing using continuous integration (CI) systems with support for multiple target platforms. Additionally, the study considers adaptive programming techniques and conditional compilation practices to optimize the code for platform-specific features.               A test C++ project implementing typical data processing functionality was created and successfully compiled and executed on three major platforms: Windows, Linux, and macOS. The results demonstrate that adherence to portability principles eliminates the need for modifying the source code when switching between environments. Performance and resource usage were analyzed, confirming the effectiveness of the proposed methodology for industrial-scale use.   The study confirms that C++ source code portability is achievable through proper application architecture planning and the use of modern cross-platform development tools. The proposed approach significantly reduces the time and cost of maintaining software across diverse platforms. Future research is expected to focus on developing automated tools for analyzing code portability and evaluating the performance of adapted solutions on emerging architectures.
Keywords: software portability; multiplatform programming; C++; cross-compilation; CMake; C++ standards; continuous integration systems; heterogeneous computing environments