Using Mex with .a and .lib libraries
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I've got some code in C++ and Fortran that, using CMake, creates a set of libraries. I want to use mex to link these libraries to a mex file so that I can communicate with these libraries from Matlab. My issue is that some of the code needs to use Boost, and some of the code is in Fortran. Those characteristics, along with the fact that I'm using a Windows 7 machine (much prefer Linux, especially after this experience...) have forced me through some hoops.
Boost Code
Because of permissions on the machine that I'm using (permissions that cannot be overridden), I cannot install Boost on the machine that I'm using. I was able to download Boost binaries that were compiled in Visual Studio. Using those binaries, I was able to compile this section of code using Visual Studio. The result was a set of .lib files.
Fortran Code
Unfortunately, the version of Visual Studio that I have does not have a Fortran compiler. Further, the Visual Studio Fortran compiler is, apparently, not free, so I ain't getting it. I was able to install MinGW with gfortran, though, and I was able to use this to compile the code pieces with Fortran. The result was a couple .a files.
Now I want to create a mex file, but I want to link in both the .lib files and the .a files. It seems that I can use the .lib files fine, but I can't get Matlab to link in the .a files appropriately. Does anyone know how I could do this? Or how I could get around this issue? I think it would be possible for me to build all parts of the code using MinGW (with a bit of maneuvering), but I'd still have the issue of using .a files. I would really appreciate any help. Thank you!
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Fortran with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!