Fix CI and update build configuration on Windows #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR started as an attempt to force CMake to find the conda Fortran compiler, flang-new, on Windows instead of the gfortran that's packaged with the GitHub Actions runner. Setting the
FC
environment variable worked! But the NMake build backend failed. I changed the build backend to Ninja, which is used in Meson projects, but it also failed, although with a helpful message:The module file
bmif_2_0.mod
was being created twice, once when building the shared library and again when building the static library. This issue hadn't been raised by NMake. I modified the CMake build configuration to use a CMake object library as a base to build the shared and static libraries. This made only one version ofbmif_2_0.mod
. I also matched other libraries (e.g., bz2 and bzip2) in appending_static
to the static library name.Interestingly, flang-new creates different filenames than gfortran; e.g.,
bmif.lib
instead oflibbmif.a
. I updated the tests to work for the filenames generated by flang-new.This fixes #51.