Added compiler test scripts
This commit is contained in:
17
scripts/compiler_tests/build_all.sh
Executable file
17
scripts/compiler_tests/build_all.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Example usage: build_all.sh v4.8.1
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
docker images | grep -q p2pool_compiler_tests_ubuntu
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Build image not found, creating it"
|
||||||
|
images/ubuntu/build.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in 8 9 10 11 12 13 14 15;
|
||||||
|
do
|
||||||
|
gcc/build.sh $1 $i
|
||||||
|
done
|
||||||
4
scripts/compiler_tests/gcc/Dockerfile
Normal file
4
scripts/compiler_tests/gcc/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FROM p2pool_compiler_tests_ubuntu
|
||||||
|
ARG P2POOL_VERSION GCC_VERSION
|
||||||
|
ADD test.sh /p2pool/
|
||||||
|
RUN /p2pool/test.sh ${P2POOL_VERSION} ${GCC_VERSION}
|
||||||
13
scripts/compiler_tests/gcc/build.sh
Executable file
13
scripts/compiler_tests/gcc/build.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Example usage: ./build.sh v4.8.1 15
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
docker build --build-arg P2POOL_VERSION=$1 --build-arg GCC_VERSION=$2 -t p2pool_compiler_test_gcc_$2 .
|
||||||
|
|
||||||
|
docker create --name p2pool_compiler_test_gcc_$2_container p2pool_compiler_test_gcc_$2:latest
|
||||||
|
docker cp p2pool_compiler_test_gcc_$2_container:/p2pool/logs.tar.gz logs_$2.tar.gz
|
||||||
|
docker rm p2pool_compiler_test_gcc_$2_container
|
||||||
|
|
||||||
|
docker image rm -f p2pool_compiler_test_gcc_$2
|
||||||
24
scripts/compiler_tests/gcc/test.sh
Executable file
24
scripts/compiler_tests/gcc/test.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd /p2pool
|
||||||
|
git fetch --jobs=$(nproc)
|
||||||
|
git checkout $1
|
||||||
|
git submodule update --recursive --jobs $(nproc)
|
||||||
|
|
||||||
|
COMPILER="-DCMAKE_C_COMPILER=/usr/local/gcc-$2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-$2/bin/g++ -DCMAKE_AR=/usr/local/gcc-$2/bin/gcc-ar -DCMAKE_RANLIB=/usr/local/gcc-$2/bin/gcc-ranlib"
|
||||||
|
|
||||||
|
cd /p2pool
|
||||||
|
mkdir build && cd build
|
||||||
|
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1
|
||||||
|
make -j$(nproc) p2pool 1>> /p2pool/output.log 2>&1
|
||||||
|
./p2pool --test 1>> /p2pool/output.log 2>&1
|
||||||
|
|
||||||
|
cd ../tests
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1
|
||||||
|
make -j$(nproc) p2pool_tests 1>> /p2pool/output.log 2>&1
|
||||||
|
gunzip *.gz
|
||||||
|
./p2pool_tests 1>> /p2pool/output.log 2>&1
|
||||||
|
|
||||||
|
tar -czvf /p2pool/logs.tar.gz /p2pool/output.log
|
||||||
3
scripts/compiler_tests/images/ubuntu/Dockerfile
Normal file
3
scripts/compiler_tests/images/ubuntu/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
FROM ubuntu:24.04
|
||||||
|
ADD prepare.sh /
|
||||||
|
RUN /prepare.sh
|
||||||
3
scripts/compiler_tests/images/ubuntu/build.sh
Executable file
3
scripts/compiler_tests/images/ubuntu/build.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
docker build -t p2pool_compiler_tests_ubuntu .
|
||||||
133
scripts/compiler_tests/images/ubuntu/prepare.sh
Executable file
133
scripts/compiler_tests/images/ubuntu/prepare.sh
Executable file
@@ -0,0 +1,133 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Installing prerequisites"
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
apt-get update && apt-get upgrade -yq --no-install-recommends
|
||||||
|
apt-get install -yq --no-install-recommends ca-certificates curl bzip2 flex git gcc g++ cmake make libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev
|
||||||
|
|
||||||
|
echo "Installing GCC 8.5.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-8.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-8
|
||||||
|
|
||||||
|
cd gcc-8
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-8
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 9.5.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-9.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-9
|
||||||
|
|
||||||
|
cd gcc-9
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-9
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 10.5.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-10.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-10
|
||||||
|
|
||||||
|
cd gcc-10
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-10
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 11.5.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-11.5.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-11
|
||||||
|
|
||||||
|
cd gcc-11
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-11
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 12.4.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-12.4.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-12
|
||||||
|
|
||||||
|
cd gcc-12
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-12
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 13.4.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-13.4.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-13
|
||||||
|
|
||||||
|
cd gcc-13
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-13
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 14.3.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-14.3.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-14
|
||||||
|
|
||||||
|
cd gcc-14
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-14
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Installing GCC 15.1.0"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
|
||||||
|
git clone --depth 1 --branch releases/gcc-15.1.0 --jobs $(nproc) git://gcc.gnu.org/git/gcc.git gcc-15
|
||||||
|
|
||||||
|
cd gcc-15
|
||||||
|
contrib/download_prerequisites
|
||||||
|
|
||||||
|
mkdir build && cd build
|
||||||
|
../configure --enable-languages=c,c++ --disable-multilib --disable-bootstrap --prefix=/usr/local/gcc-15
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
|
||||||
|
echo "Cloning the repository"
|
||||||
|
|
||||||
|
cd /
|
||||||
|
git clone --recursive --jobs $(nproc) https://github.com/SChernykh/p2pool
|
||||||
|
|
||||||
|
echo "Deleting temporary files"
|
||||||
|
|
||||||
|
cd /root
|
||||||
|
rm -rf *
|
||||||
|
|
||||||
|
echo "All done"
|
||||||
@@ -1,12 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Example usage:
|
# Example usage: release_scripts/build_all.sh v4.8.1
|
||||||
#
|
|
||||||
# git clone --recursive https://github.com/SChernykh/p2pool
|
|
||||||
# cd p2pool
|
|
||||||
# git checkout v4.9
|
|
||||||
# release_scripts/build_all.sh v4.9
|
|
||||||
#
|
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user