fortran 90 mex on Mac
6 次查看(过去 30 天)
显示 更早的评论
I have some fortran 90 code and I have written a mex gateway function for it. Everything compiled and worked OK under Windows. Now I tried compiling on a mac and I run into some problems.
First hurdle was making mex work with the provided examples (yprimef.F). Thanks to some previous posts, after editing my mexopts.sh, I managed to compile and the example seems to work OK.
However, when I try to mex my .f90 files (which are in free-form source), I get the following:
Warning: FD_CVg.f90:1: Illegal preprocessor directive
Warning: FD_CVg.f90:56: Illegal preprocessor directive
Warning: FD_CVg.f90:67: Illegal preprocessor directive
FD_CVg.f90:17.6:
MWPOINTER PLHS(*), PRHS(*)
1
Error: Unclassifiable statement at (1)
FD_CVg.f90:27.6:
MWPOINTER MXCREATEDOUBLEMATRIX, MXGETPR
1
Error: Unclassifiable statement at (1)
FD_CVg.f90:32.6:
MWSIZE MXGETM, MXGETN
1
Error: Unclassifiable statement at (1)
FD_CVg.f90:41.6:
MWPOINTER tp,ndp,nap,edp,eap,eoxp,toxp,skindp,qfp,fmp,vgminp, &
1
Error: Unclassifiable statement at (1)
FD_CVg.f90:49.6:
MWSIZE M, N, NEL
1
Error: Unclassifiable statement at (1)
... and so on ...
the lines 1, 56 and 67 that trigger warnings are:
#include <fintrf.h>
#if defined MSWIND
#endif
respectively.
Any suggestions how to fix that?
(Using gfortran with xcode 3.2 on Mac OS X 10.6.8 with 64 bit matlab)
0 个评论
采纳的回答
fabio freschi
2011-10-29
The preprocessor directives are not recognized. If your gfortran version supports the -cpp (C PreProcessor) flag, use it. Otherwise just change the file extension to F90 (uppercase F): the preprocessor is automatically invoked.
Fabio
更多回答(3 个)
James Tursa
2011-10-24
Is there a "/fixed" option (or similar) on the COMPFLAGS line in the mexopts file? If so, remove it. That is the typical problem with compiling free format source code on PC's. Don't know if this applies to mac or not.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!