84 lines
1.7 KiB
Bash
Executable File
84 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Simple Golang AVX512 FFT Build Script
|
|
# This script provides a basic way to build and test the FFT implementation
|
|
|
|
echo "🚀 Starting Golang AVX512 FFT build process..."
|
|
|
|
# Check if Docker is available
|
|
if ! command -v docker &> /dev/null; then
|
|
echo "❌ Docker is not installed. Please install Docker first."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Docker daemon is running
|
|
if ! docker info &> /dev/null; then
|
|
echo "❌ Docker daemon is not running. Please start Docker first."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Docker is available and running"
|
|
|
|
# Create a simple Dockerfile
|
|
echo "📝 Creating Dockerfile..."
|
|
cat > Dockerfile << 'EOF'
|
|
FROM golang:1.21-bullseye
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy source files
|
|
COPY . .
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Build the application
|
|
RUN go build -o fft .
|
|
|
|
# Run tests
|
|
RUN go test -v .
|
|
|
|
# Run benchmarks
|
|
RUN go test -bench=. -benchmem .
|
|
|
|
# Show binary info
|
|
RUN ls -la fft
|
|
RUN file fft
|
|
|
|
# Show Go environment
|
|
RUN go version
|
|
RUN go env GOOS GOARCH GOAMD64
|
|
|
|
# Keep container running
|
|
CMD ["/bin/bash"]
|
|
EOF
|
|
|
|
echo "✅ Dockerfile created"
|
|
|
|
# Build the container
|
|
echo "🔨 Building container..."
|
|
docker build -t golang-fft .
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "✅ Container built successfully!"
|
|
|
|
echo ""
|
|
echo "🎯 Running tests and benchmarks..."
|
|
echo "=================================="
|
|
|
|
# Run the container to execute tests and benchmarks
|
|
docker run --rm golang-fft
|
|
|
|
echo ""
|
|
echo "🎉 Build and test completed successfully!"
|
|
echo ""
|
|
echo "To run the container interactively, use:"
|
|
echo " docker run -it --rm golang-fft"
|
|
echo ""
|
|
echo "To clean up, use:"
|
|
echo " docker rmi golang-fft"
|
|
|
|
else
|
|
echo "❌ Failed to build container"
|
|
exit 1
|
|
fi |