Build guidelines for Windows

863 views
Skip to first unread message

Trevor Laughlin

unread,
Sep 23, 2016, 12:30:20 PM9/23/16
to OpenVSP
Hello all,

I made my first real attempt at compiling VSP + Python API and documented the process along the way. The attached document outlines the tools and procedures I used to generate the VSP executable as well as the Python API. I tried to attach a zip file with the executable and Python files but it exceeded the limit. I can email it to you if you want. I'd like to know if these results are distributable or not. A colleague at GT successfully launched the pre-built VSP and Python API from a 64 bit Windows 7 machine running the same version of Python. This is the first C project I've ever built, and I'd like to make the results as useful as possible to the community.

Perhaps this will serve as the start of more formally collecting the build instructions for VSP and the Python API, there seemed to be a lot of interest for that capability at the workshop.

Known issue: I thought I was home free but I was experimenting more with my build and found that most of the tools in the Analysis tab cause VSP to fatally crash....help?

Feedback is welcome and appreciated.

Regards,

Trevor
OpenVSP compile guidelines-Windows 10 64-VS 2015.pdf

Trevor Laughlin

unread,
Sep 23, 2016, 3:13:01 PM9/23/16
to OpenVSP
Already an update to fix one thing and introduce another issue...

Initially I selected "Visual Studio 14 2015 Win64" during the CMake process and none of the Analysis tools worked as described in above post. This time I selected "Visual Studio 14 2015" for each build and OpenVSP successfully compiled with working Analysis tools (tested planar slice, VSP aero, and CFD mesh).

Now the (anticipated) problem...

This breaks the Python API for me because I have a 64-bit Python installation and it can't link the 64-bit Python libs with the 32-bit OpenVSP application, which makes sense. Visual Studio tells me:

python35.lib(python35.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

My solution will probably be to downgrade to a 32-bit Python installation, but I'll need to verify some other projects that currently use some mingw-w64 tools can be converted to 32-bit compilers (it shouldn't be an issue). or anyone starting fresh, I would suggest a 32-bit Anaconda Python installation of 2.7 or 3.5, and use an environment within Anaconda to create the other if you need it. If anyone is able to verify this all works before I do please share.

The original documentation hasn't been updated so beware of some of the comments and screenshots, although the procedure is valid.

Rob McDonald

unread,
Sep 23, 2016, 3:23:23 PM9/23/16
to ope...@googlegroups.com
Thanks for the update Trevor.

The default Mac and Linux builds are both 64-bit, so I don't think
there should be any glaring problems.

I recall experimenting once or twice with Windows 64-bit builds, but I
don't think I've tested them much beyond seeing that they build.

Do you have write access to the Wiki? If not, I would be happy to
give you access -- in general, I would hope that would become the home
for most documentation. I had to disallow self-registration as the
SPAM vandalism was intolerable.

Rob
> --
> You received this message because you are subscribed to the Google Groups
> "OpenVSP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openvsp+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Trevor Laughlin

unread,
Sep 23, 2016, 3:48:51 PM9/23/16
to OpenVSP
Hi Rob,

No I do not have write access to the Wiki. But I'd be more than happy to post these guidelines there after any feedback.

Not sure what is happening to the Analysis tools in the 64-bit on my platform. I'll give this thread some time before I jump to the 32-bit Python in case someone has a solution.

Thanks,
Trevor

Trevor Laughlin

unread,
Sep 29, 2016, 6:04:42 PM9/29/16
to OpenVSP
Another version of the instructions with a few minor changes. I'll let this sit for a while in case anyone has any feedback, then clean it up and put it on the Wiki if it seems stable.


On Friday, September 23, 2016 at 12:30:20 PM UTC-4, Trevor Laughlin wrote:
OpenVSP compile guidelines-Windows 10 64-VS 2015.docx
OpenVSP compile guidelines-Windows 10 64-VS 2015.pdf

Rob McDonald

unread,
Sep 30, 2016, 5:45:28 PM9/30/16
to ope...@googlegroups.com
Generally, that looks like a good walkthrough. Thanks much for the effort.

When you run CMake on the Libraries, you should also set

CMAKE_BUILD_TYPE=Release

Like you do for VSP itself -- and yes, still choose Release from the
Visual Studio pull-down.

FLTK's build system does not 'install' everything when it is built in
Debug mode, so the CMake search doesn't fully work. So, hopefully
being sure to do this will mean you don't have to add the FLTK path
when you run CMake on VSP.

Theoretically, the FLTK project is converging towards a new stable
release (1.3.4). When they get close to that, I will incorporate it
into a test branch on GitHub and will try to test on as many platforms
as possible. FLTK's new releases come out very seldom, so it will be
worth putting in significant effort to try to fix all the build issues
we can for 1.3.4. In fact, the FLTK project is looking to be more
ambitious about the next version -- the build system changes would be
a big improvement, but it may also take years to get to another stable
release.

I haven't had a chance to mess with a 64-bit build on Windows yet,
hopefully that is something fixable. Does it crash? Give any
messages? Any common thread to the behavior?

When you bring this guide to the Wiki, I think it would be great to
break it into three parts. 1) Building vanilla OpenVSP on a Windows
machine. 2) Also building with SWIG and Python. 3) Using the Python
Library to do cool stuff.

It is very possible that we will try to support more SWIG targets down
the road. People have already had varying levels of success using
SWIG to get Java, C#, and Matlab talking to the OpenVSP API. It is
very likely that any particular user may be interested in one of those
bindings -- but not all of them. So, making the documentation modular
makes sense to me.

In addition to updating the Wiki, it would also be great if you could
make a pass through the README and update it to match your experience
wherever it is lacking.

Rob

Trevor Laughlin

unread,
Oct 2, 2016, 10:05:40 PM10/2/16
to OpenVSP
Thanks Rob. Do you have a preference on just providing a link to the doc or putting the instructions directly on the Wiki?

Also, attached are a few snapshots from the error messages I get after opening the VS debugger. I haven't really dug into it, but just in case they mean something to you. I'll take another pass at it in the near-future.

Trevor
error1.JPG
error2.JPG

Rob McDonald

unread,
Oct 2, 2016, 11:59:36 PM10/2/16
to ope...@googlegroups.com
I'd prefer to have the documentation 'native' in the Wiki. That way,
anyone with access can easily go in and make updates.

Those screenshots don't mean anything -- if you're running a debug
build, then seeing where execution stops may be interesting.

Rob

On Sun, Oct 2, 2016 at 10:05 PM, Trevor Laughlin

Trevor Laughlin

unread,
Oct 3, 2016, 12:53:52 AM10/3/16
to OpenVSP
Ok I'll plan on putting then on the Wiki then.

Attached is a quick screenshot from a debug build. I have no experience with C debugging, but it always seems to stop in the triangle.c file. I tried to do a planar slice to get this error. Seems there is an "unable to read memory" under the vertexloop variable. I did a quick scan of the triangle source and it actually recommends 64-bit builds, so I doubt it's something native to triangle. I'll keep playing with it. Let me know if there is any other useful info you could use.

Thanks,

Trevor
error3.JPG

ANGUPRAVEEN PRAVEEN

unread,
May 13, 2019, 9:19:42 AM5/13/19
to OpenVSP
Dear Trevor and Rob,

Thanks to your post and the detailed report, i was successfully able to import vsp into my spyder. But, im not sure if my import is working fine. Although there are no errors after the import command and the test.py file runs successfully and generate apites1.vsp3 and apitest2.vsp3, i get the following error when i try to run my file BWB.py. The error is the following



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

runfile('E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py', wdir='E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD')
Reseting OpenVSP Model in Memory
VSP import failed
VSP import failed
Traceback (most recent call last):

  File "<ipython-input-85-186f7cb5745b>", line 1, in <module>
    runfile('E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py', wdir='E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD')

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
    execfile(filename, namespace)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py", line 925, in <module>
    main()

  File "E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py", line 31, in main
    simple_sizing(configs)

  File "E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py", line 713, in simple_sizing
    wing.areas.wetted   = wetted_areas[wing.tag]

TypeError: 'int' object is not subscriptable


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


i will attach the python file for further reference.

Also, if u can give any test program it would be great so that i can be sure that its some other problem.

Kind regards

Angu
apitest1.vsp3
apitest2.vsp3
base_data_10.txt
base_data_1500.txt
BWB.py

Tim MacDonald

unread,
May 13, 2019, 10:49:45 PM5/13/19
to OpenVSP
That output includes the warning "VSP import failed". This means that the OpenVSP API didn't import correctly within the SUAVE files. The line used to import is "import vsp_g as vsp". If you're able to import vsp in other contexts it usually means the path isn't being set properly by whatever is used to call the SUAVE file. The error you see occurs because the function that calculates wetted areas returns -1 when the import fails.

Tim

ANGUPRAVEEN PRAVEEN

unread,
May 15, 2019, 1:39:42 PM5/15/19
to OpenVSP
Dear Tim,

That makes absolute sense. Im kinda new to both programming and these tools, it would be really helpful if you can help me somehow bypass this issue. Can you guide me as to how i can set the path to properly call the SUAVE file.

I sincerely appreciate your valuable time and effort. 

Cheers

Tim MacDonald

unread,
May 16, 2019, 8:56:55 PM5/16/19
to OpenVSP
You should start by checking if the API imports correctly in its own folder. For me this is ../OpenVSP/build/python_api/. You should create a python shell there and try "import vsp". If it works your API is probably okay, but if not you'll need to go back and fix the installation. You can then check if this works in the shell in spyder. After that point I can't offer much more since I don't use spyder, but you can search around for how to set the enviroment that spyder uses.

Tim

ANGUPRAVEEN PRAVEEN

unread,
May 17, 2019, 2:04:54 PM5/17/19
to OpenVSP
Dear Tim,

Like i have already mentioned, the problem is not with the importing of vsp into python, but the problem is im not able to call it within suave. Ive attached a few screenshots. In the first picture you can see the path where my python_api folder is. In the second one, you can see that VSP has been successfully into python. But in the third picture you can see that VSP is failed to import within suave. This is when i try to run the BWB.py file in Anacomda cmd prompt.

Ive been playing around with it for a while now, unable to figure out a solution. Please help!

Cheers 
Capture1.JPG
Capture2.JPG
Capture3.JPG

Tim MacDonald

unread,
May 18, 2019, 12:37:45 AM5/18/19
to OpenVSP
Try changing line 9 in ../trunk/SUAVE/Input_Output/OpenVSP/get_vsp_areas.py and vsp_write.py to
import vsp as vsp
instead of
import vsp_g as vsp

Perhaps vsp_g doesn't work with the newest vsp version.

Tim
Message has been deleted

ANGUPRAVEEN PRAVEEN

unread,
May 18, 2019, 9:02:10 AM5/18/19
to OpenVSP
Hey Tim, 
Thanks a tonne. It works. But facing multiple other errors now. Ill analyse them and get back to you. 
Thanks again bud.

Kind regards

Angu

ANGUPRAVEEN PRAVEEN

unread,
May 19, 2019, 2:56:23 AM5/19/19
to OpenVSP
Okay this is the new error im geting

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Reseting OpenVSP Model in Memory
Writing main_wing to OpenVSP Model
Saving OpenVSP File
Starting mesh for base (This may take several minutes)
VSP meshing for base completed in 22.033967971801758 s
Traceback (most recent call last):

  File "<ipython-input-4-186f7cb5745b>", line 1, in <module>
    runfile('E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py', wdir='E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD')

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
    execfile(filename, namespace)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py", line 925, in <module>
    main()

  File "E:/CSE/Studienarbeit/Tutorials/SUAVE 2.0 Codes/Tutorials-2.0.0/BWB_CFD/BWB.py", line 34, in main
    analyses.finalize()

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Analysis.py", line 271, in finalize
    analysis.finalize(*args,**kwarg)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Analysis.py", line 271, in finalize
    analysis.finalize(*args,**kwarg)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Analysis.py", line 271, in finalize
    analysis.finalize(*args,**kwarg)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Aerodynamics\SU2_Euler.py", line 143, in initialize
    self.process.compute.lift.inviscid.initialize()

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Aerodynamics\SU2_inviscid.py", line 101, in initialize
    self.sample_training()

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Aerodynamics\SU2_inviscid.py", line 209, in sample_training
    CL[count],CD[count] = call_SU2(konditions, settings, geometry)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Analyses\Aerodynamics\SU2_inviscid.py", line 374, in call_SU2
    CL, CD = call_SU2_CFD(tag,parallel,processors)

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\suave-2.0.0-py3.7.egg\SUAVE\Input_Output\SU2\call_SU2_CFD.py", line 42, in call_SU2_CFD
    subprocess.call(['SU2_CFD',tag+'.cfg'])

  File "C:\Users\Angu Praveen\Anaconda3\lib\subprocess.py", line 323, in call
    with Popen(*popenargs, **kwargs) as p:

  File "C:\Users\Angu Praveen\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 143, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Users\Angu Praveen\Anaconda3\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)

  File "C:\Users\Angu Praveen\Anaconda3\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


1. I think it has something to do with SU2. I need to know if you use the precompiled versions with the .exe files for both parallel and sequential already available? Or do we need to use to source code and run it on Bash using ubuntu platform. Im having both the softwares ready to go. I just need to know how to get them connected.

2. Is the process automated or do i need to run the .cfg file seperately.

Any help would be great. Thanks in advance.

Cheers!
Tim
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Tim MacDonald

unread,
May 19, 2019, 2:22:06 PM5/19/19
to OpenVSP
1. The precompiled version should be fine for running in serial. As far as I'm aware there's no .exe file available that allows parallel computation.

2. The process is automated. However be aware that further development in the toolchain would be required to guarantee high mesh quality. This tutorial is largely to demonstrate how the toolchain could be used.

As for the error, are you able to run SU2_CFD from the command line? The error you see is not the one SU2 generates when the .cfg file is missing.

Nikhil Iyengar

unread,
Jun 16, 2019, 3:25:41 PM6/16/19
to OpenVSP
Hello Rob/Trevor,

This thread was very helpful for building the OpenVSP toolset for Python. Thank you!

I would really appreciate it if you can answer or provide pointers on a couple of questions I had:

1. The VSP API imports a "_vsp" file which I am unable to find. The only source files I found (_vsp.pyd) contains only symbols (see picture attached). Do you know where/how (if it is even possible) I can find the _vsp file or even the C++ source code that many of the functions within VSP.py are calling? 

2. I am trying to use the VSP API to perform parasite drag calculation on a .VSP3 file that is input by the user. However, I am not sure what the requirements/inputs are for the function calling ParasiteDrag. I did find parasitedrag.py file in \src\python_api\packages\openvsp\openvsp but this only shows some of the settings I can use. Do you know where I can find the entire list of function requirement? For example, what should I call if I want to change the CF equation type from Blasius to Implicit Karman?

3. (Related to 1& 2) I am trying to also calculate wave drag using the OpenVSP API, but could not find any code related to that. Any suggestions on where I can go looking to find the function requirements?

Thank you for your time and help!

Best,
Nikhil
ScreenCapture_Unreadable_File.JPG

Rob McDonald

unread,
Jun 21, 2019, 1:36:57 AM6/21/19
to OpenVSP
Most analyses should be accessed via the AnalysisManager in the API.  This provides a common means of calling all the analyses available.

The script 'TestAnalysis.vspscript' provides a general example of using AnalysisManager and ResultsManager.  Basically, it works with name/value pairs -- you can query the list of analyses available, then query their inputs and default values -- change/set inputs -- execute analysis -- then query the results as name/value pairs too.

The parasitedrag.py script is a wrapper that was developed to make things a bit easier -- it uses the AnalysisManager to talk to OpenVSP, you can use the same lower level calls to do it yourself (and for wave drag).

Rob

Nikhil Iyengar

unread,
Jun 21, 2019, 10:52:33 AM6/21/19
to ope...@googlegroups.com
Thank you very much, Rob. This was extremely helpful! 


--
You received this message because you are subscribed to the Google Groups "OpenVSP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openvsp+u...@googlegroups.com.
Message has been deleted

Rob McDonald

unread,
Oct 8, 2019, 7:31:18 PM10/8/19
to OpenVSP
Did anyone ever carry these instructions further?  Does anyone have a newer set of instructions for building on Windows anywhere?

Rob
Reply all
Reply to author
Forward
0 new messages