replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - MATLAB 7.5.0 (R2007b)
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MATLAB 7.5.0 (R2007b)

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
jjgermis



Joined: 21 Jun 2006
Posts: 404
Location: N�rnberg, Germany

PostPosted: Wed Nov 07, 2007 9:17 am    Post subject: MATLAB 7.5.0 (R2007b) Reply with quote

Hello,

I have upgraded from MATLAB 6.5 to MATLAB 7.5 and get the following message when running mex -setup from the MATLAB command line:

Please choose your compiler for building external interface (MEX) files:

Not an ARRAY reference at D:\Programs\MATHWO~1\bin\/mexsetup.pm line 614.
??? Error using ==> mex at 208
Unable to complete successfully.

When I remove the files SF95opts.bat and SF95opts.stp from the above directory the mex execution is fine. It seems like the files with the compiler options needs an upgrade as well.

Do I need to change the above mentioned files?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Thu Nov 08, 2007 8:50 am    Post subject: Reply with quote

I don't think that we can help you with this query unless and until we get a copy of this version of MATLAB.

Other MATLAB users may be able to help.
Back to top
View user's profile Send private message AIM Address
jjgermis



Joined: 21 Jun 2006
Posts: 404
Location: N�rnberg, Germany

PostPosted: Sun Nov 18, 2007 11:22 am    Post subject: Compiler options Reply with quote

Hi,

from the number of views it seems that there might be some interest to this topic. I still did not found a solution to my problem. Maybe someone else is in the same situation than I. Anyway here is what I have figured out:

    A good starting point to use FTN95 with Matlab: http://forums.silverfrost.com/viewtopic.php?t=219
    Read the following in the Matlab documentation: Building MEX-Files
    Custom Building MEX-Files
    Work through the following example in the Matlab documentation: Fortran MEX-Files

The Matlab documentation along with FTN95 example and Matlab Version 6.5 give some insight into what is happening.

When running mex -setup in Matlab Version 7.5 it seems that the perl script has some problems with the SF95opts.stp file. The latter contains compiler information and the default location of FTN95.exe. Basically what should happen by performing mex -setup is that the content of SF95opts.bat should be copied into the mexopts.bat in the Matlab ..\bin\win32\ directory.

I suppose that by doing this by hand should solve my problem Wink

Jacques
Back to top
View user's profile Send private message
Karthik23



Joined: 29 May 2014
Posts: 6

PostPosted: Thu May 29, 2014 9:43 am    Post subject: Compiler Options Reply with quote

Hi jjgermis,

I encountered the same problem during mex -setup. I'm using Matlab R2012a, Windows7 (64bit).

However, I do not have a mexopts.bat located in the mexopts folder. I also do not know which part of S95opts.bat to append into mexopts.bat.

Do you have any idea?

Karthik
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Thu May 29, 2014 9:36 pm    Post subject: Reply with quote

The Mex Perl scripts provided by Mathworks come prepared to work with only a small number of "approved" compilers. If you wish to use a different compiler, your chances of success are far better if you build the MEX files outside of Matlab (without using the Mex Perl script).

I downloaded the file mentioned in http://forums.silverfrost.com/viewtopic.php?t=219, and was able to build a MEX DLL at the command line using FTN95 7.0 and the command line script build.bat, and the DLL worked with Matlab 2007b correctly.
Back to top
View user's profile Send private message
Karthik23



Joined: 29 May 2014
Posts: 6

PostPosted: Fri May 30, 2014 3:15 am    Post subject: Reply with quote

Hi mecej4, Thanks for replying. Can you provide us with the command that you used. Would be really grateful.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Fri May 30, 2014 4:44 am    Post subject: Reply with quote

To build the example included in [url="http://www.silverfrost.com/public_downloads/MatLab.zip"]here[/url], set MATDIR to the path to the root directory of Matlab, then use the commands

ftn95 timestwo.f /DREAL
slink -dll -export:_MEXFUNCTION@16=MEXFUNCTION timestwo.obj %MATDIR%\bin\win32\libmx.dll %MATDIR%\bin\win32\libmex.dll

Run Matlab from the Silverfrost FTN95 command window, and test the DLL just produced using the command

a=timestwo(2.5)
Back to top
View user's profile Send private message
Karthik23



Joined: 29 May 2014
Posts: 6

PostPosted: Mon Jun 02, 2014 2:32 am    Post subject: Reply with quote

Sorry if its a stupid question but how do you set MATDIR to the path root of Matlab? I tried typing in
Code:
set MATDIR
in the command window of FTN95, but it says
Code:
command set is not valid
.

By the way, I'm using FTN95 Express and my Matlab is found in C:\Program Files\MATLAB\R2012a.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Mon Jun 02, 2014 4:33 am    Post subject: Reply with quote

The command is "set matdir=C:\Program Files\MATLAB\R2012a" for your set up, but there is something wrong if you got the response "command set is not valid". Are you working in the command window (cmd.exe) configured for use with FTN95?
Back to top
View user's profile Send private message
Karthik23



Joined: 29 May 2014
Posts: 6

PostPosted: Mon Jun 02, 2014 4:55 am    Post subject: Reply with quote

No. I wasn't using cmd.exe, instead I was using the command window of FTN95.

Currently, I have tried the command on cmd.exe, but it doesn't work also. I guess my cmd.exe is not configured for use with FTN95. How do I then configure it with FTN95 and how do i check if its configured?

Thanks
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Mon Jun 02, 2014 9:02 am    Post subject: Reply with quote

You can run FTN95 directly from a command prompt window provided that the compiler folder for FTN95 (normally C:\Program Files...\Silverfrost\FTN95) is on the PATH environment variable.

Just type "PATH" from a command prompt window to see if the Silverfrost folder is present in the list.
Back to top
View user's profile Send private message AIM Address
Karthik23



Joined: 29 May 2014
Posts: 6

PostPosted: Mon Jun 02, 2014 10:09 am    Post subject: Reply with quote

Thanks Paul. I managed to set it on my PATHVARIABLE and managed to compile timestwo.f into an object.

However, now command prompt could not open libmex.dll or libmx.dll during the linking step.

Code:
***Could not open: c:\"program files"\matlab\r2012a\bin\win64\libmex.dll
^C


Could this be due to the difference in the 32 and 64 bits used by mecej4?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1899

PostPosted: Mon Jun 02, 2014 12:46 pm    Post subject: Reply with quote

It is now evident that your installed Matlab is a 64-bit version. If so, you need a compiler capable of producing 64-bit DLLs. Silverfrost/Salford FTN95 is not such a compiler.
Back to top
View user's profile Send private message
Karthik23



Joined: 29 May 2014
Posts: 6

PostPosted: Tue Jun 03, 2014 1:46 am    Post subject: Reply with quote

Oh ok. Thanks anyhow.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group