설명
이 테스트는 외부 방정식을 사용하는 간단한 예가 작동하는지 확인합니다. 다양한 플랫폼의 다양한 컴파일러를 사용합니다. 기여자: D. Tischenberg
소형 모델 유형 :슬롯 사이트 추천
카테고리 : 슬롯 사이트 추천 테스트 라이브러리
메인 파일 : testexeq.gms
$title 외부 방정식 테스트(TESTEXEQ,SEQ=562)
$onText
이 테스트는 외부 방정식을 사용한 간단한 예가 작동하는지 확인합니다.
다양한 플랫폼의 다양한 컴파일러를 사용합니다.
기여자: D. Tischenberg
$offText
* 데이터 이름은 모델 이름과 동일하며 프로그래밍 언어의 추가 문자로 확장됩니다.
* 포트란의 경우 'f', 델파이의 경우 'd'
* 예시 모델의 경우 'ex1.gms'는 C 라이브러리 'ex1c.dll'과 Fortran 라이브러리 'ex1f.dll'을 사용합니다.
예제 설정 /er1*er3, ex1*ex6, ex1x, ex4x, exmcp1*exmcp5/
cb 콜백 또는 메시지 벡터 / '', '_cb' /
언어 언어 / c '.c', fortran90 '.f90', delphi '.dpr', java '.java'/
bc GAMS 빌드 코드 / wei, lag, Leg, deg, dac /
extequExample(예,cb,lang) /
er1 .'_cb'.C er1c
er1 .'_cb'.Fortran90 er1f
er2 .'_cb'.C er2c
er2 .'_cb'.Fortran90 er2f
er3 .'_cb'.C er3c
er3 .'_cb'.Fortran90 er3f
ex1 .'' .C ex1c
ex1 .'' .Fortran90 ex1f
ex1 .'' .델파이 ex1d
ex1 .'' .Java Ex1j
ex1 .'_cb'.C ex1c
ex1 .'_cb'.Fortran90 ex1f
ex1 .'_cb'.델파이 ex1d
ex1x.''. Fortran90 ex1xf
ex1x .'_cb'.C ex1xc
ex2 .'_cb'.C ex2c
ex2 .'_cb'.Fortran90 ex2f
ex2 .'_cb'.델파이 ex2d
ex3 .'' .델파이 ex3d
ex3 .'_cb'.C ex3c
ex3 .'_cb'.Fortran90 ex3f
ex4 .'' .델파이 ex4d
ex4 .'_cb'.C ex4c
ex4 .'_cb'.Fortran90 ex4f
ex4x .'_cb'.C ex4xc
ex4x .'_cb'.Fortran90 ex4xf
ex5 .'' .C ex5c
ex5 .'' .Fortran90 ex5f
ex6 .'' .C ex6c
exmcp1.'' .C exmcp1c
exmcp1.'' .Fortran90 exmcp1f
exmcp2.'' .C exmcp2c
exmcp2.'' .Fortran90 exmcp2f
exmcp2.'_cb'.C exmcp2c
exmcp2.'_cb'.Fortran90 exmcp2f
exmcp3.'_cb'.C exmcp3c
exmcp3.'_cb'.Fortran90 exmcp3f
exmcp4.'_cb'.C exmcp4c
exmcp4.'_cb'.Fortran90 exmcp4f
exmcp5.'' .C exmcp5c
/;
OS/Windows '.dll', Unix '.so', Mac '.dylib'/를 설정합니다.
ExtraFiles 설정(os,cb,lang) /
유닉스. '_cb'.Fortran90 gehelper.f90 msg2_f.f90
유닉스. '' .Fortran90 gehelper.f90
Windows.'_cb'.Fortran90 gehelper.f90 msg2_f.f90
Windows.'' .Fortran90 gehelper.f90
/;
ExtraFiles('맥',cb,lang) = ExtraFiles('유닉스',cb,lang);
$set myos 윈도우즈
$ifI %system.filesys%==unix $set myos Unix
$ifI %system.platform%==dex $set myos Mac
$ifI %system.platform%==dax $set myos Mac
*컴파일러를 호출해야 하므로 테스트 중에만 실행하십시오(즉, GSYS가 설정되었습니다).
$ifI가 %sysenv.GSYS%가 아님 == %system.buildcode% $exit
*이제 모든 컴파일러가 없기 때문에 테스터를 제외합니다(테스터에 대한 품질에서는 nocomp가 설정됨).
$if nocomp 설정 $exit
*Java의 경우: DLL을 사용하기 전에 jvm.dll이 PATH에 있는지 확인하세요.
$ifI %system.buildcode%==wei $prefixPath C:\Java\bin\server
* anton.gams.com
$ifI %system.buildcode%==lag $setEnv LD_LIBRARY_PATH /usr/lib/jvm/jre/lib/server:%SysEnv.LD_LIBRARY_PATH%
$ifI %system.buildcode%==leg $setEnv LD_LIBRARY_PATH /usr/lib/jvm/jre/lib/server:%SysEnv.LD_LIBRARY_PATH%
*$ifI %system.buildcode%==deg $setEnv DYLD_LIBRARY_PATH/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries:%SysEnv.LD_LIBRARY_PATH%
*세트에서 단일 예제 실행
$설정되지 않은 경우 TEST $goTo alltests
ex2(ex) / %TEST% / 설정;
$goTo 단일 테스트
$label 모든 테스트
ex2(ex)를 설정; ex2(ex) = 예;
$label 단일 테스트
*세트에서 단일 예제를 실행하지 않음
$설정되지 않은 경우 참고 $goTo noalltest
set exn(ex) /%NOTEST%/;
ex2(ex) = exn(ex)가 아님;
$label noalltest
*macOS에서는 java가 없습니다.
$LAN이 설정되지 않은 경우
$ifI %system.buildcode%==deg $set LAN "c,fortran90,delphi"
$LAN이 설정되지 않은 경우
$ifI %system.buildcode%==dac $set LAN "c,fortran90,delphi"
*WEI no delphi, # 2237에서
$ifI %system.buildcode%==wei $set LAN "c,fortran90,java"
*정의된 언어로 예제 실행
$LAN이 설정되지 않은 경우 $goTo alllang
lang2(lang) / %LAN% / 설정;
$goTo 싱글랭
$label alllang
lang2(lang)을 설정합니다. lang2(lang) = 예;
$label 싱글랭
* p3c makefile은 빌드된 라이브러리 경로의 공백을 처리하지 않습니다. #5912
* (WEI의 경우 이 건너뛰기는 중복됩니다. 위의 #2237 언급 참조)
lang2('델파이') = 아니요;
스칼라 fp;
파일 fpf / pf.txt /;
파일 FX;
루프(ex2(ex)$sum(extequExample(ex,cb,lang2),1),
Put_utility fx 'exec' /'testlib -q ' ex.tl;
loop(extequExample(ex,cb,lang2(lang)),
fpf / 'eolonly=1' 입력
/ '--lang=', lang.tl:0
/ '--files=';
loop(ExtraFiles('%myos%',cb,lang),
put ExtraFiles.슬롯 사이트 추천('%myos%',cb,lang) ' ');
extequExample.슬롯 사이트 추천(extequExample)를 넣으세요;
put cb.tl:0 lang.슬롯 사이트 추천(lang);
넣어 / '--libname='
extequExample.슬롯 사이트 추천(extequExample)를 넣으세요;
loop(os$sameas('%myos%',os), put cb.tl:0 os.슬롯 사이트 추천(os));
넣다 / '--namestub='
extequExample.슬롯 사이트 추천(extequExample)를 넣으세요;
putclose fpf;
'gams complink idir=.. lo=%gams.lo% pf=pf.txt'를 실행합니다.
abort$errorlevel '컴파일 문제';
)
fpf / 'input=' ex.tl:0 '.gms' 입력
loop(extequExample(ex,cb,lang2(lang)),
넣다 / '--실행';
fp = fpf.cc;
lang.tl:0;을 입력하세요. @(fp+1) ' '을 넣어;
@(fp+1) cb.tl:0 '=yes' 입력
);
putclose fpf;
'gams dummy lo=%gams.lo% pf=pf.txt'를 실행합니다.
abort$errorlevel '실행 중 문제';
);