- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to a very useful post in this forum, there is now a very simple way to use ifc and MATLAB .mex files together.
Background:
A .mex file is a compiled Fortran (or C) subroutine which is linked in with the MATLAB binary at run-time allowing you to use user-defined pre-compiled code with MATLAB.
It is somewhat of a pain to to interface but MATLAB has good documentation for doing it in Fortran 77.
I had some code in F95 which I wanted to have work with MATLAB as well. The trick in getting it to link is the undocumented -static-libcxa linking option.
Attached is my "mexopts.sh" file. Basically all you need
to change in the 'glnx86' section is FC to
FC='ifc -static-libcxa'
and
LD='ifc -static-libcxa'
For some reason it is not attaching it as mexopts.sh but that is the file name it should be to work in MATLAB.
Background:
A .mex file is a compiled Fortran (or C) subroutine which is linked in with the MATLAB binary at run-time allowing you to use user-defined pre-compiled code with MATLAB.
It is somewhat of a pain to to interface but MATLAB has good documentation for doing it in Fortran 77.
I had some code in F95 which I wanted to have work with MATLAB as well. The trick in getting it to link is the undocumented -static-libcxa linking option.
Attached is my "mexopts.sh" file. Basically all you need
to change in the 'glnx86' section is FC to
FC='ifc -static-libcxa'
and
LD='ifc -static-libcxa'
For some reason it is not attaching it as mexopts.sh but that is the file name it should be to work in MATLAB.
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page