• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Is it possible to run/compile GAMS code in VS Code?

Joined
8/7/15
Messages
91
Points
18
Hi,

The tittle says it all: Can I run my GAMS code ( saved in .gms files) in Visual Studio Code?

There is an extension with the following description:
"Provides syntax highlighting for .gms and .inc files and shortcuts for running GAMS models."

I use MAC
 
Just a friendly reminder that this thread still doesn't have an answer :)
 
From Wiki for GAMS I found

Application Programming Interfaces

GAMS - Download

?

Without a valid GAMS license the system will operate as a free demo system.

Model limits

  • Number of constraints and variables: 300
  • Number of nonzero elements: 2000 (of which 1000 nonlinear)
  • Number of discrete variables: 50 (including semi continuous, semi integer and member of SOS-Sets)
Additional Global solver limits

  • Number of constraints and variables: 10
The GAMS log will indicate that your system runs in demo mode
 
Ok, I installed Gams and a C++ console project which I can run. Very easy.
BTW I use Windows.

C++:
#include "gams.h"

#include <iostream>



using namespace gams;

using namespace std;



int main(int argc, char* argv[])

{

    GAMSWorkspace ws;

    ws.gamsLib("trnsport");



    // create a GAMSJob from file and run it with default settings

    GAMSJob t1 = ws.addJobFromFile("trnsport.gms");

    t1.run();

    for (GAMSVariableRecord rec : t1.outDB().getVariable("x"))

        cout << "x(" << rec.key(0) << "," << rec.key(1) << "):" << " level=" << rec.level() << " marginal=" << rec.marginal() << endl;
  
}
 
Last edited:
Back
Top