Azzera filtri
Azzera filtri

C/C++ compiler gcc VS MinGW64

22 visualizzazioni (ultimi 30 giorni)
Yulai Zhang
Yulai Zhang il 24 Gen 2023
Commentato: Yulai Zhang il 6 Mar 2023
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

Risposta accettata

Naren
Naren il 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.
  1 Commento
Yulai Zhang
Yulai Zhang il 6 Mar 2023
Thank you Naren.
I tried what you suggested and also tried different versions of gcc available. There were still problems. Maybe there were other stuff causing problems.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by