-
Notifications
You must be signed in to change notification settings - Fork 2
/
dependencies_mac.sh
67 lines (50 loc) · 1.44 KB
/
dependencies_mac.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
OMP_BUILD_DIR="openmp-12.0.1.src/build"
# Download and unpack OpenMP source code
curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/openmp-12.0.1.src.tar.xz
tar xvf openmp-12.0.1.src.tar.xz
# Create build directory and navigate to it
if [ -d "${OMP_BUILD_DIR}" ]; then
echo "Directory ${OMP_BUILD_DIR} exists. Removing..."
rm -rf ${OMP_BUILD_DIR}
fi
mkdir ${OMP_BUILD_DIR}
cd ${OMP_BUILD_DIR}
# Configure and build OpenMP
cmake ..
make
# Install OpenMP
make install
# Exit build directory
cd ../../..
if [ ! -d "eigen-3.4.0" ]; then
# Directory does not exist, download and unzip Eigen
curl -OL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip
unzip eigen-3.4.0.zip
else
echo "Eigen already exists, skipping download."
fi
EIGEN_BUILD_DIR="eigen-3.4.0/build"
if [ -d "${EIGEN_BUILD_DIR}" ]; then
echo "Directory ${EIGEN_BUILD_DIR} exists. Removing..."
rm -rf ${EIGEN_BUILD_DIR}
fi
# Create build directory
mkdir ${EIGEN_BUILD_DIR}
cd ${EIGEN_BUILD_DIR}
# Configure
cmake ..
# Install
make install
# Get the Python interpreter path
PYTHON_PATH=$(which python)
# Install pybind11 using the correct Python interpreter
$PYTHON_PATH -m pip install pybind11
# Set CC and CXX environment variables to clang
export CC=$(which clang)
export CXX=$(which clang++)
# Print the environment variables
echo "CC: $CC"
echo "CXX: $CXX"