Skip to content

Commit b746b6e

Browse files
local compiled bats
1 parent 9b9bc36 commit b746b6e

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

kratos.gid/exec/compiled.unix.bat

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
# OutputFile: "$2/$1.info"
3+
# ErrorFile: "$2/$1.err"
4+
#delete previous result file
5+
rm -f "$2/$1*.post.bin"
6+
rm -f "$2/$1*.post.res"
7+
rm -f "$2/$1*.post.msh"
8+
rm -f "$2/$1.info"
9+
rm -f "$2/$1.err"
10+
rm -f "$2/$1.flavia.dat"
11+
12+
# include .bashrc if it exists
13+
if [ -f "$HOME/.bashrc" ]; then
14+
. "$HOME/.bashrc"
15+
fi
16+
17+
# gid redefines LD_LIBRARY_PATH to its own libs directory
18+
# and maintains OLD_LD_LIBRARY_PATH with previous settings
19+
# therefore, we use the OLD_LD_LIBRARY_PATH and prepend the path to the kratos libs
20+
if [ "$OLD_LD_LIBRARY_PATH" != "" ]; then
21+
export LD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$OLD_LD_LIBRARY_PATH
22+
else
23+
# do not add the ':'
24+
export LD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs"
25+
fi
26+
27+
# Prevents the PYTHONHOME error from happening and isolate possible python repacks present
28+
# in the system and interfeering with runkratos
29+
export PYTHONPATH="$3/exec/Kratos":$PYTHONPATH
30+
31+
32+
# if mac
33+
KERNEL=`uname -s`
34+
if [ $KERNEL = "Darwin" ]; then
35+
KERNEL_NAME="macosx"
36+
export DYLD_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$DYLD_LIBRARY_PATH
37+
export DYLD_FALLBACK_LIBRARY_PATH="$3/exec/Kratos":"$3/exec/Kratos/libs":$DYLD_FALLBACK_LIBRARY_PATH
38+
export PYTHONPATH="$3/exec/Kratos/Lib":"$3/exec/Kratos/Lib/lib-dynload/":$PYTHONPATH
39+
export PYTHONHOME="$3/exec/Kratos"
40+
else
41+
KERNEL_NAME="linux"
42+
fi
43+
44+
# Run Python using the script MainKratos.py
45+
"$3/exec/Kratos/runkratos" MainKratos.py > "$2/$1.info" 2> "$2/$1.err"

kratos.gid/exec/compiled.win.bat

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
REM @ECHO OFF
2+
REM Identification for arguments
3+
REM basename = %1
4+
REM Project directory = %2
5+
REM Problem directory = %3
6+
7+
REM OutputFile: "%2\%1.info"
8+
REM ErrorFile: "%2\%1.err"
9+
10+
DEL "%2\%1.info"
11+
DEL "%2\%1.err"
12+
13+
set PATH=%3\\exec\\kratos;%3\\exec\\kratos\\libs;%PATH%
14+
15+
REM Run Python using the script MainKratos.py
16+
"%3\\exec\\kratos\\runkratos" MainKratos.py > "%2\\%1.info" 2> "%2\\%1.err"

0 commit comments

Comments
 (0)