QtCS2024 Compile once. Run everywhere
Cristian Adam discussed using Cosmopolitan libc for cross-platform C++ applications at QtCS2024, addressing deployment challenges and encouraging community contributions to enhance support for Qt Creator.
Read original articleCristian Adam from the Qt Creator team presented a session titled "Compile Once, Run Everywhere" at QtCS2024, focusing on the use of Cosmopolitan libc for C++ applications. The session highlighted the challenges of compiling and deploying applications across various platforms, including Windows, Linux, and macOS for both x86_64 and arm64 architectures. Cosmopolitan libc serves as a solution by detecting the host machine at runtime and providing appropriate system calls, allowing for a unified compilation process. Applications are compiled for both architectures and packaged similarly to Linux installers. Adam demonstrated successful builds of CMake, Qt Base, and Qt GUI using Cosmopolitan libc on macOS and Linux, although he faced difficulties on Windows due to limitations in Cosmopolitan's POSIX implementation. Key challenges discussed included integration with native platforms, application launching, and WebSocket support for the Qt QPA VNC platform. The Qt Creator binary size was noted to be around 230 megabytes, with no significant performance differences from the native version. Adam expressed his intention to further develop Cosmopolitan support for Qt Creator and encouraged community contributions and feedback.
- Cristian Adam presented on using Cosmopolitan libc for cross-platform C++ application deployment.
- Cosmopolitan libc allows applications to be compiled once and run on multiple platforms.
- Challenges include integration with native systems and limitations on Windows.
- The size of the Cosmopolitan Qt Creator binary is approximately 230 megabytes.
- Adam encourages community involvement in improving Cosmopolitan support for Qt Creator.
Related
Cosmopolitan v3.5
Cosmopolitan Libc transforms C into a universal language by modifying GCC and Clang to create a POSIX-compliant polyglot format. Users can compile programs using the `cosmocc` compiler and access debugging techniques. The project provides platform notes, a Discord chatroom, and funding acknowledgments.
Cosmopolitan v3.5.8
Cosmopolitan Libc enables C to be a universal language without interpreters. It produces a polyglot format for various platforms, supporting debugging and offering a `cosmocc` compiler. Join the development team on Redbean Discord for more information.
Logging C function calls with cosmopolitan Libc (2022)
The Cosmopolitan Libc runtime's --ftrace flag logs C function calls, aiding debugging by tracing execution history and identifying issues like NULL pointers, while also supporting --strace for system call logging.
Cosmic: A New Desktop Environment
System76 has launched COSMIC, an alpha desktop environment for Linux, featuring customizable design, improved window management, and built in Rust. User feedback is encouraged for future enhancements and updates.
Cosmic Alpha Released
System76 has released the alpha version of COSMIC, a new desktop environment for Pop!_OS and Linux, featuring customization, performance improvements, and a design system for developers, with positive early feedback.
- Many commenters expressed curiosity about the practical applications and user experiences of the Cosmopolitan Qt Creator.
- There were concerns regarding the size of the binaries produced and the implications for software distribution.
- Some participants highlighted the challenges of building third-party libraries across different platforms, noting that Qt itself is generally easier to work with.
- Philosophical objections were raised about the approach of binary distribution versus source compilation, emphasizing a preference for building from source.
- Several comments suggested exploring alternatives like WebAssembly (WASM) for better cross-platform compatibility.
Justine writes some pretty cool software.
I also can't envision a common scenario in which I would have a machine that doesn't have a c compiler but I would be able to run an APE executable. Even in that uncommon case, I still think I would be better off using software that I could compile with a standards compliant c compiler and ship the binary that _I_ built myself to the machine that lacked a c compiler.
> running with the vnc QPA
The demo they have running has no native display or input support; it just serves the interface over a socket via VNC.
While it's kind of expected it'd be big... that's really large. :(
For instance, check out the demo on slide 10: now you can have janky sliders that don't match the platform's version on every platform!
WASM could solve all this, but that would mean all OSes would need WASM runtimes that supported a consistent set of standards and APIs. Have fun getting that to happen.
Generally, though, third party libraries are the biggest problem I've had building Qt apps on different platforms. Qt itself "just works," but getting arbitrary open source libraries building on OSX and Windows can be a pain.
I've not heard of this before. Who is using it and for what? And how?
Also, who / what is .Adam?
It is an interesting and intriguing technology, but pretty useless if not even dangerous, IMHO.
Related
Cosmopolitan v3.5
Cosmopolitan Libc transforms C into a universal language by modifying GCC and Clang to create a POSIX-compliant polyglot format. Users can compile programs using the `cosmocc` compiler and access debugging techniques. The project provides platform notes, a Discord chatroom, and funding acknowledgments.
Cosmopolitan v3.5.8
Cosmopolitan Libc enables C to be a universal language without interpreters. It produces a polyglot format for various platforms, supporting debugging and offering a `cosmocc` compiler. Join the development team on Redbean Discord for more information.
Logging C function calls with cosmopolitan Libc (2022)
The Cosmopolitan Libc runtime's --ftrace flag logs C function calls, aiding debugging by tracing execution history and identifying issues like NULL pointers, while also supporting --strace for system call logging.
Cosmic: A New Desktop Environment
System76 has launched COSMIC, an alpha desktop environment for Linux, featuring customizable design, improved window management, and built in Rust. User feedback is encouraged for future enhancements and updates.
Cosmic Alpha Released
System76 has released the alpha version of COSMIC, a new desktop environment for Pop!_OS and Linux, featuring customization, performance improvements, and a design system for developers, with positive early feedback.