Skip to content

Conversation

@yurekami
Copy link
Contributor

Summary

Improve develop.sh and install.sh scripts with better error handling, prerequisite checks, and user feedback.

Changes

Both Scripts

  • Bash strict mode: Added set -euo pipefail for better error detection
  • Colored output: Green for success, yellow for warnings, red for errors
  • Prerequisite checks:
    • Verify Python is available
    • Verify pip is available (install.sh only)
    • Check CUDA_HOME or fallback to /usr/local/cuda
  • Automatic submodule init: Initialize submodules if missing
  • Proper cleanup: Use trap to ensure directory is restored on exit
  • Success messages: Show helpful next steps after completion

develop.sh Improvements

# Before
python setup.py build
# After
echo "Building DeepGEMM..."
python setup.py build
echo -e "${GREEN}Development environment setup complete!${NC}"
echo "You can now run tests with:"
echo "  python tests/test_core.py"

install.sh Improvements

# Before
pip install dist/*.whl --force-reinstall
# After
wheel_file=$(find dist -name "*.whl" -type f | head -n 1)
pip install "$wheel_file" --force-reinstall
echo "You can verify the installation with:"
echo "  python -c \"import deep_gemm; print(deep_gemm.__path__)\""

Benefits

  • Better debugging: Script fails fast on errors with meaningful messages
  • Smoother onboarding: New contributors get clear feedback
  • Robustness: Handles missing prerequisites gracefully
  • Consistency: Both scripts follow the same patterns

🤖 Generated with Claude Code

Enhance both shell scripts with:
- Bash strict mode (set -euo pipefail) for better error detection
- Colored output for better visibility
- Prerequisite checks (python, pip, CUDA_HOME)
- Automatic submodule initialization if missing
- Proper cleanup with trap on EXIT
- Helpful success messages with next steps

This makes the scripts more robust and user-friendly, especially
for first-time contributors setting up the development environment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant