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!