|
#! /bin/bash |
|
set -e |
|
set -u |
|
set -o pipefail |
|
|
|
echo "=== Starting CLASS installation process ===" |
|
echo "Current directory: $(pwd)" |
|
echo "Contents of directory: $(ls -la)" |
|
|
|
|
|
if [ ! -d "class_public" ]; then |
|
echo "=== Cloning CLASS repository ===" |
|
git clone --depth 1 --single-branch --branch master https://github.com/lesgourg/class_public.git |
|
else |
|
echo "=== CLASS repository already exists, skipping clone ===" |
|
fi |
|
|
|
|
|
echo "=== Changing to class_public directory ===" |
|
if [ ! -d "class_public" ]; then |
|
echo "ERROR: class_public directory not found!" |
|
exit 1 |
|
fi |
|
|
|
cd class_public/ |
|
echo "Now in: $(pwd)" |
|
echo "Contents of class_public: $(ls -la)" |
|
|
|
|
|
echo "=== Cleaning previous build ===" |
|
make clean || echo "Clean step failed, but continuing..." |
|
|
|
|
|
echo "=== Installing Python dependencies ===" |
|
echo "Installing numpy..." |
|
pip install "numpy<=1.26" -v || { echo "Failed to install numpy"; exit 1; } |
|
|
|
echo "Installing scipy..." |
|
pip install "scipy" -v || { echo "Failed to install scipy"; exit 1; } |
|
|
|
echo "Installing Cython..." |
|
pip install "Cython" -v || { echo "Failed to install Cython"; exit 1; } |
|
|
|
|
|
echo "=== Building CLASS library ===" |
|
make -j || { echo "Failed to build CLASS"; exit 1; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "=== CLASS installation completed successfully ===" |
|
exit 0 |
|
|