I'm having trouble installing Allegro for Windows. It's been a long time and I've become complacent with Mac and how easily it works.
I'd like to build from source and I feel there's gotta be some secret trick I'm missing involving the dependencies.
Doesn't Windows have package managers now (Chocolatey?) that can easily be used to install all the dependencies? Are there scripts, for example? I've downloaded a few different installers already (MinGW, CMake, DirectX, VS Build Tools, etc), I'm not convinced these are all going into the right place on this system, and to be honest am really bummed how many of these are trying to install search bar plugins, or asking for email addresses, and so forth.
Is there a package manager way to build? Something terminal only? Something that sill allows me to compile allegro from source?
For Visual Studio I use VCPkg (https://github.com/microsoft/vcpkg) and for MSys2 it ships with pacman which also allows for easy installation.
And for VC++ or whatever you have Edgar Reynaldo's monolith builds
Windoze is eazy.
Just use my binaries for MinGW-W64.
See my build guide, there is a link at the bottom which you can find here :
http://members.allegro.cc/EdgarReynaldo/BuildA5.html
https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/
EDIT
Really, it's not that hard. You have 3 options.
1) MSVS MSVC++2017+ and Nuget.
2) MSYS2 and pacman.
3) MinGW-W64 and binaries
4) Build it yourself
nuget? ??
?????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ??????????????????????? ???????????????????????
Yeßßßß
Here's the Nuget link, for completeness (MSVC only): https://www.nuget.org/packages/Allegro and just the dependencies https://www.nuget.org/packages/AllegroDeps. It's possible to grab the dependencies manually if you want to compile Allegro from source, e.g. see these lines here: https://github.com/liballeg/allegro5/blob/master/appveyor.yml#L8.
MSYS2 comes with all the dependencies (and Allegro itself), it's what I use for my day-to-day Windows development.
The official MSYS2 packages https://github.com/liballeg/allegro5/releases/tag/5.2.5.0 and https://github.com/liballeg/allegro_winpkg/releases/tag/1.9.0 also can be used.
If you're really adventurous, you can regenerate the official packages by following directions here: https://github.com/liballeg/allegro_winpkg/tree/master/universal, that compiles both the dependencies and Allegro from source.
Hell, I ever did find a allegro5 package for arm on alpine linux. Just had to apk add and voilà.
Do not take the install process as an excuse for your coding laziness, Katko ;-)
MSYS2 comes with all the dependencies (and Allegro itself), it's what I use for my day-to-day Windows development.
That sounds like something I could go for. I wouldn't mind learning/emulating the tooling you use.
OK, I have installed MSYS2 from the one-click installer. I have several questions just about it in general:
I had previously installed the "git shell". It looks essentially like the same thing. What's the difference between MSYS2 and "git shell"'s MINGW64?
It appears like binaries (git, cmake) that I had installed into "git shell" are not in MSYS2. I'm a little confused about how the filesystem (and installed binaries) are laid out between this, terminal, and PowerShell, and just like Windows PATH for example. What's the difference between these filesystems? Is there a crossover?
I've gone the route of using pacman to install the packages git, make, cmake, and mingw-w64-x86_64-toolchain (with all).
When I installed git with `pacman -Sy git`, I was able to `git --version`. But after installing `pacman -Sy mingw-w64-x86_64-toolchain`, then `gcc --version` is not found. What's the difference between the two install procedures?
I would suggest somebody that is familiar with fetching and building all dependencies and then building Allegro against it to script the process so that anybody can automate it easily just by invoking the script (and if they want to dig into the details they can review the script).
It is a lot of bullshit to fetch individual packages, learn their intricacies, build them all independently (after recursively fetching THEIR dependencies), and then link them all into an Allegro build. This should be something that a script (e.g., .cmd or .ps1) can capture so that it's easy for any newbie to review and modify... It's 2020 ffs.
That's basically what package managers are anyway. Scripts to fetch dependencies, except they use their own store to prevent the upstream from changing and breaking the scripts, and most cache the binaries instead of rebuilding from source to speed things up...
That's how I live my day to day life. Any tedious process that I have to repeat gets scripted so that I can trivially repeat it. Maintaining the scripts is generally not that much work, especially compared to the manual process.
(I'd be happy to script it myself, but I'm not happy to figure out all of the things that need to be done... That would need to be described to me in detail with exact URLs and commands (which is basically the scripting part anyway)...)
Append:
Mark, I think that some MSYS packages (and binaries) are named just like the package you installed, something like msys-blah-blah-x86_64-gcc instead of just gcc... There are a few different ways you could figure out the name of the binaries. Searching the PATH or file system, finding a command to list the files in the package, etc.
This should be something that a script (e.g., .cmd or .ps1) can capture so that it's easy for any newbie to review and modify... It's 2020 ffs
I feel the same way.
OK, so far this is what I have:
After installing and opening MSYS (and updating it with sudo pacman -Syu) this would be the start of the script I would use (but it gets stuck at the end):
pacman -S mingw-w64-x86_64-gcc --noconfirm pacman -S mingw-w64-x86_64-gdb --noconfirm pacman -S make --noconfirm pacman -S mingw-w64-x86_64-cmake --noconfirm pacman -S git --noconfirm pacman -S mingw-w64-x86_64-pkg-config --noconfirm pacman -S mingw-w64-x86_64-freetype --noconfirm pacman -S mingw-w64-x86_64-libpng --noconfirm pacman -S mingw-w64-x86_64-libjpeg-turbo --noconfirm pacman -S mingw-w64-x86_64-libvorbis --noconfirm pacman -S mingw-w64-x86_64-flac --noconfirm pacman -S mingw-w64-x86_64-physfs --noconfirm pacman -S mingw-w64-x86_64-dumb --noconfirm pacman -S mingw-w64-x86_64-libtheora --noconfirm export PATH=$PATH:/mingw64/bin mkdir -p Repos cd Repos git clone https://github.com/liballeg/allegro5.git cd allegro5 mkdir build_allegro_monolith cd build_allegro_monolith cmake G"MSYS Makefiles" -D"CMAKE_SYSTEM_PREFIX_PATH:PATH=/mingw64/x86_64-w64-mingw32" -DWANT_MONOLITH=on ..
It does well, but then gets stuck at the last cmake step, not being able to find X11 development tools. The terminal output is below, I've attached the CMakeError.log.
-- Guessed MinGW directory: /mingw64 -- Allowing GCC/Clang to use SSE instructions -- Performing Test ALLEGRO_HAVE_PROCFS_ARGCV -- Performing Test ALLEGRO_HAVE_PROCFS_ARGCV - Failed -- Performing Test ALLEGRO_HAVE_SV_PROCFS_H -- Performing Test ALLEGRO_HAVE_SV_PROCFS_H - Failed Using OpenGL -- Could NOT find X11 (missing: X11_X11_LIB) CMake Error at CMakeLists.txt:707 (message): X11 not found. You may need to install X11 development libraries. -- Configuring incomplete, errors occurred! See also "/home/Mark/Repos/allegro5/build_allegro_monolith/CMakeFiles/CMakeOutput.log". See also "/home/Mark/Repos/allegro5/build_allegro_monolith/CMakeFiles/CMakeError.log".
I tried looking for a pacman package of x11 development tools, but pacman -Ss x11 or a web search didn't reveal anything.
---
BTW, I had found this, it was helpful: https://www.allegro.cc/forums/thread/616828
Use "MinGW Makefiles", not MSYS. That's different.
MSYS Makefiles is correct, I don't understand why it's complaining about for X11. I'd nuke the build directory and try again. I just tested a fresh install of MSYS and I didn't get that error.
I feel the same way.
FWIW the allegro_winpkg repository I linked to has such scripts (otherwise packaging Allegro would be a pain ).
Do not take the install process as an excuse for your coding laziness, Katko ;-)
I know you're kidding but I always use Allegro, DAllegro, on Linux, compiled from source.
Visual Studio is nice for like C# stuff. But man, it's one fat momma.
When I installed git with `pacman -Sy git`, I was able to `git --version`. But after installing `pacman -Sy mingw-w64-x86_64-toolchain`, then `gcc --version` is not found. What's the difference between the two install procedures?
It's been a while but IIRC your PATH depends on which variant of the shell you open (use the mingw-w64 one).
You can find more information on this page, e.g.
MSYS2 consists of three subsystems and their corresponding package repositories, msys2, mingw32, and mingw64.
[...]
Each of the subsystems provides its own native (i.e. target=host) compiler toolchain, in msys2-devel, mingw-w64-i686-toolchain, and mingw-w64-x86_64-toolchain.
[...]
Every subsystem has an associated "shell", which is essentially a set of environment variables that allow the subsystems to co-operate properly. These shells can be invoked using launchers in the MSYS2 installation directory or using the shortcuts in the Windows Start menu.
I have no idea about the X11 related error.
Btw., now when I think about it, the question which makefiles to use might actually depend on the variant of make you install.
Go ahead and use MSYS Makefiles if you want your program to depend on the MSYS runtime....
Go ahead and use MSYS Makefiles if you want your program to depend on the MSYS runtime....
Go ahead and use Cmake Makefiles if you want your program to depend on the Cmake runtime....
Uhm, no ChrisKatko. Not the same. You'll have to run your program within MSYS, not as a windows executable.
Ok, working through this problem has made me realize I'm actually trying to solve several problem cases simultaneously, so I've scaled back to just the simplest one. The problem cases are:
1. Update my build system to also work on Windows, which requires building with Allegro.
2. Compile Allegro from source, so that I can contribute to the codebase and test on Windows.
3. Compile Allegro from source, so that I can build the latest master without having to wait for releases or dll builds.
4. Modify my build system so that programs and source can be built and tested real-time in multiple build cases (clang, gcc, cl) and platforms (win, mac).
After I scope it down to just #1, I've been able to just go with pacman install allegro which is enough. Constraining myself to MSYS2 (in MINGW64) has helped a lot, and at this point there's enough to digest and work through.
I honestly really like the system at this point. It's very similar to what I work with on my mac, and it's not hard to slowly "port over" my .zshrc to .bashrc. Each of the dependencies has some quirks so far in Windows, there's some quirks with ncurses, vim plugins, paths, and some little tools I use like rerun. But it's definitely working as I sort all those out.
I feel like Pickle Rick slowing getting back into mobility.
Eventually, I'll get to the point where I compile Allegro from source and achieve #2, 3, and 4, but for now definitely the number of simultaneous problems to work through is diminishing, and I've gotten an Allegro window to run.
<blatant spot>
binaries would have been faster....
</spot>