README_Update_2022_GLFPE_for_Windows_W64 23 Dec 2021 GLF -------------------------------------------------------------------------------------------------- The GLFPE_Windows_Tools archive has been updated extensively with all new features and library support for 2022. This will be the first GLFPE for Windows version to use the MinGW-w64 compiler toolset for GCC 11.2.0, as built and packaged by the MSYS2 project. Because some of the libraries and languages (Python 3) no longer support Windows XP, and by far most installations of Windows 7, 8, 10, and 11 are of the 64-bit variety, the GLFPE Windows w64 will only be released with default support for building 64-bit executables, and all locally incorporated libraries will be compiled from source as 64-bit code. Experimentation by GLF has shown that newer versions of many of the libraries of interest to support the GLFPE sample source code suite have evolved to a point where the necessary tools to build the libraries no longer are compatible with Windows XP. As of this writing, the building of GLFPE for Windows W64 is feature complete. MSYS2's installer included MinGW-w64 with GCC 11.2.0 as a base installation for C, C++, FORTRAN, and ADA, and has been installed to c:\msys64\mingw64 and subfolders. Unlike the prior Windows 32-bit MinGW32 based compier toolset, the MSYS2 based installation effectively installs and maintains al its major libraries and components, using the "pacman" package manager. The prior 32-bit GLFPE for Windows required extensive effort to acquire and build libraries from source by GLF before each major release of the toolset, so the effort was only undertaken every three years or so. The MSYS2 based release allows an interested user to reconstruct the entire toolchain by executing in succession: The Windows .EXE installer to set up the base MSYS2 A script to automatically inmstall (almost) all required libraries from MSYS2 repositories A script to compile and install the final SDL_bgi library from source The above reproducible process always installs the latest versions of all specified compilers and libraries, and can be rerun at any time to repair the installation if necessary. Alternatively, as before, GLF makes available monolithic .ZIP archive files to install a prebuilt and tested instance of the same toolset, though it will not automatically update itself at installation. GCC/G++/GFORTRAN Toolchain -------------------------- GLF uses Linux for primary C/C++ development, and performs all personal source code to work using Debian Linux. The latest available version of GCC in the Debian Linux 11 (bullseye) stable repository at this time is version 10.2.1. It is prudent to periodically update the matching GLF Windows toolset to as equivalent a GCC version as practical, to demonstrate and maintain the intended portability of programming functionality across major operating systems. The last two prior updates of GLFPE Windows were done in 2018 and 2021, and used MinGW32 with GCC 6.3.0 and GCC 9.2.0 respectively. The GCC 9.2.0 version is retained currently as a toolset to build 32-bit Windows executables, though the library support is not as up to date as with the 64-bit toolset. The most widely distributed free C/C++ compiler for Windows at this time is probably MinGW-w64, an extended and upgraded replacement for the venerable MinGW32 compiler from mingw.org (now found at https://osdn.net/projects/mingw/). Despite MinGW-w64's multiarch (64 and 32 bit executable) support, GLF has not yet chosen to adapt existing GLF source code to use the updated version, instead choosing to continue using the older 32-bit only MinGW32 toolchain. The pace of development of MinGW32 has always been slow but stable, and the latest available version of GCC in MinGW32 is usually a couple of years behing the Gnu project's official development of GCC. It can be daunting to assemble a full working toolchain with all the desired library support from only free and open but disparate internet sources. MinGW32 was designed to use minimal Windows resources, originally relying only on the standard C runtime library DLL known to be included with all versions of Windows by default. MinGW32 development has often been quite slow and releases of new tools and compilers often lag behind versions in wide general use by several years. MinGW32 also supplies several prebuilt support libraries needed by the GLFPE sample projects, which can simplify setting up a sufficient toolset, but the user has no control over the building assumptions, such as optional features and whether the libraries are static (preferred by GLF) or shared (providing DLL files). An alternate build of MinGW32 has long been available as TDM-GCC (https://jmeubank.github.io/tdm-gcc/). The TDM-GCC project (Turbo Dragon MinGW) tends to avoid these extra libraries, opting instad for the core functionality such as the GCC/G++ compiler to be more up-to-date. This is a rebuilt and repackaged version of MinGW (both MinGW32 and MinGW-w64 are supported by TDM-GCC) which patches some known issues and generally updates to very recent GCC versions at any given time. However, certain key addon libraries supported by the MinGW32 project and used by GLF are not directly available from TDM-GCC in the MinGW32 bit version, so the burden of compiling compatible libraries from source falls upon the person assembing the toolchain (GLF). This is a large, complicated, and time consuming task, so GLF does not update Windows toolchains very often. GLF projects use a number of open source GUI, image, sound, and other externally provided library packages widely supported in the Linux world, but available for Windows mostly as portable source code. It takes considerable time (days) to rebuild the many externally sourced libraries from scratch with the updated compiler and including any library updates themselves. The prior release of GLFPE Windows was based on MinGW32, a 32-bit only compiler set which had a number of known bugs and made it difficult to compile open source library projects. The 2021 release of GLFPE mostly updated the GCC/G++ compiler itself, and included library binaries which had been previously built using an earlier (2018) version of GCC, but which was largely compatible with the current MinGW32. That saved time for 2021, but the handwriting was on the wall suggesting replacement of the compiler to support nore recent library and language requirements. As of this writing all prior existing open source GLFPE sample source code tested has compiled under the 32-bit model, which retains compatibility with Windows XP and up. The XP sample source including 65 GLF projects programmed in the past 3 years on the default Linux platform, recently ported to Windows for this GLFPE update. There are now about 700 open source and 150 restricted projects (proprietary, unavailable to the public) in the GLFPE C/C++ sample test suite, all of which have been ported to the new 32-bit XP toolset. On the 64-bit Windows model, the stuation is more complex. Perhaps two thirds of the prior GLF projects ported without incident to the 64 bit model, mostly command-line programs using local or common, still supported external libraries. However, not all ibrary versions in use on the 32-botXP model have ported successfully to 64 bitys, though in each such instance a newr, udated replacement exists. Some of the replacements are not fully backward compatibnle, so GKF has acquired substitue example projects compatible with the upgraded libraries (Allegro 5 vs. 4, wxWidgets 3 vs. 2, penCV 4.5 vs. 2, SDL 2 vs. 1.2, SDL_bgi to replace GLF custom adaptation of the Borland Graphics Interface, or BGI). All these upgraded libraries have been proven to work aon both Windows 674 and Debian Linux, but a (very) few existing GLF programs have not yet been ported due to chyanges in the language implementation or the library specs. However, 98% of prior projects either ported or have valid replacements. The XXP compatible toolsets and the 64 bit toolsets have been installed into sufficiently separate filders as to allow them to fully coexist in the same OS environment (on Windows 7, 8, 10, 11), assuming only one model is used in a command window instance at a time (PATH must be set differently). This time the XP compatible 32-bit toolset is located in c:\glfpe\mgw920 and its subfolders. A presumably compatible configuration of MSYS, which is used to help use Unix-style tools to build compatible libraries, is now found under c:\glfpe\msys920 and its subfolders. The gfortran compiler is directly supported either as 32-bit or 64-bit code under respective GCC models, as part of the GCC project with compiler support included in either the XP (MinGW32) or the W64 (MinGW-w64) model parallel "universes". For XP, Python 3.4.3, the last version of the language built to run on Windows XP or later OS, is the currently included Python version, though this is not the most recent release of Python, because it was successfully incorporated into the prior XP-compatible release of GLFPE. For W64, the latest version of Python is part of the base installe compiler set. Similarly, Cmake is installed under \glfpe\cmake* for XP compatible code, and several versions of Cmake are installed to separate folders to allow better compatibility with older projects. The latest Cmake cannot be used on Windows XP due to a DLL change. On the W64 model, cnmake is installed by MSYS2 and is always the latest avaiable version. Other optional Windows software installers (7-Zip, AutoIt, Espeak, Ghostscript) have been included in the installation archives and are recommended for productivity regardless of the compiler model. These are useful programming utilities, and the installers have been updated to the latest available versions at the end of 2021. IDE ---- The IDE of choice remains a derivative of Dev-C++, but yet another fork of the original IDE can be used this time. The original author of Bloodshed dev-C++ stopped work in the 1990s. Several significant bugs went unfixed, and the version of GCC included in the original package was obsolete. Dev-C++ was quite popular, especially among beginning Windows programmers, so eventually the project was forked into wxDev-C++, a project which included hooks into the wxWidgets library, and changed the project file (*.dev) format somewhat in ways that needed to be addressed by the converting user. Eventually wxDev-C++ itself was set aside and became obsolete. Yet another fork was developed which became Orwell Dev-C++, which eliminated integration with wxWidgets, and mostly reverted the *.dev project file format back to a variant nearly the same as the original Bloodshed *.dev format. Because of this, converting was easier from an original Bloodshed project than from a wxDev-C++ project, but neither conversion was overly hard. GLFPE incorporated Orwell as the Windows IDE of choice in a prior update in 2018, and continues to include it as a good development tool in this release. The original Orwell Dev-C++ (5.11) still works, and is installed in c:\glfpe\orwell_w64. In 2021 and 2022 it became prudent to consider changing IDEs. Orwell has not been updated since 2015. Fortunately, yet another fork has been published. This time the sponsor of the project is a commercial company with a long history. Embarcadero is the descendant of Borland, Inc., the developers of the original Turbo Pascal and Turbo C commercial compilers, which made history for their quality and relative affordability for the time. Embarcadero has been generous in the past, allowing their older, no longer supported products to be published for free download by anyone with just a "mailing list" registration. They have chosen to fork an updated and improved Dev-C++ as a GitHub-hosted open source project. GLF still prefers to use the (somewhat lighter footprint) Orwell Dev-C++ 5.11 for Windows C/C++ development, but GLFPE has also adopted the most recent stable version (6.3) of Embarcadero Dev-C++ as a possible replacement IDE. Embarcadero Dev-C++ version 6.3 is now located under c:\glfpe\w64_embarcadero. The Embarcadero IDE will not run on Windows XP due to a DLL conflict, but Orwell still works. GLF has also tested the promising cross-platform Code::Blocks as a possible IDE, but does not provide it in the GLFPE installation set. It has the distinct benefit of allowing import and conversion of Dev-C++ projects from the *.dev plaintext format to its own XML-based *.cbp project format. Unfortunately, export back to Dev-C++ is not supported. It also uses its own build process which bypasses the VERY USEFUL makefiles automatically generated by Dev-C++, so batch builds of Code::Blocks projects are harder and slower to script, requiring special command line invocation of Code::Blocks to build projects instead of (the usual and fast) mingw32-make. Progress in building and adding libraries to the toolchain(s) --------------------------------------------------------------- Because MSYS is essential to building the external libraries for MinGW32 (XP), but there is some question as to how new a version can be obtained. The current MinGW32 supported version of MSYS will be retained as long as it seems to be usable. The installation location has been moved and renamed to c:\glfpe\msys920 but the contents are largely identical to the earlier c:\glfpe\msys630. The version installed was actually downloaded with the latest MinGW32, but appears unchanged from the earlier version. For W64 model, MSYS2 is a more complete 64-bit option to provide a bash-like shell to support MinGW-w64. By installing the base GCC compier set and all libraries within MYS2, and only using it to build 64-bt projects, MSYS2 can reliably build and maintain the entire compiler toolset into the future wih minimal effort. The XP model uses the PDCurses 3.4 (old but stable) library, which has been rebuilt using the new compiler and installed into the same \glfpe\mgw920 folder tree (bin, lib, include, etc.). The W64 MSYS2 instalation includes "ncurses" as the most compatible replacement for GLFPE sample source code. PDCurses is also available but conflicts with ncurses in various ways. The XP model is stuck on the obsolete OpenCV 2 library, built from old source, due to problems porting a newer version with MinGW32, given that OpenCV project itself drops support for "obsolete" OS platforms, and so they consider Windows XP. The OpenCV 4.5.4 (recent version) libraries are installed to the W64 model by MSYS2. Sample code for OpenCV 3 tutorials have been successfully built to match the current state of the source suite on the Linux platform. The wxWidgets 2.12.28 (again old but stable) library (built from source) is retained ONLY for the XP model. For W64, MSYS2 again provides support for wxWidgets 3.0.5 and later, and new example projects have been tested as replacements for wxWidgets 2 examples. The Gnu COBOL toolset is different than the other GCC tools for GLFPE. Though the COBOL compiler relies on a version of GCC for its back end, it does not currently use the updated GCC used for C, C++, or gfortran. GLF has not changed out the COBOL compiler yet. There is no pressure to do so, since the old compiler still works and all GLF COBOL code is of academic and nostalgic interest and is 50 years old. The COBOL compiler is actually included with its own binary and dev tool chain under c:\glfpe\gnucobol\compiler, and it remains the version from 2018 for now. On Linux Gnu COBOL (or Open COBOL) has been updated since then. Though the newer version is not currently included in the Debian repositories, GLF has found a workaround to install it in GLFPE Linux. The Arduino IDE will eventually be updated to 1.8.13 (currently used in the Linux platform) or later, since that version is currently included in the Debain Linux versions of GLFPE, but for now it remains version 1.8.5 for the Windows toolset as it was in the 2018 GLFPE version. The same installlation sertves on either XP or 64 bit Windows platforms, as the Arduino IDE is a 32-bit executable package.