Path: news.mathworks.com!not-for-mail
From: "Charan " <boyacharan@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: MEX basics help ; URGENT !!
Date: Tue, 18 Dec 2007 05:18:37 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 119
Message-ID: <fk7l7d$fib$1@fred.mathworks.com>
Reply-To: "Charan " <boyacharan@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1197955117 15947 172.30.248.38 (18 Dec 2007 05:18:37 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Dec 2007 05:18:37 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 618521
Xref: news.mathworks.com comp.soft-sys.matlab:442862



I am a newbie to MEX functions. 

I took the timestwo.f in the help in Matlab and tried to run
the function but i got the following error.

I also bought a Intel Fortran Compiler 10.1(academic
version). The steps I followed are as follows:

1) Mex- setup

2) the compiler was not in the list (Intel fortran 9.0 was
only there)

3) so I changed the directory when it asked me to verify the
location of the compiler to THE DIRECTORY of FORTRAN 10.1

then  after loading the complier (screen output for these
steps are shown below the error portion)

4) when I typed "mex timestwo.f" we got the following error

I really appreciate your help 

Thanks,
Charan


//---------------------error output------------------------
 
>> mex timestwo.f
timestwo.f(15) : Error: Syntax error, found ',' when
expecting one of: <END-OF-STATEMENT> ; 
      integer nlhsx=2, nrhs 
---------------------^ 
timestwo.f(16) : Error: A specification statement cannot
appear in the executable section. 
      integer m, n, size 
------^ 
timestwo.f(17) : Error: A specification statement cannot
appear in the executable section. 
      real*8 x, y 
------^ 
compilation aborted for timestwo.f (code 1) 
 
  C:\PROGRA~1\MATLAB\R2007B\BIN\MEX.PL: Error: Compile of
'timestwo.f' failed. 
 
??? Error using ==> mex at 208
Unable to complete successfully.
------------------------------------------------------------

>> mex -setup
Please choose your compiler for building external interface
(MEX) files: 
 
Would you like mex to locate installed compilers [y]/n? n
 
Select a compiler: 
[1] Borland C++ Compiler (free command line tools) 5.5 
[2] Borland C++Builder 6.0 
[3] Borland C++Builder 5.0 
[4] Compaq Visual Fortran 6.1 
[5] Compaq Visual Fortran 6.6 
[6] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker) 
[7] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005
linker) 
[8] Intel Visual Fortran 9.0 (with Microsoft Visual C++ 2005
linker) 
[9] Intel Visual Fortran 9.0 (with Microsoft Visual C++ .NET
2003 linker) 
[10] Lcc-win32 C 2.4.1 
[11] Microsoft Visual C++ 6.0 
[12] Microsoft Visual C++ .NET 2003 
[13] Microsoft Visual C++ 2005 
[14] Microsoft Visual C++ 2005 Express Edition 
[15] Open WATCOM C++ 1.3 
 
[0] None 
 
Compiler: 9
 
The default location for Intel Visual Fortran compilers is
C:\Program Files (x86)\Intel\Compiler\Fortran\9.0, 
but that directory does not exist on this machine.  
 
Use C:\Program Files (x86)\Intel\Compiler\Fortran\9.0 anyway
[y]/n? n
Please enter the location of your compiler: [C:\Program
Files (x86)\Intel\Compiler\Fortran\9.0] C:\Program
Files\Intel\Compiler\Fortran\10.1.011
 
Please verify your choices: 
 
Compiler: Intel Visual Fortran 9.0 
Location: C:\Program Files\Intel\Compiler\Fortran\10.1.011 
 
Are these correct?([y]/n): y
 
***************************************************************************

  Warning: The Intel Visual Fortran 9.0 compiler is being
phased out 
           and will not be supported in a future release.  
           For a list of currently supported compilers see:  
          
http://www.mathworks.com/support/tech-notes/1600/1601.html 
***************************************************************************

 
Trying to update options file: C:\Documents and
Settings\Akhil\Application
Data\MathWorks\MATLAB\R2007b\mexopts.bat 
From template:             
C:\PROGRA~1\MATLAB\R2007b\bin\win32\mexopts\intelf90msvs2003opts.bat

 
Done . . . 

-----------------------------------------------------------