Description
Contributor: Lutz Westermann, October 2012
Small Model of Type : .Net
Category : GAMS API library
Main file : CSCutstock.gms
$title 'Test object oriented C# API using a cutting stock example' (PCUTSTOCK,SEQ=29)
$onText
Contributor: Lutz Westermann, October 2012
$offText
$set srcRoot %gams.sysdir%apifiles%system.dirsep%CSharp%system.dirsep%
$escape &
$if %system.filesys% == UNIX
$if %sysenv.MPATH% == %&sysenv.MPATH%& $abort.noError Need Mono to run this on Unix
$ set COMP csc.exe
$if %system.filesys% == UNIX $set COMP $MPATH/mcs
$ set EXEC
$if %system.filesys% == UNIX $set EXEC $MPATH/mono
$if %system.platform% == WEX
$if not set flags $set flags /platform:x64
$if %system.platform% == LEX
$if not set flags $set flags
$if %system.platform% == DEX
$if not set flags $set flags /define:__APPLE__
$if %system.platform% == DAX
$if not set flags $set flags /define:__APPLE__
* Make sure that correct GAMS system is found when checking the registry
$if not %system.filesys% == UNIX $call findthisgams -q
$call cp "%gams.sysdir%%system.dirsep%GAMS.net4.dll" . && %COMP% %flags% -out:GMSCutstock.exe "%srcRoot%GMSCutstock%system.dirsep%GMSCutstock.cs" -r:GAMS.net4.dll
$if errorlevel 1 $abort 'Problem compiling GMSCutstock.cs'
$call %EXEC% GMSCutstock.exe "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing GMSCutstock'
$call cp "%gams.sysdir%%system.dirsep%GAMS.net4.dll" . && %COMP% %flags% -out:SimpleCutstock.exe "%srcRoot%SimpleCutstock%system.dirsep%SimpleCutstock.cs" "%srcRoot%SimpleCutstock%system.dirsep%CutstockClass.cs" -r:GAMS.net4.dll
$if errorlevel 1 $abort 'Problem compiling SimpleCutstock.cs'
$call %EXEC% SimpleCutstock.exe "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing SimpleCutstock'