-
Notifications
You must be signed in to change notification settings - Fork 0
/
activate.sh
51 lines (42 loc) · 1.54 KB
/
activate.sh
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
#!/bin/bash
export CODE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Check if the OS is macOS
if [[ "$(uname)" == "Darwin" ]]; then
echo "Running on macOS"
export CC=gcc-14
export CXX=g++-14
export FC=gfortran-14
# Check the processor type
if [[ "$(uname -m)" == "arm64" ]]; then
echo "This is an Apple Silicon (M1/M2) Mac."
export BLAS_LIBRARIES=/opt/homebrew/opt/openblas/lib/libopenblas.dylib
export LAPACK_LIBRARIES=/opt/homebrew/opt/openblas/lib/liblapack.dylib
elif [[ "$(uname -m)" == "x86_64" ]]; then
echo "This is an Intel Mac."
export BLAS_LIBRARIES=/usr/local/opt/openblas/lib/libopenblas.dylib
export LAPACK_LIBRARIES=/usr/local/opt/openblas/lib/liblapack.dylib
else
echo "Unknown processor architecture."
fi
export CMAKE_INCLUDE_PATH="/opt/homebrew/include/suitesparse:$CODE/external/triangle"
export CMAKE_LIBRARY_PATH="/opt/homebrew/lib:$CODE/external/triangle/build"
export CMAKE_ARGS="-DBLAS_LIBRARIES=$BLAS_LIBRARIES -DLAPACK_LIBRARIES=$LAPACK_LIBRARIES"
else
export CMAKE_ARGS=""
fi
source $CODE/scripts/util.sh
set_branch
add_to_path $CODE/scripts
add_to_path $CODE/local/bin
add_to_path $CODE/bin
export PATH
add_to_library_path $CODE/libneo/build
add_to_library_path $CODE/efit_to_boozer/build
add_to_library_path $CODE/local/lib
add_to_library_path $CODE/lib
export LD_LIBRARY_PATH
source $CODE/.venv/bin/activate
if [[ -f /etc/profile.d/modules.sh ]]; then
source /etc/profile.d/modules.sh
fi
module use -a $CODE/modules