-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsource_arm
More file actions
executable file
·53 lines (44 loc) · 1.94 KB
/
source_arm
File metadata and controls
executable file
·53 lines (44 loc) · 1.94 KB
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
#!/bin/bash
# Universal Apple Silicon environment setup for UPSIDE2
# Works with M1, M2, M3, M4 Macs
# Detect and set Python path dynamically
if [ -d "/opt/homebrew/Cellar/python@3.10" ]; then
# Find the latest Python 3.13 version
PYTHON_VERSION=$(ls /opt/homebrew/Cellar/python@3.10 | sort -V | tail -1)
export MY_PYTHON="/opt/homebrew/Cellar/python@3.10/$PYTHON_VERSION"
fi
# Set UPSIDE_HOME - this will be replaced by the install script
export UPSIDE_HOME="UP_PATH"
# Set up PATH and PYTHONPATH
export PATH="$MY_PYTHON/bin:$PATH"
export PATH=$UPSIDE_HOME/obj:$PATH
export PYTHONPATH=$UPSIDE_HOME/py:$PYTHONPATH
# Set up Homebrew paths
export CMAKE_PREFIX_PATH="$(brew --prefix)"
export EIGEN_HOME=$(brew --prefix eigen)/include/eigen3
export HDF5_ROOT=$(brew --prefix hdf5)
# OpenMP configuration for Apple Silicon
export OpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include"
export OpenMP_CXX_LIB_NAMES="omp"
export OpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include"
export OpenMP_C_LIB_NAMES="omp"
export OpenMP_libomp_LIBRARY="$(brew --prefix libomp)/lib/libomp.dylib"
export LDFLAGS="-L$(brew --prefix libomp)/lib"
export CPPFLAGS="-I$(brew --prefix libomp)/include"
export CMAKE_PREFIX_PATH="$(brew --prefix libomp):$CMAKE_PREFIX_PATH"
# Additional library paths
export CPLUS_INCLUDE_PATH=$(brew --prefix libomp)/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=$(brew --prefix libomp)/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$(brew --prefix libomp)/lib:$LD_LIBRARY_PATH
# Set up compiler paths
export PATH="$(brew --prefix binutils)/bin:$PATH"
export CC=$(which gcc)
export CXX=$(which g++)
# Verify critical components (silent mode)
# Uncomment the lines below if you want to see environment information
# echo "Environment setup for Apple Silicon Mac:"
# echo " Python: $MY_PYTHON"
# echo " Eigen: $EIGEN_HOME"
# echo " HDF5: $HDF5_ROOT"
# echo " Compiler: $CXX"
# echo " Architecture: $(uname -m)"