complink.gms : Compile and link external equation libraries

Description

This model is used for compiling and linking of external equation libraries.


Small Model of Type : GAMS


Category : GAMS Test library


Main file : complink.gms

$Title Compile and link external equation libraries (COMPLINK,SEQ=578)

$ontext
This model is used for compiling and linking of external equation libraries.
$offtext


$log --- External Equation Compile and Linking for build code %system.buildcode%
*$log %lang% %cb% %libname% %files% %namestub%
*$log %sysenv.LD_LIBRARY_PATH%

$ifthen.out %system.buildcode%==WEI
$ifthen.wei %lang%==java
$  call javac %files%
$  set JDK "%sysenv.JPATHs%\..\"
$  set files %namestub%wrap.c "%JDK%lib\jvm.lib" -I"%JDK%include" -I"%JDK%include\win32"
$  set lang c
$endif.wei
$ifi %lang%==fortran90 $call ifort -Fe%libname% -fpp -DWEI -LD -MT -nologo %files%
$ifi %lang%==c         $call cl -DGE_EXPORTS -Fe%libname% -LD %files%
$ifi %lang%==delphi    $call p3pc -B %files%
$if errorlevel 1 $abort problems compiling and linking

$elseif.out %system.buildcode%==LEG
$ifthen.leg %lang%==java
$  set JDK %sysenv.JPATH%/..
$  call javac %files%
$  set files %namestub%wrap.c
$set files %files% -I%JDK%/lib/jvm/java-openjdk/include -I%JDK%/lib/jvm/java-openjdk/include/linux -L%JDK%/lib/jvm/jre/lib/server
$  set files %files% -ljvm
$  set lang c
$endif.leg
$ifi %lang%==fortran90 $call gfortran -std=legacy -fPIC -nostartfiles -shared -Wl,-Bsymbolic -o %libname% %files% -lm
$ifi %lang%==c         $call gcc -fPIC -nostartfiles -shared -Wl,-Bsymbolic -o %libname% %files% -lm
$ifi %lang%==delphi    $call p3pc -B %files%
$if errorlevel 1 $abort problems compiling and linking

$elseif.out %system.buildcode%==DEG
*$ifthen.deg %lang%==java
*$  set JDK /usr/
*$  set LIB /usr/local/src/gcc_4_5_3_release/libjava/
*$  call %JDK%bin/javac %files%
*$  set files %namestub%wrap.c -I"%LIB%include" -I"%LIB%classpath/include/" -ljvm -L/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
*$  set lang c
*$endif.deg
$ifi %lang%==fortran90 $call gfortran -std=legacy -fPIC -nostartfiles -shared -o %libname% %files% -lm
$ifi %lang%==c         $call gcc -fPIC -dynamiclib -shared -o %libname% %files% -lm -ldl > runcc
$ifi %lang%==c         $call cat ./runcc && source ./runcc
$ifi %lang%==delphi    $call p3pc -B %files%
$if errorlevel 1 $abort problems compiling and linking

$elseif.out %system.buildcode%==DAC
$ifi %lang%==fortran90 $call gfortran -std=legacy -fPIC -nostartfiles -shared -o %libname% %files% -lm
$ifi %lang%==c         $call clang -fPIC -dynamiclib -shared -o %libname% %files% -lm -ldl > runcc
$ifi %lang%==c         $call cat ./runcc && source ./runcc
$ifi %lang%==delphi    $call p3pc -B %files%
$if errorlevel 1 $abort problems compiling and linking

$else.out
$abort Unknown build code %system.buildcode%
$endif.out