You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "sreeharihegden (via GitHub)" <gi...@apache.org> on 2023/04/19 21:54:43 UTC

[GitHub] [arrow] sreeharihegden opened a new issue, #35239: [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows

sreeharihegden opened a new issue, #35239:
URL: https://github.com/apache/arrow/issues/35239

   ### Describe the enhancement requested
   
   As discussed in [this comment thread](https://github.com/apache/arrow/pull/34563#discussion_r1167214786), when building the Arrow C++ libraries in `Debug` mode on Windows using Visual Studio, the resulting `arrow.dll` file will be linked against a [`MultiThreadedDebugDLL` (i.e. `/MDd`) version](https://cmake.org/cmake/help/latest/prop_tgt/MSVC_RUNTIME_LIBRARY.html) of the [MSVC Runtime libraries](https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features) (e.g. `VCRUNTIME140D.dll` - note the **D** for **D**ebug 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](https://github.com/apache/arrow/pull/34563#discussion_r1160962568) and linking a `Debug` build of `arrow.dll` against a [MATLAB MEX function](https://www.mathworks.com/help/matlab/call-mex-functions.html) (which is linked against a non-`Debug` MSVC Runtime by default). 
   
   Hence, as @kou suggested [here](https://github.com/apache/arrow/pull/34563#discussion_r1167280545), 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows [arrow]

Posted by "kevingurney (via GitHub)" <gi...@apache.org>.
kevingurney commented on issue #35239:
URL: https://github.com/apache/arrow/issues/35239#issuecomment-1881733305

   @ShaiviAgarwal2 - thanks for checking. No - this issue has not yet been resolved. Please feel free to contribute!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kevingurney commented on issue #35239: [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows

Posted by "kevingurney (via GitHub)" <gi...@apache.org>.
kevingurney commented on issue #35239:
URL: https://github.com/apache/arrow/issues/35239#issuecomment-1681034504

   Adding `good-first-issue` and `good-second-issue` labels.
   
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows [arrow]

Posted by "ShaiviAgarwal2 (via GitHub)" <gi...@apache.org>.
ShaiviAgarwal2 commented on issue #35239:
URL: https://github.com/apache/arrow/issues/35239#issuecomment-1882569773

   @kevingurney 
   According to my understanding, the issue arises because the resulting arrow.dll file is linked against a [MultiThreadedDebugDLL (i.e., /MDd) version](url) of the MSVC Runtime libraries. 
   
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows [arrow]

Posted by "kevingurney (via GitHub)" <gi...@apache.org>.
kevingurney commented on issue #35239:
URL: https://github.com/apache/arrow/issues/35239#issuecomment-1883251606

   @ShaiviAgarwal2 - yes, your understanding seems correct to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [MATLAB] Report error when building the MATLAB Interface to Arrow in Debug mode on Windows [arrow]

Posted by "ShaiviAgarwal2 (via GitHub)" <gi...@apache.org>.
ShaiviAgarwal2 commented on issue #35239:
URL: https://github.com/apache/arrow/issues/35239#issuecomment-1881195507

   @sreeharihegden @kevingurney Is this issue resolved? If not, I want to contribute to it!!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org