#4459 closed defect (fixed)
MSVC broken using latest 32bit Windows build
Reported by: | Rüdiger Franke | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | critical | Milestone: | 1.12.0 |
Component: | Build Environment | Version: | v1.12.0 |
Keywords: | Cc: | Niklas Worschech |
Description (last modified by )
After deinstallation of OpenModelica-v1.11.0-32bit and installation of OpenModelica-v1.12.0-dev-466-g214f0d6-32bit the below error message pops up when attempting to simulate or FMU export a model using the Cpp runtime and MSVC.
Gcc works, but the exported model produces sporadically wrong results. The system outside OpenModelica did not change between versions 1.11 and 1.12.
The wrong results using gcc could not be reproduced under Linux.
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. cl /FeMyModel.dll OMCppMyModelCalcHelperMain.cpp /DWIN32 /D_WINDOWS /W3 /GR /EHsc /Zm113 /Od /EHa /fp:except /W4 /MP /D_DEBUG /MDd /Zi /Ob0 /RTC1 -DUSE_DGESV -DOMC_BUILD -DUSE_THREAD -DSUNDIALS_MAJOR_VERSION=2 -DSUNDIALS_MINOR_VERSION=6 -DPMC_USE_SUNDIALS /w /I"C:/OpenModelica1.12.0-dev-32bit//include/omc/cpp/" /I"C:/OpenModelica1.12.0-dev-32bit//include/omc/cpp/3rdParty/boost/msvc/" /I"" /I. /TP /DNOMINMAX /DNO_INTERACTIVE_DEPENDENCY /DFMU_BUILD /DRUNTIME_STATIC_LINKING /link /DLL /NOENTRY /LIBPATH:"C:/OpenModelica1.12.0-dev-32bit//lib/omc/cpp/msvc" /LIBPATH:"C:/OpenModelica1.12.0-dev-32bit//bin" OMCppSystem_static.lib OMCppMath_static.lib OMCppExtensionUtilities_static.lib OMCppFMU_static.lib OMCppNewton_static.lib OMCppDgesv_static.lib OMCppDgesvSolver_static.lib ModelicaExternalC.lib ModelicaStandardTables.lib OMCppModelicaUtilities_static.lib -L"C:/home/MyLib" Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. cl : Command line warning D9025 : overriding '/EHs' with '/EHa' cl : Command line warning D9025 : overriding '/W3' with '/W4' cl : Command line warning D9025 : overriding '/W4' with '/w' OMCppMyModelCalcHelperMain.cpp C:\OpenModelica1.12.0-dev-32bit\include\omc\cpp\Core/Modelica.h(59) : fatal error C1083: Cannot open include file: 'thread': No such file or directory NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' Stop. RESULT: 2
Change History (13)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Cc: | added |
---|
comment:4 by , 7 years ago
Finally I could reproduce the random errors when using Gcc. The following pull request cleans up the DgesvSolver code and fixes the initialization of nominal values
Let's wait for the next nightly build to see if this fixes the Gcc issues under Windows as well.
Horrible if the same functionality gets copied/pasted into several modules.
What is the meaning of using LinearSolver calling dgesv for simulation executables and DgesvSolver duplicating the dgesv calls and introducing errors for FMI export???
Why is DgesvSolver not the default for executables as well, while LinearSolver gets renamed to KluSolver and only implements the sparse part?
comment:5 by , 7 years ago
The Linersolver also uses dgetc2 and dgesc2 from Lapack if the A matrix is singular.
This functions are not include in 3rdParty Dgesv library
comment:6 by , 7 years ago
Priority: | blocker → critical |
---|
OK. LinearSolver also seems to automatically switch between Dgesv and Klu, depending on the availability of sparse information.
The prio of this ticket can be reduced because at least Gcc works under Windows again after the fix in DgesvSolver.
The MSVC issue remains. Please note that, besides compiler version, also the debug settings changed. The former NDEBUG appears more appropriate for FMI export.
comment:7 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:8 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | assigned → accepted |
comment:9 by , 7 years ago
The release and nightly builds are using MSVC version 2013 to build the libs shipped.
I guess that somehow we should have different flags depending on which compiler version OMC detects (or which one is set via the OMEdit settings).
comment:10 by , 7 years ago
You might also specify in the release notes that MSVC 2010 is not supported anymore, but at least 2013. It seems that this finally brings support for C++11 (no -DUSE_CPP_03
anymore).
An important remaining question is why debug settings changed from /MD /D NDEBUG
to /D_DEBUG /MDd
. This means that generated binary code does not run on a standard Windows machine anymore, because debug libs (/MDd
) only come with a development environment!?
Why did the compiler flags change along with the compiler version?
comment:13 by , 7 years ago
The problem was in the makefiles and the invocation of targets we were testing for BUILDTYPE and we build with BuildType=Release
instead of BUILDTYPE=Release
. A bit weird that environment variables are case dependent.
Here is the respective functioning compiler call using OpenModelica 1.11:
It contains:
whereas the non-functioning call of OpenModelica 1.12alpha/nightly contains instead: