-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·52 lines (42 loc) · 1.32 KB
/
setup.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.32 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
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
EXTERNAL_DIR="$SCRIPT_DIR/external"
VENV_DIR="$SCRIPT_DIR/.venv"
echo "=== Setting up diffmjx-al umbrella repo ==="
# Create virtual environment with uv
if [ -d "$VENV_DIR" ]; then
echo "Virtual environment already exists at $VENV_DIR"
else
echo "Creating virtual environment..."
uv venv "$VENV_DIR"
fi
# Create external directory for cloned repos
mkdir -p "$EXTERNAL_DIR"
# Install JAX with CUDA 12 support
echo "Installing JAX with CUDA 12 support..."
uv pip install "jax[cuda12]"
# Clone repositories if they don't already exist
if [ -d "$EXTERNAL_DIR/softjax" ]; then
echo "softjax already cloned"
else
echo "Cloning softjax..."
git clone git@github.com:a-paulus/softjax.git "$EXTERNAL_DIR/softjax"
fi
if [ -d "$EXTERNAL_DIR/mujoco" ]; then
echo "mujoco already cloned"
else
echo "Cloning mujoco..."
git clone -b diffmjx git@github.com:martius-lab/mujoco.git "$EXTERNAL_DIR/mujoco"
fi
if [ -d "$EXTERNAL_DIR/mjx_diffrax" ]; then
echo "mjx_diffrax already cloned"
else
echo "Cloning mjx_diffrax..."
git clone git@github.com:martius-lab/mjx_diffrax.git "$EXTERNAL_DIR/mjx_diffrax"
fi
echo ""
echo "=== Setup complete ==="
echo "Run experiments with:"
echo " uv run experiments/<experiment>/run.py"