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!