Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Matlab-ASWing interface issue #1

Open
tvchar opened this issue Mar 1, 2019 · 14 comments
Open

Matlab-ASWing interface issue #1

tvchar opened this issue Mar 1, 2019 · 14 comments

Comments

@tvchar
Copy link

tvchar commented Mar 1, 2019

Hi

Matlab is not able to execute ASWing even after the recommended changes being made to the source files. Please suggest this procedure in some detail.

Thanks

@vishvassamuel
Copy link
Contributor

Thank you for reaching out.

Have you verified you are able to run ASWING from the command line?

If you are able to run ASWING by hand please verify your path is set up correctly. If running on Windows, please verify XROTOR, XFOIL and ASWING are on your system path. If running on MacOS, please verify XROTOR, XFOIL and ASWING are in your Matlab path.

Once this is done you can verify setup is complete by running FBHALE/Tools/CheckSystem.m. It should help guide you through any additional setup issues.

If you are passing CheckSystem.m and still having issues please let us know.

-FBHALE team

@tvchar
Copy link
Author

tvchar commented Mar 4, 2019

Hi
Thank you for taking time to reply.
We ran CheckSystem.m after adding system paths. It returns logical true value along with the message in the command window, 'was unexpected at this time'.

However, we tried one of the configuration files, Flying Wing. The code works perfectly and the design loop converges (taking default ASWing.exe file) . The sensor data generated was by 44 sensors. Even after making changes in the source code of ASWing for the number of sensors to be 60, the MATLAB code throws an error because ASWing crashes (default number of sensors taken to be 36).

We're unable to generate .exe file for the modified ASWing source code. This is where we're facing issues.

@vishvassamuel
Copy link
Contributor

To generate an exec file for ASWING in windows, we removed X-window graphics support, because the MDO tool does not require it. In gw_subs.f, remove all lines of code inside every subroutine. Keep the subroutine container statements intact, i.e. ensure subroutines appear as follows:

subroutine xxxxx
return
end

We used ifort (intel) to compile in windows. Gather all *.f files from your aswing source. Download ARPACK *.f files from https://www.caam.rice.edu/software/ARPACK/. Collect all *.f files in one folder and execute: ifort /O3 *.f This should make an aswing exe file. Ensure the file is on your system path by verifying in command-line.

@tvchar
Copy link
Author

tvchar commented Mar 8, 2019

Hi
I did the required changes in the gw_subs.f. Then gathered all the *.f files from ASWING and ARPACK folder, put it in one folder and executed the mentioned command in ifort command window. In the command window, it displayed that none of the .f files can be opened.
abc

@vishvassamuel
Copy link
Contributor

Please try this alternative build method. In a folder, collect all your aswing source files as before. Once you've extracted the ARPACK zip, copy the ARPACK directory (and subdirectories) into the aswing folder. Run this command: ifort /O3 *.f ARPACK\BLAS*.f ARPACK\LAPACK*.f ARPACK\SRC*.f ARPACK\UTIL*.f

Please let me know if that works.

@tvchar
Copy link
Author

tvchar commented Mar 11, 2019

I tried this method, but its not working. At the beginning a few .f files cannot be executed and then stops while executing bode.f.

I tried an alternative, and generated the .a files from ARPACK and Plotlib namely 'libarpack_SUN4.a' and 'libplt.a', and linked their path for executing aswing makefile (Makefile_ifort). Then using the command 'nmake /f Makefile_ifort', various output .o files are generated. But I face an error with the line 'PLTLIB = -L/usr/X11R6/lib -lX11'.

I also tried using Cygwin, but face a 'fatal error: ld terminated with signal 11' error at the final stage of execution and it ends up generating a 0kb executable file.

I am wondering if the aswing makefiles are unix based only and/or if they can create an executable file for windows platform?

Please help me out here with your suggestions.
Thank you

@vishvassamuel
Copy link
Contributor

Can you tell us what the errors are for the first few *.f files? Please list the output as you did previously. It's best to compile these files directly using ifort rather than the makefiles. Please make sure you place the fortran include files also from aswing's source in the same directory where you plan to compile. These are files with extension *.INC.

@tvchar
Copy link
Author

tvchar commented Mar 12, 2019

I had copied all the aswing/src file and the ARPACK folder into a directory and executed the command: ifort /O3 .f ARPACK\BLAS.f ARPACK\LAPACK*.f ARPACK\SRC*.f ARPACK\UTIL*.f
There was an error at first 'ARPACK\BLAS*.f file not found'. But upon giving the command as:
ifort /O3 *.f ARPACK\BLAS *.f ARPACK\LAPACK *.f ARPACK\SRC *.f ARPACK\UTIL *.f
(adding spaces before *.f) it started running.

Still here are the errors that came up.
Capture

Here are how all the files are placed and the .o files that are being generated.
image

@vishvassamuel
Copy link
Contributor

vishvassamuel commented Mar 12, 2019

Backslashes are missing. Please try this: ifort /O3 *.f ARPACK\BLAS*.f ARPACK\LAPACK*.f ARPACK\SRC*.f ARPACK\UTIL*.f

Another tip:
If you encounter errors associated with missing libraries such as kernel32.lib, you'll need to download Windows SDK per your OS version . After installation, look for kernel32.lib, uuid.lib, libucrt.lib and Imagehlp.lib in the SDK installation folder (eg: C:\Program Files\Windows Kits...). There will be multiple copies of these files. Pick the one in the folder tree associated with your architecture, i.e., x64/x86/etc. Copy these four files to your aswing source directory.

@tvchar
Copy link
Author

tvchar commented Mar 13, 2019

My mistake with the backslashes.
I corrected the command: ifort /O3 *.f ARPACK\BLAS*.f ARPACK\LAPACK*.f ARPACK\SRC*.f ARPACK\UTIL*.f
I followed as mentioned, and am facing with the following errors:
image

The last 5 errors primarily.

@vishvassamuel
Copy link
Contributor

Please do not include the examples folder. i.e., plotlib\examples. Also exclude seconds_g77.f and seconds_ifc.f. Regarding the last 5 errors, are you sure the pruned version of gw_subs.f is placed in the directory? These are all function calls to gw_subs.f.

@tvchar
Copy link
Author

tvchar commented Mar 13, 2019

Thank you for all your patience, time and guidance!
I faced a few errors after this, but on removing the unnecessary files I was able to generate the executable file.
The MDO ran smoothly with the file.
Thank you.

@tvchar
Copy link
Author

tvchar commented Mar 29, 2019

Hi
Could you please let me know what reference frame has been used in Mission performance?

@LeeElvis
Copy link

Thank you for all your patience, time and guidance!
I faced a few errors after this, but on removing the unnecessary files I was able to generate the executable file.
The MDO ran smoothly with the file.
Thank you.

Thank you for all your patience, time and guidance!
I faced a few errors after this, but on removing the unnecessary files I was able to generate the executable file.
The MDO ran smoothly with the file.
Thank you.

Hi,
I also faced the same errors as you after input the command: ifort /O3 .f ARPACK\BLAS.f ARPACK\LAPACK*.f ARPACK\SRC*.f ARPACK\UTIL*.f , then it comes out the error: File not found: 'ARPACK\BLAS*.f'.
Then I changed the command: ifort /O3 *.f ARPACK\BLAS*.f ARPACK\LAPACK*.f ARPACK\SRC*.f ARPACK\UTIL*.f ,the error became as follows:
image
Could you give me some advice to fix this problem?
Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants