forked from ImperialCollegeLondon/porefoam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
59 lines (46 loc) · 1.68 KB
/
bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
myCurDIR=$(cd "$(dirname ${BASH_SOURCE[0]})/.." && pwd)
if [ -n "$msBinDir" ]; then
echo "Info: msSrc(=$msSrc) is NOT reset from $myCurDIR"
if [ "$msSrc" != "$myCurDIR" ]; then
echo "Hint, try reseting your (terminal) session and its settings";
fi
elif ! [ -f $myCurDIR/Makefile ]; then
echo "Error: $myCurDIR does not seem to be a source directory."
echo " Makefile does not exists.";
else
export msSrc="$myCurDIR"
export msRoot=$( cd "$msSrc/../" && pwd )
export msBinDir=$msRoot/bin
export msLibDir=$msRoot/lib
export msIncDir=$msRoot/include
export msBilDir=$msRoot/build
export msTstDir=$msRoot/test
# maybe safer to prepend PATHs?
export PATH=$PATH:$msSrc/script
export PATH=$PATH:$msSrc/script/pylib
export PATH=$PATH:$msSrc/gnm/script
export PATH=$PATH:$msSrc/gnm/script/PNM
export PATH=$PATH:$msSrc/porefoam1f/script
export PATH=$PATH:$msSrc/porefoam2f/script
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$msLibDir
export PATH=$PATH:$msBinDir
if ! [ -d $msBinDir ]; then
mkdir -p $msBinDir;
mkdir -p $msLibDir;
mkdir -p $msIncDir;
fi
if [ -z "$WM_PROJECT" ] ; then
# Openfoam settings:
# Change according to your openfoam installation directory
#export WM_NCOMPPROCS=28
#export FOAM_INST_DIR=$(cd $myUpperDIR/../pkgs && pwd)
export FOAM_INST_DIR=$msRoot/pkgs
source $FOAM_INST_DIR/foamx4m/etc/bashrc
elif [[ "$WM_PROJECT_DIR" != "$msRoot/"*"/foamx4m" ]]; then
printf "\n *** Using OpenFOAM: $WM_PROJECT_DIR, If you meant to use foamx4m instead, deactivate this and re-source in a new terminal.\n\n"
fi
export PATH=$PATH:$msBinDir/foamx4m
export FOAM_ABORT=1
export PYTHONPATH=$msSrc/script:$msSrc/pylib:$PYTHONPATH
fi