Comments (2)
I finally tried to have a look at this bug. I'm not very familiar with building on Windows, but I believe this is due to the subtleties of C++ DLLs in Windows.
How the DACE DLL is built (Release/RelWithDebInfo or Debug), determines which executables can link with it. This seems to be due to the passing of std:: classes between the DLL and the executable.
With a Debug package installed, building your code from the command line using cl /I "C:\Program Files\DACE 2.0\headers\include" test.cpp "C:\Program Files\DACE 2.0\lib\dace.lib"
, i.e. with release settings, causes the executable to crash with an out of bounds error inside the evalScalar() call. Debugging it, the problem is that the C++ interface between the code in the executable (evalScalar(), instantiated from a template), and the code in the DLL (eval()) don't seem to use the same interface. In the executable, a temporary std::vector objects created has the correct size (1), but once passed to the DLL, the DLL inside eval() sees them as size 0 and consequently crashes.
When compiling the executable with the same debug parameters as the Debug DLL
cl /I "C:\Program Files\DACE 2.0\headers\include" test.cpp "C:\Program Files\DACE 2.0\lib\dace.lib" /EHsc /Zi /RTC1 /MDd
the code runs fine and produces the correct result.
Your problem is the inverse: When the DLL is built as Release, but the executable is built as debug, (as above), the error you describe happens. It is less obvious (as it doesn't crash), but I'm sure the problem stems from the same issue.
I played around a bit, and it seems the exact switch that breaks it is /MDd (something about multithreaded debugging). Compiling the executable without that, but the other debug switches mentioned above, yields correct results when linking with a non-debug DACE DLL.
In short, on Windows it seems the safest way to ensure correct results is to ensure the DACE DLL is only ever linked to the same build type used when building the DLL.
I don't know enough about Windows debug details to suggest a fix for this, although it seems many Windows system libraries come in different versions for the various debug options.
from dace.
Whoops, didn't mean to close this issue, but for the time being I don't think we'll have a solution.
from dace.
Related Issues (18)
- Error When Using Version 2.0 HOT 6
- Different Results for the Same Expression HOT 5
- Strange result for the eval() function HOT 2
- Compilation Error HOT 2
- Build documentation in CMake
- Build Mac OS X Framework
- How to load a DA object from file? HOT 1
- Add automatic unit test suite
- Add Tutorials to the binary packages HOT 1
- Tutorial1/Example7 crash HOT 2
- Bug append operator HOT 2
- Error while reading `AlgebraicVector`s from text file HOT 3
- Wrong hyperbolic tangent for argument >> 0 HOT 2
- Floating point exception handling
- Problem running Tutorial1/Example7 HOT 1
- Wrong output allocation in matrix/vector product HOT 1
- Estimation of order sorted norms returns `nan` when zero is expected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dace.