Skip to content

Commit 82d049a

Browse files
committed
Add run_julia
1 parent 6d81c89 commit 82d049a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

bin/run_julia

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
if [[ $(basename $(pwd)) == "bin" ]]; then
4+
cd ..
5+
fi
6+
7+
export MPLBACKEND=qt5agg
8+
9+
if command -v nproc &> /dev/null; then
10+
FAST_CORES=$(($(nproc) / 2 - 1))
11+
else
12+
FAST_CORES=3 # default value
13+
fi
14+
15+
GCT="--gcthreads=4,1"
16+
export JULIA_PKG_SERVER_REGISTRY_PREFERANCE=eager
17+
18+
julia_version=$(julia --version | awk '{print($3)}')
19+
julia_major=${julia_version:0:3}
20+
if [[ $julia_major == "1.1" ]]; then
21+
julia_major=${julia_version:0:4}
22+
else
23+
GCT=""
24+
fi
25+
if [[ $HOSTNAME == "ufryzen" || $HOSTNAME == "framework" ]]; then
26+
export NO_MTK=true
27+
fi
28+
if [ -d ".git" ]; then
29+
branch=$(git rev-parse --abbrev-ref HEAD)
30+
else
31+
branch=""
32+
fi
33+
34+
if test -f "bin/kps-image-${julia_major}-${branch}.so"; then
35+
echo "Found system image!"
36+
PLOT=1 julia -J bin/kps-image-${julia_major}-${branch}.so $GCT --project
37+
else
38+
PLOT=1 julia --project $GCT
39+
# julia --project
40+
fi

0 commit comments

Comments
 (0)