C/C++ compiler gcc VS MinGW64
12 views (last 30 days)
Show older comments
Hi experts,
I am running a matlab code that needs to use ba_interp3.cpp. When under windows on my desktop, I do mex -O ba_interp3.cpp; then the rest codes work and I can get reasonable results. Under windows, the C/C++ compiler is MinGW64. But when I try to run the code on a supercomputer (Linux system) so that I am able to run larger simulations, I have to use gcc C/C++ compiler. The supercomputer does not support MinGW64. Although no error appears and MEX completes successfully, I always get unrealistic results at the end. I suspect that the compiler is causing problems. Is there anyone who knows why?
Thanks
0 Comments
Accepted Answer
Naren
on 2 Mar 2023
It’s possible that the use of a different compiler on the supercomputer is causing issues with the ba_interp3.cpp code, leading to unexpected or incorrect results. Additionally, there may be differences in the operating system or hardware between the desktop and the supercomputer that could also be contributing to the issue. It’s important to ensure that all dependencies and libraries required by the code are installed and properly configured on the supercomputer, and to verify that the code is compatible with the compiler and operating system being used.
One possible solution is to use a compatible C/C++ compiler on the Linux system, such as the GNU compiler (GCC) or Clang. You can specify the compiler to use in the mex command by setting the “CC” flag, for example:
Mex -O -v CC=gcc ba_interp3.cpp
You may also need to specify any required compiler flags and library paths for your specific system. It’s important to ensure that the compiler and any required libraries are compatible with your MATLAB version and architecture.
Hope this resolves your issue.
More Answers (0)
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!