help for remexing FAST S-function

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

Zhongyou.Wu
Posts: 9
Joined: Tue Jun 28, 2016 9:11 pm
Organization: University of Texas at Dallas
Location: Richardson, Texas

help for remexing FAST S-function

Postby Zhongyou.Wu » Sun Aug 28, 2016 9:18 pm

Dear Bonnie,

Let me illustrate my problem briefly. Since I plan to introduce extra control variables into FAST, I need to remex FAST S-function to test the controller and run the simulation. Unfortunately, I got a huge trouble on that, which puzzled me for more than two weeks. I have searched and read your instructions carefully (viewtopic.php?f=30&t=1501&p=7316#p7316), but still have no idea on how to solve my problem.

software: MATLAB 7.10.0(R2010a, 32bit), Visual Studio 2010, Visual FORTRAN compiler XE12.0, FAST_v7.02.00d-bjj

I changed the source files path in the file make_FAST_Sfunc.m and modified the intelf12msvs2010shellopts.bat as the following:
bat file2.JPG
bat file page 2
bat file2.JPG (84.49 KiB) Viewed 1443 times

bat file1.JPG
bat file page 1
bat file1.JPG (103.06 KiB) Viewed 1443 times

Running Matlab, I got many *.mod files in the folder and messages like
Matlab information.JPG
matlab message
Matlab information.JPG (67.05 KiB) Viewed 1443 times

Finally, I got the error message like this:
Last edited by Zhongyou.Wu on Sun Aug 28, 2016 9:31 pm, edited 1 time in total.

Zhongyou.Wu
Posts: 9
Joined: Tue Jun 28, 2016 9:11 pm
Organization: University of Texas at Dallas
Location: Richardson, Texas

Re: help for remexing FAST S-function

Postby Zhongyou.Wu » Sun Aug 28, 2016 9:30 pm

The error message from matlab:
matlab error message.JPG
matlab error message.JPG (75.13 KiB) Viewed 1441 times


FYI, I have successfully compiled and got FAST.exe on my computer, which works quite well.

Could you help me point out any errors on my work? Any suggestion is greatly appreciated. Thank you so much.

Zhongyou.Wu

Bonnie.Jonkman
Posts: 566
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: help for remexing FAST S-function

Postby Bonnie.Jonkman » Fri Sep 02, 2016 8:38 am

Zhongyou,

It looks like the code has compiled successfully, but it fails on the linking stage. Unfortunately, I can't tell what exactly the problem is. I'd first check double check your path, include, and lib variables. If they look okay, verify that LINKFLAGS doesn't have anything missing (or anything strange added). You might want to create a very simple example file in Fortran and just see if you can get it to compile and link with the options file you're creating for FAST. There are probably some examples in the Matlab help.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Zhongyou.Wu
Posts: 9
Joined: Tue Jun 28, 2016 9:11 pm
Organization: University of Texas at Dallas
Location: Richardson, Texas

Re: help for remexing FAST S-function

Postby Zhongyou.Wu » Sat Sep 03, 2016 6:12 pm

Hi Bonnie,

Thanks to your suggestion, I finally mexed the FAST S-function after another day's try. For other guys information, I share the solution to my problem.

As you pointed out, the mexing failed on the link stage. The reason for this failure is the error with the path, include, and lib variables. I believe that I did exactly as (viewtopic.php?f=30&t=1501&start=15) . The weired thing was that the path of link.exe was not included in the TmpPath. I do not know why it is.

This time, I did the following things, as the instruction in make_FAST_SFunc.m
1) Install Matlab 2014a;
2) Copy intelf12msvs2010opts.bat from matlab/R2014a/bin/win32/mexopts to the folder where "make_FAST_SFunc.m" is stored;
3) get the path, include, and lib variables as what was suggested in (viewtopic.php?f=30&t=1501&start=15) ;
4) change COMPFLAGS in intelf12msvs2010opts.bat as step 3 in make_FAST_SFunc.m.

Another important thing is that attention should be paid to any error message in Intel command prompt. For me, there was an error message "Cannot determine the location of the VS Common Tools folder" . It can be solved by simply adding a semicolon at the end of windows OS environment variables.

Hope everyone can enjoy the mex process.


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest