Yes, this issue affects the Flang compiler on Windows specifically. It seems the -fPIC flag isn’t supported on Windows, so it might be worth removing it from the default flags for flang-new in fpm.
An above and beyond effort. Any fpm project with test programs can add testing on multiple platforms with multiple compilers just by adding .github/workflows/*.yml files to their project.
I’m not sure about MPI, as I don’t have much experience with it and don’t currently have any repositories using MPI to test with. It would be great if you could provide a very simple example program to try it out.
MPI in a pain because of the MPI module needs to be compiled with the same compiler…in theory we could use vapaa, bind to that and that binds to C? I’ll look into that and maybe try to open a PR
absolutely, not even mentioning that not depending on the non-universal Fortran module format would enable users to freely use MPI from Fortran regardless of the implementation that best suits their machine.
You can also use GitHub - lfortran/fortran_mpi, it works with GFortran and LFortran, we used it to compile the POT3D code. But it might not be as complete as Vapaa yet.
Below are the results of a simple “Hello World” test. The required build tools (fpm, cmake, ninja and meson) are preinstalled, so no additional setup is needed.
Thanks a lot for implementing this GitHub Action! I am already using it.
Just a question: Why is lfortran paired with gcc in Ubuntu, but with clang in MacOS and Windows? Would it not be preferable to have the same pairing across OSs?
@HugoMVale thank you for using the action, happy to see it is working for you.
My priority was to get the basic hello world test with fpm working correctly, then run tests on some of my own repositories with both fpm and CMake. Later I added the C/C++ compiler without considering making the pairing consistent across OSs (my mistake ). To be honest, I was not sure what would be the best pairing for lfortran. Any suggestion? I can improve this in the next version.
(I am also thinking about introducing two new variables like c-compiler and cpp-compiler so the user can choose them, but that would also require adding c-version and cpp-version and modifying the logic of the implementation. I would like to avoid that for now as it needs more time.)
For a default settings, as an user testing different compilers, I would find it reasonable to pair Lfortran with clang systematically. For the simple reason that both are from the LLVM family. And for a CI/CD script I would find it nice that it helps verify cross-platform stability, meaning that if Lfortran is paired with clang on one platform, I would find it easier-to-follow-mentally to have the same pairing for the other platforms as to minimize the number of things to check if something goes wrong or results are too different.
Since LFortran works with all cases, I would follow @hkvzjal’s and @HugoMVale’s suggestion to use Clang with LFortran on all platforms as the default case. Thanks!
Good idea. We should update LFortran upstream to by default expect clang on both Linux and macOS, and only use gcc if the user selects (either compiler option or environment variables). Since we use LLVM as our default backend, I agree that it makes sense to just depend on Clang.