forked from deepmodeling/dftio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·57 lines (48 loc) · 1.52 KB
/
install.sh
File metadata and controls
executable file
·57 lines (48 loc) · 1.52 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
54
55
56
57
#!/bin/bash
# dftio Installation Script with CPU/GPU Selection
#
# Usage:
# ./install.sh # Install CPU version (default)
# ./install.sh cpu # Install CPU version
# ./install.sh cu118 # Install CUDA 11.8 version
# ./install.sh cu121 # Install CUDA 12.1 version
# ./install.sh cu124 # Install CUDA 12.4 version
set -e # Exit on error
# Default to CPU
VARIANT="${1:-cpu}"
# Validate variant
case "$VARIANT" in
cpu|cu118|cu121|cu124)
;;
*)
echo "❌ Invalid variant: $VARIANT"
echo "Allowed variants: cpu, cu118, cu121, cu124"
exit 1
;;
esac
# Detect torch version from pyproject.toml (use 2.5.0 as default)
TORCH_VERSION="2.5.0"
# Set the find-links URL based on variant
FIND_LINKS_URL="https://data.pyg.org/whl/torch-${TORCH_VERSION}+${VARIANT}.html"
echo "======================================"
echo "dftio Installation Script"
echo "======================================"
echo "PyTorch variant: $VARIANT"
echo "Find-links URL: $FIND_LINKS_URL"
echo "======================================"
echo ""
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "UV is not installed. Installing UV..."
pip install uv
fi
# Sync dependencies with the specified find-links
echo "Installing dftio with torch_scatter ($VARIANT version)..."
echo "Using Python: $(which python)"
uv sync --python $(which python) --find-links "$FIND_LINKS_URL"
echo ""
echo "✅ Installation complete!"
echo ""
echo "To run dftio:"
echo " uv run dftio --help"
echo ""