This guide will help you set up the development environment and get started with the projects in this repository.
- System Requirements
- Python Setup
- C++ Setup
- GPU Setup
- Verifying Installation
- Running Examples
- Troubleshooting
- Linux (tested on Ubuntu 20.04+)
- macOS (limited GPU support)
- Windows (via WSL2 recommended)
Python:
- Python 3.8 or higher
- pip package manager
- virtualenv (recommended)
C++:
- GCC 11+ with C++20 support
- Make build system
- CMake (optional)
GPU Computing (Optional):
- CUDA Toolkit 11.8+ (NVIDIA GPUs)
- ROCm 6.0.0+ (AMD GPUs)
- Intel OneAPI 2024.0+ (Intel GPUs/CPUs)
Storage:
- At least 5GB free space for dependencies
- Additional space for datasets (varies by project)
git clone https://github.com/bartokon/software.git
cd softwareUsing venv (recommended):
python3 -m venv venv
source venv/bin/activate # On Linux/macOS
# OR
venv\Scripts\activate # On WindowsUsing conda:
conda create -n software python=3.10
conda activate software# Upgrade pip
pip install --upgrade pip
# Install required packages
pip install -r requirements.txt
# Install the package in editable mode
pip install -e .# Check Python version
python --version
# Test imports
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
python -c "import numpy; print(f'NumPy version: {numpy.__version__}')"
# Test package import
python -c "from python.icp_2d import point_to_point_utils_2d; print('Package import successful!')"Ubuntu/Debian:
sudo apt update
sudo apt install build-essential g++-11 makemacOS:
xcode-select --install
# Or install via Homebrew
brew install gcc@11Arch Linux:
sudo pacman -S base-devel gcc# Check GCC version (should be 11+)
g++ --version
# Check Make
make --versioncd cpp/bubble_pointer_sort
make
./mainIf this builds and runs successfully, your C++ environment is ready!
GPU support is optional but required for CUDA/HIP/SYCL projects.
1. Check GPU:
lspci | grep -i nvidia
nvidia-smi # Should show your GPU info2. Install CUDA Toolkit 11.8+:
Follow instructions at: https://developer.nvidia.com/cuda-downloads
Ubuntu example:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda3. Set Environment Variables:
# Add to ~/.bashrc or ~/.zshrc
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH4. Verify CUDA:
nvcc --version5. Test CUDA Project:
cd cpp/cuda
make cuda
./cuda/vadd.elf1. Check GPU:
lspci | grep -i amd
rocm-smi # After installation2. Install ROCm:
Follow: https://rocmdocs.amd.com/en/latest/
3. Set Environment Variables:
export PATH=/opt/rocm/bin:$PATH
export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH4. Verify ROCm:
hipcc --version5. Test HIP Project:
cd cpp/cuda
make hip
./hip/vadd.elf1. Install Intel OneAPI:
Download from: https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html
2. Source Environment:
source /opt/intel/oneapi/setvars.sh3. Verify:
icpx --version4. Test SYCL Project:
cd cpp/cuda
make dpc
./dpc/vadd.elfSee gpu-setup.md for detailed GPU configuration.
Create a file verify_setup.py:
#!/usr/bin/env python3
import sys
def check_python_version():
version = sys.version_info
print(f"✓ Python {version.major}.{version.minor}.{version.micro}")
if version.major < 3 or (version.major == 3 and version.minor < 8):
print(" ⚠ Warning: Python 3.8+ recommended")
def check_packages():
packages = [
'numpy',
'torch',
'matplotlib',
'scipy'
]
for pkg in packages:
try:
mod = __import__(pkg)
version = getattr(mod, '__version__', 'unknown')
print(f"✓ {pkg} {version}")
except ImportError:
print(f"✗ {pkg} NOT FOUND")
def check_project_imports():
try:
from python.icp_2d import point_to_point_utils_2d
print("✓ Project imports working")
except ImportError as e:
print(f"✗ Project imports failed: {e}")
def check_gpu():
try:
import torch
if torch.cuda.is_available():
print(f"✓ CUDA available: {torch.cuda.get_device_name(0)}")
else:
print("⚠ CUDA not available (CPU only)")
except:
print("⚠ Could not check GPU")
if __name__ == '__main__':
print("=== Software Repository Setup Verification ===\n")
check_python_version()
print()
check_packages()
print()
check_project_imports()
print()
check_gpu()
print("\n=== Verification Complete ===")Run it:
python verify_setup.pyICP 2D:
cd python/icp_2d
python point_to_point_least_squares_2d.pyICP 3D:
cd python/icp_3d
python point_to_point_least_squares_3d.pyPyTorch Model:
cd python/pytorch
python main.py --help # See available optionsPoint Cloud Matching:
cd cpp/point_cloud_matching
make
./main.elfString Class:
cd cpp/string
make
./string_test.elfCUDA Examples:
cd cpp/cuda
make cuda
./cuda/vadd.elf
cd ../cuda_sum
make
./cuda/main_sum.elfProblem: "No module named 'python'"
# Make sure you installed in editable mode
pip install -e .
# Check if __init__.py files exist
ls python/__init__.py
ls python/icp_2d/__init__.pyProblem: "ImportError: cannot import name 'XXX'"
# Reinstall dependencies
pip install --force-reinstall -r requirements.txtProblem: PyTorch CUDA not available
# Check CUDA version
nvidia-smi
# Install PyTorch with correct CUDA version
# Visit: https://pytorch.org/get-started/locally/
pip install torch --index-url https://download.pytorch.org/whl/cu118Problem: "g++: command not found"
# Install GCC
sudo apt install build-essential # Ubuntu/Debian
brew install gcc # macOSProblem: "error: C++20 features not supported"
# Update GCC to version 11+
sudo apt install g++-11
# Update Makefile to use g++-11Problem: "fatal error: cuda_runtime.h: No such file"
# CUDA not installed or not in PATH
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATHProblem: "CUDA out of memory"
- Reduce batch size in training scripts
- Close other GPU applications
- Use smaller models for testing
Problem: "nvidia-smi command not found"
# NVIDIA drivers not installed
# Install appropriate drivers for your GPU
sudo ubuntu-drivers autoinstall # UbuntuProblem: "hipcc: command not found"
# ROCm not in PATH
export PATH=/opt/rocm/bin:$PATHNow that your environment is set up:
- Explore Projects: Read projects-overview.md for project descriptions
- Try Examples: Run the example scripts in each project directory
- Read Code: Each project has a README explaining the implementation
- Experiment: Modify parameters and see what happens!
- Projects Overview - Detailed project descriptions
- GPU Setup - In-depth GPU configuration
- Main README - Repository overview
If you encounter issues:
- Check the troubleshooting section above
- Read project-specific READMEs
- Check GPU setup documentation
- Open an issue on GitHub with:
- Your OS and version
- Python version (
python --version) - Error messages
- Steps to reproduce
Happy coding! 🚀