-
Notifications
You must be signed in to change notification settings - Fork 11
/
Allwmake
executable file
·46 lines (39 loc) · 1.28 KB
/
Allwmake
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
#!/usr/bin/bash
orig_dit="$(pwd)"
## Compile SmartRedis libs
export _REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "$_REPO_ROOT" || exit 1
export FOAM_SMARTREDIS="$_REPO_ROOT/smartredis"
if [ ! -d "$FOAM_SMARTREDIS" ]; then
git clone https://github.com/CrayLabs/SmartRedis "$FOAM_SMARTREDIS"
else
cd "$FOAM_SMARTREDIS" || exit 1
git pull origin develop
cd "${_REPO_ROOT}" || exit 1
fi
cd "${FOAM_SMARTREDIS}" || exit 1
# Force clean: ensures binaries match OpenFOAM's compiler.
make clean
# Set compiler options
if [ $WM_COMPILER == "Gcc" ]; then
echo "Using gcc and g++"
export CC=gcc
export CXX=g++
elif [ $WM_COMPILER == "Icx" ]; then
echo "Using icpx"
export CC=icx-cc
export CXX=icpx
fi
make lib
cd "$_REPO_ROOT" || exit 1
cp $FOAM_SMARTREDIS/install/lib/libsmartredis.so $FOAM_USER_LIBBIN
cp $FOAM_SMARTREDIS/build/Release/hiredis-prefix/src/hiredis-build/libhiredis.a $FOAM_USER_LIBBIN
cp $FOAM_SMARTREDIS/build/Release/redis++-prefix/src/redis++-build/libredis++.a $FOAM_USER_LIBBIN
export FOAM_CODE_TEMPLATES=$_REPO_ROOT/etc/dynamicCode/
## Compile OpenFOAM libs
wmake libso src/smartRedis
wmake libso src/functionObjects
wmake libso src/displacementSmartSimMotionSolver
## Compile OpenFOAM utilities
wmake all applications
cd "$orig_dir" || exit 1