-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows #35239
Comments
Adding This would be a nice usability improvement and a good chance to learn about the CMake build system for the MATLAB Interface as a new contributor. |
@sreeharihegden @kevingurney Is this issue resolved? If not, I want to contribute to it!! |
@ShaiviAgarwal2 - thanks for checking. No - this issue has not yet been resolved. Please feel free to contribute! |
@kevingurney We can follow these steps to solve the issue-: Firstly, we will identify the build mode (Debug or Release) that MATLAB is using this can be done by checking the MSVC Runtime library that MATLAB is linked against. If it's a non-debug version, MATLAB is built with Release. If the build mode is Debug, we should display an error message to the user. The error message should clearly state that building in Debug mode is not allowed because MATLAB is built with Release. It should also tell the user to use Release mode instead. After displaying the error message, we should then stop the build process which will prevent the user from accidentally building the project in Debug mode. Finally, the user should switch to Release mode for building the project which can be done from the build configuration settings in Visual Studio. |
@ShaiviAgarwal2 - yes, your understanding seems correct to me. |
…ace to Arrow in Debug mode on Windows
…ace to Arrow in Debug mode on Windows
…ace to Arrow in Debug mode on Windows
…ace to Arrow in Debug mode on Windows
…ace to Arrow in Debug mode on Windows
Describe the enhancement requested
As discussed in this comment thread, when building the Arrow C++ libraries in
Debug
mode on Windows using Visual Studio, the resultingarrow.dll
file will be linked against aMultiThreadedDebugDLL
(i.e./MDd
) version of the MSVC Runtime libraries (e.g.VCRUNTIME140D.dll
- note the D for Debug in the DLL name).This can lead to unexpected behavior (e.g. crashes, memory corruptions, etc.) when linking
arrow.dll
against other code that is built against a different MSVC Runtime (e.g. a non-Debug
version). We ran into this issue when developing the MATLAB interface and linking aDebug
build ofarrow.dll
against a MATLAB MEX function (which is linked against a non-Debug
MSVC Runtime by default).Hence, as @kou suggested here, when building the MATLAB Interface to Arrow in
Debug
mode on Windows, it might be good to report an error such as"You can't build this with Debug because MATLAB is built with Release. You must use Release"
.Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: