Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVS File Update and Fixes #1945

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ScottBoyce
Copy link
Contributor

This PR contains two commits. One that updates the visual studio solution and project files associated with the mf6.exe and mf6.dll and the other updates the same files for zonebudget and MF5to6. They all still use ifort as the fortran compiler.

This will not invoke any tests, but I ran pixi run autotest on my local machine. All tests pass except for the following:

FAILED test_gwf_libmf6_evt01.py::test_mf6model[0-libgwf_evt01] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_ghb01.py::test_mf6model[0-libgwf_ghb01] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_ifmod01.py::test_mf6model[0-libgwf_ifmod01] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_ifmod02.py::test_mf6model[0-libgwf_ifmod02] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_ifmod03.py::test_mf6model[0-libgwf_ifmod03] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_rch01.py::test_mf6model[0-libgwf_rch01] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_rch02.py::test_mf6model[0-libgwf_rch02] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_riv01.py::test_mf6model[0-libgwf_riv01] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_riv02.py::test_mf6model[0-libgwf_riv02] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_libmf6_sto01.py::test_mf6model[0-libgwf_sto01] - UnboundLocalError: local variable 'buff' referenced before assignment
FAILED test_gwf_tdis.py::test_tdis_tsmult[1.0] - FileNotFoundError: Could not find module 'C:\Data\dev\mf6-dev\modflow6\bin\libmf6.dll' (or one of its dependencies). Try using the full path with constructor syntax.
FAILED test_gwf_tdis.py::test_tdis_tsmult[1.2] - FileNotFoundError: Could not find module 'C:\Data\dev\mf6-dev\modflow6\bin\libmf6.dll' (or one of its dependencies). Try using the full path with constructor syntax.
ERROR test_gwf_libmf6_rch02.py::test_mf6model[0-libgwf_rch02] - shutil.Error: [('C:\\Users\\seboyce\\AppData\\Local\\Temp...

I am unsure as to the cause of the libmf6.dll errors as the file is placed in the bin directory. It could also be that these tests have not been run with VS made dll targets in a while (or some quark of Windows). I will keep looking into it, but the original version of the dll project files would not compile at all for me initially.

The bulk of the changes are described in the git commit log. The major changes are that win32 is removed and all projects are setup to compile x64. The sln/vfproj files are updated to VS2022 format, which is backward compatible with VS2019.

The major fix is that mfbmi needed several modification to successfully compile with the current version of ifort in oneAPI (2021.12). In particular, mf6bmi required ignoring the LIBCMT, LIBCMTD, and LIBIFCOREMT (not originally there) and mf6 no longer required ignoring LIBCMT.

The project for Zonebudget now produces "zbud6.exe" as its output rather than "zonebudget.exe"

The Zonebudget and MF5to6 now produce their executables in the bin folder,
rather then using a post-build "copy" event.

Added /Qdiag-disable:10448 to suppress warning about ifort being deprecated.

The intermediate directory was changed from
$(ProjectName)/$(Platform)/$(ConfigurationName)
to
$(ProjectName)_$(Platform)_$(ConfigurationName)
to simply the structure from having multiply directories that contain nothing but a single directory.

The Visual Studio Solution (.sln) and Project (.vfproj) files
no longer include the win32 compilation option. The files
are also updated to Visual Studio 2022 format. This format
still works with an up to date Visual Studio 2019.

The fpp option was set to global for debug and not for release.
It was disabled for debug, and instead added to both
configurations under files that need pre-processing
(those with .F and .F90 extension).

The debug symbols (.pdb) are only generated for debug compilation
and are placed in the obj_temp directory. Debug uses the debug MT,
and release uses the release MT runtime libraries.

The mf6bmi required ignoring the LIBCMT, LIBCMTD, and LIBIFCOREMT
to compile with the 2024 oneAPI. mf6.exe does not require
ignoring these libraries, so LIBCMT is removed as an ignore.

Floating point exceptions are set to fpe0 (underflow is zero,
otherwise raise an exceptions). Heap arrays is enabled for
all configurations and projects.

The intermediate directory was changed from
   $(ProjectName)/$(Platform)/$(ConfigurationName)
to
   $(ProjectName)_$(Platform)_$(ConfigurationName)
to simply the structure from having multiply directories
that contain nothing but a single directory.

Added /Qdiag-disable:10448 to suppress warning about
ifort being deprecated.
The Visual Studio Solution (.sln) and Project (.vfproj) files
for MF5to6 and Zonebudget are a x64 compilation and the
win32 configuration is removed. The solution and project files
use Visual Studio 2022 format instead of VS2013 format.
This still works with an up to date Visual Studio 2019.

Changed the zonebudget target from zonebudget.exe to zbud6.exe
to reflect what is specified in the meson.build file
(and online downloads).

The mf5to6 and zonebudget projects added a missing
fpp option for successful release compilation. Intermediate
files are now placed in an obj_temp directory and the
resulting executables are placed in the bin folder
(previously, a "copy" post-build command was invoked).

Added /Qdiag-disable:10448 to suppress warning about
ifort being deprecated.
@wpbonelli
Copy link
Contributor

wpbonelli commented Jul 16, 2024

Maybe worth checking if the same test failures occur in a CI environment? Adding an MSVS build should be easy as we now have an action to install base/hpc kits. Then I think we can just run devenv like this.

xref #1357 which was abandoned due to the oneapi base kit installation overhead. Seems more justifiable now that we are already doing it for the Windows parallel test.

@mjr-deltares
Copy link
Contributor

I could reproduce the errors locally with the msvs build of the library. They were related to the Intel runtime not being found. If I change the project runtime setting to use static linking (Multithreaded), and then the issue is resolved. Not sure if that got changed somehow along the way? Maybe installing the runtime through a redistributable would fix it too.

I have used an older intel: Compiling with Intel® Fortran Compiler Classic 2021.11.0 [Intel(R) 64]...

Hope this helps you forward with your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants