You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cbmc/specgen/setup_env.sh

40 lines
1.2 KiB

#!/bin/bash
# Setup script for CBMC SpecGen virtual environment
echo "Setting up CBMC SpecGen environment..."
# Create virtual environment
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
else
echo "Virtual environment already exists."
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "Installing dependencies..."
pip install --upgrade pip
pip install requests
# Check if API key is set
if [ ! -f "api_key.txt" ] && [ -z "$DEEPSEEK_API_KEY" ]; then
echo "Warning: No API key found."
echo "Please set your DeepSeek API key:"
echo "1. Export as environment variable: export DEEPSEEK_API_KEY=your_key"
echo "2. Or create api_key.txt file with your key"
fi
echo ""
echo "Setup complete!"
echo "Virtual environment is active and ready to use."
echo ""
echo "Test commands:"
echo " python test_generation_step.py --input testfiles/simple_test.c --verbose"
echo " python test_generation_step.py --input testfiles/array_sum.c --output output.c"
echo ""
echo "To deactivate: deactivate"
echo "To reactivate later: source venv/bin/activate"