Compiling C and Fortran source files in a single call to MEX.
1 次查看(过去 30 天)
显示 更早的评论
I'm having difficulties installing PottersWheel toolbox for Matlab 64-bit. The error message I get is:
Problem detected at 2015-03-29 18:22:24: Error using mex Cannot compile both C and FORTRAN source files in a single call to MEX.
Line 339 of pwCompileFortranIntegrators.p Line 70 of pwInstall.p Matlab 2015a (mexw64) PottersWheel 3.1.2 -------------------------------------------
I followed the instructions exactly from their website and I still get this error. Does anybody know how to fix my problem? Is there a way to manually compile the necessary code?
0 个评论
回答(1 个)
James Tursa
2015-3-30
编辑:James Tursa
2015-3-30
Compile the source code without the mexFunction first using the -c option (compile only). That will produce an object file. Then compile the other source code that does have the mexFunction and include the object file name on the mex command. E.g., suppose you had two files:
myfunction.f <-- the Fortran source file that contains the mexFunction
myroutines.c <-- the C source that contains routines that myfunction uses
The sequence of mex'ing would be:
mex -c myroutines.c
mex myfunction.f myroutines.obj
The .obj is what you would get on a Windows system. You will get a different object extension on other systems.
On older versions of MATLAB, you will have to use mex -setup prior to the mex calls to make sure the proper compiler is selected.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!