MinGW-w64 compiler not detected

19 visualizaciones (últimos 30 días)
Juergen Baldzuhn
Juergen Baldzuhn el 24 de En. de 2024
Comentada: Juergen Baldzuhn el 25 de En. de 2024
Dear all. When I try to compile the example script "timestwo.F" by entering "mex -R2018a timestwo.F", I obtain the error message "Supported compiler not detected." This simple example is provided by https://de.mathworks.com/help/matlab/matlab_external/build-fortran-mex-file.html.
I work on MATLAB R2023a and installed and implemented MinGW-w62, which should work for FORTRAN, too. My PATH includes C:\WINDOWS and C:\WINDOWS\System32 and C:\WINDOWS\System32\wbem. However, the request "mex.getCompilerConfigurations().Language" gives me only C and C++ as an answer. Looks like a stupid error from my side.
Thanks a lot for your support, Juergen.

Respuesta aceptada

Hassaan
Hassaan el 24 de En. de 2024
  1. Check Compatible Compilers: First, ensure that you have a Fortran compiler that is compatible with MATLAB R2023a. You can find a list of supported compilers for each MATLAB version on the MathWorks website.
  2. Install a Compatible Fortran Compiler: If you don't have a compatible Fortran compiler installed, you will need to install one. Common choices for Fortran compilers that work with MATLAB include Intel Fortran Compiler and GFortran (part of GCC, but you might need a specific version).
  3. Configure the Compiler with MATLAB: Once the compatible compiler is installed, you need to configure it with MATLAB. You can use the mex -setup FORTRAN command in MATLAB to configure the Fortran compiler.
  4. Update System Path: Ensure that the path to the Fortran compiler binaries is added to your system's PATH environment variable. This step is crucial for MATLAB to locate the compiler.
  5. Verify Compiler Configuration: After setting up the compiler, run mex.getCompilerConfigurations('FORTRAN') in MATLAB to verify that MATLAB recognizes the Fortran compiler.
  6. Try Compiling Again: Once the Fortran compiler is set up correctly, try compiling the timestwo.F script again using the mex -R2018a timestwo.F command.
If you continue to have issues, it might be helpful to consult MATLAB's documentation or support resources for additional guidance specific to Fortran compiler setup and troubleshooting.
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
It's important to note that the advice and code are based on limited information and meant for educational purposes. Users should verify and adapt the code to their specific needs, ensuring compatibility and adherence to ethical standards.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.
  1 comentario
Juergen Baldzuhn
Juergen Baldzuhn el 25 de En. de 2024
Hallo Muhammad.
Thanks a lot for your detailed answer. Your support is highly appreciated,
Juergen.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Fortran with MATLAB en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by