From f1e90f48609bcc4c6a76a18d1e12e17c1ffaf601 Mon Sep 17 00:00:00 2001 From: thevenyp Date: Thu, 18 Sep 2008 14:44:27 +0000 Subject: Add a tools/ directory that contains helper scripts. For the time being, contains scripts for the PIPOL platform (see tools/README.pipol). git-svn-id: svn://scm.gforge.inria.fr/svn/mpc/trunk@179 211d60ee-9f03-0410-a15a-8952a2c7a4e4 --- tools/README.pipol | 35 ++++++ tools/pipol/nightly/multiopt | 135 +++++++++++++++++++++ tools/pipol/scripts/compile-svn.sh | 14 +++ tools/pipol/scripts/get-svn.sh | 17 +++ tools/pipol/yum.repos.d/fedora-development.repo | 48 ++++++++ .../pipol/yum.repos.d/fedora-updates-testing.repo | 26 ++++ tools/pipol/yum.repos.d/fedora-updates.repo | 26 ++++ tools/pipol/yum.repos.d/fedora.repo | 26 ++++ 8 files changed, 327 insertions(+) create mode 100644 tools/README.pipol create mode 100755 tools/pipol/nightly/multiopt create mode 100755 tools/pipol/scripts/compile-svn.sh create mode 100755 tools/pipol/scripts/get-svn.sh create mode 100644 tools/pipol/yum.repos.d/fedora-development.repo create mode 100644 tools/pipol/yum.repos.d/fedora-updates-testing.repo create mode 100644 tools/pipol/yum.repos.d/fedora-updates.repo create mode 100644 tools/pipol/yum.repos.d/fedora.repo (limited to 'tools') diff --git a/tools/README.pipol b/tools/README.pipol new file mode 100644 index 0000000..a4a4929 --- /dev/null +++ b/tools/README.pipol @@ -0,0 +1,35 @@ +This file details the files contained in the pipol directory and how to +install nightly-build scripts on the PIPOL platform. + +Files +----- +yum.repos.d/fedora.repo +yum.repos.d/fedora-updates.repo +yum.repos.d/fedora-development.repo +yum.repos.d/fedora-updates-testing.repo +These repositories are usefull when upgrading RedHat EL-5.0 from non-official +directories (copied by rc.redhat into /etc/yum.repos.d). + +rc.fedora-core8 +rc.redhat +These 'run command' files update/install all the packages needed for mpfr and +mpc compilation. + +nightly/multiopt +The nightly-build script. It downloads the last version of the code from the +subversion repository and try to compile it. + +scripts/get-svn.sh +Helper script that downloads code source. Display help when launched without +parameter to . + +scripts/compile-svn.sh +Helper script that compiles code and records results in a log file. + +Nightly-build HOWTO +------------------- +1. Copy 'pipol/' directory content into the '.pipol/' directory of your pipol +homedir. +2. Check that all scripts and run command files are executable. +3. Wait until the executables files in the 'nightly/' directory are executed. +4. Check results in '.pipol/log/' dir. \ No newline at end of file diff --git a/tools/pipol/nightly/multiopt b/tools/pipol/nightly/multiopt new file mode 100755 index 0000000..4ea2f62 --- /dev/null +++ b/tools/pipol/nightly/multiopt @@ -0,0 +1,135 @@ +#!/bin/bash +SCRIPTS_DIR=$PIPOL_HOMEDIR/.pipol/scripts + +# Return value (set it to 1 if a script fails) +RET=0 + +# +# Set RANDOM_OPT to random compiler options +# [no parameter] +# +# Setting random seed enables replay +RANDOM=$PIPOL_JOB + +function random_opt() +{ +CONFIGURE_OPTIONS=(\ + --enable-assert=full \ + --enable-thread-safe \ + --disable-shared \ + --disable-alloca) + +# we did already compile with --enable-assert=full, so don't use zero value +local number=${RANDOM:-3} + +unset RANDOM_OPT +for ((i=0; i < ${#CONFIGURE_OPTIONS[*]}; i++)); do + if [ $(($((2**i)) & number)) -ne 0 ]; then + RANDOM_OPT=$RANDOM_OPT" "${CONFIGURE_OPTIONS[$i]}; + fi +done + +unset CFLAGS_OPT +CFLAGS_OPTIONS=(\ + -O3 \ + -ansi \ + "-std=c99 -D_XOPEN_SOURCE=500" \ + "-D_FORTIFY_SOURCE=2" \ + -fno-common) +for ((i=0; i < ${#CFLAGS_OPTIONS[*]}; i++)); do + j=$i+${#CONFIGURE_OPTIONS[*]} + if [ $(($((2**j)) & number)) -ne 0 ]; then + CFLAGS_OPT=$CFLAGS_OPT" "${CFLAGS_OPTIONS[$i]} + fi +done +if [ -n "$CFLAGS_OPT" ]; then + RANDOM_OPT=$RANDOM_OPT" ""CFLAGS=\"$CFLAGS_OPT\" " +fi +} + +# +# Write script result in LOG_FILE +# [first parameter: command to execute logging results] +# [optional other parameters: command parameters] +# +LOG_FILE=$PIPOL_HOMEDIR/.pipol/log/`date +%y%m%d`-`basename $0` + +function log() +{ +if ($*); + then RESULT="OK: " + else RESULT="FAILED:"; RET=1 +fi; +SCRIPT_NAME=`basename $1` +shift +echo $RESULT $REVISION $PIPOL_IMAGE $PIPOL_JOB_ID $SCRIPT_NAME $* >>$LOG_FILE +} + +# +# Set REVISION to the current revision number of the parameter +# [parameter: svn directory] +# +function get_revision() +{ +REVISION=$(cd $1; svn info|sed -n 's/Revision: // p'); +} + +# +# Make clean in compile directory without changing current working dir +# [parameter: source directory] +# +function clean_compile_dir() +{ +(cd $1; make -s clean) +} + + +### + +# +# Deploy images +# +#PIPOL esn amd64-linux-fedora-core8.dd.gz none 02:00 --silent --user +#PIPOL esn i386-linux-fedora-core8.dd.gz none 02:00 --silent --user + +#PIPOL esn amd64-linux-redhatEL-5.0.dd.gz none 02:00 --silent --user +#PIPOL esn i386-linux-redhatEL-5.0.dd.gz none 02:00 --silent --user +#PIPOL esn ia64-linux-redhatEL-5.0.dd none 02:00 --silent --user + + +### +### Following commands are executed on each and all deployed images +### + +# +# Get mpc trunk and compile it +# +unset REVISION +log $SCRIPTS_DIR/get-svn.sh mpc/trunk mpc-trunk +get_revision $PIPOL_WDIR/mpc-trunk +REVISION="mpc(r$REVISION)" +log $SCRIPTS_DIR/compile-svn.sh mpc-trunk + +# +# Get mpfr trunk and compile it with various options +# +unset REVISION +log $SCRIPTS_DIR/get-svn.sh mpfr/trunk mpfr-trunk +get_revision $PIPOL_WDIR/mpfr-trunk +REVISION="mpfr(r$REVISION)" +export GMP_CHECK_RANDOMIZE=1 +export MPFR_CHECK_MAX=1 +export MPFR_CHECK_ALL=1 +log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk + +clean_compile_dir $PIPOL_WDIR/mpfr-trunk +log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk --enable-assert=full + +clean_compile_dir $PIPOL_WDIR/mpfr-trunk +random_opt +log $SCRIPTS_DIR/compile-svn.sh mpfr-trunk $RANDOM_OPT + +# +# Return value is 0 if no script failed +# +exit $RET; diff --git a/tools/pipol/scripts/compile-svn.sh b/tools/pipol/scripts/compile-svn.sh new file mode 100755 index 0000000..ddabf39 --- /dev/null +++ b/tools/pipol/scripts/compile-svn.sh @@ -0,0 +1,14 @@ +#!/bin/sh +if [ $# -lt 1 ]; then + echo Usage: `basename $0` dir [options]; + echo -n "Configure, compile, and check sources in \$PIPOL_WDIR/dir " + echo passing options to the compiler; + exit 1; + + else + echo \*; echo \* $0 $*; echo \*; +fi + +cd $PIPOL_WDIR/$1 +shift +autoreconf -i && ./configure $* && make && make check; diff --git a/tools/pipol/scripts/get-svn.sh b/tools/pipol/scripts/get-svn.sh new file mode 100755 index 0000000..dab9285 --- /dev/null +++ b/tools/pipol/scripts/get-svn.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# Install sources from subversion repository in /pipol +# +REPO="https://scm.gforge.inria.fr/svn/" +if [ $# -ne 2 ]; then + echo "Usage: $0 svn_branch install_dir" + echo -n "Check out code source from $REPO/svn_branch " + echo "into \$PIPOL_WDIR/install_dir" + exit 1; +fi + +svn co ${REPO}$1 ${PIPOL_WDIR}/$2 + +#cd $PIPOL_WDIR +#svn co svn://scm.gforge.inria.fr/svn/mpfr/trunk svn-mpfr +#svn co https://scm.gforge.inria.fr/svn/mpc/trunk svn-mpc diff --git a/tools/pipol/yum.repos.d/fedora-development.repo b/tools/pipol/yum.repos.d/fedora-development.repo new file mode 100644 index 0000000..a23b706 --- /dev/null +++ b/tools/pipol/yum.repos.d/fedora-development.repo @@ -0,0 +1,48 @@ +# These packages are untested and still under development. This +# repository is used for updates to test releases, and for +# development of new releases. +# +# This repository can see significant daily turnover and major +# functionality changes which cause unexpected problems with other +# development packages. Please use these packages if you want to work +# with the Fedora developers by testing these new development packages. +# +# fedora-test-list@redhat.com is available as a discussion forum for +# testing and troubleshooting for development packages in conjunction +# with new test releases. +# +# More information is available at http://fedoraproject.org/wiki/Testing +# +# Reproducible and reportable issues should be filed at +# http://bugzilla.redhat.com/. +# +# Product: Fedora +# Version: devel + +[development] +name=Fedora - Development +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/development/$basearch/os/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch +enabled=1 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + +[development-debuginfo] +name=Fedora - Development - Debug +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/development/$basearch/debug/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide-debug&arch=$basearch +enabled=0 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + +[development-source] +name=Fedora - Development - Source +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide-source&arch=$basearch +enabled=0 +gpgcheck=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + diff --git a/tools/pipol/yum.repos.d/fedora-updates-testing.repo b/tools/pipol/yum.repos.d/fedora-updates-testing.repo new file mode 100644 index 0000000..513340e --- /dev/null +++ b/tools/pipol/yum.repos.d/fedora-updates-testing.repo @@ -0,0 +1,26 @@ +[updates-testing] +name=Fedora $releasever - $basearch - Test Updates +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/$releasever/$basearch/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test + +[updates-testing-debuginfo] +name=Fedora $releasever - $basearch - Test Updates Debug +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/$releasever/$basearch/debug/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-debug-f$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test + +[updates-testing-source] +name=Fedora $releasever - Test Updates Source +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/$releasever/SRPMS/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-source-f$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test diff --git a/tools/pipol/yum.repos.d/fedora-updates.repo b/tools/pipol/yum.repos.d/fedora-updates.repo new file mode 100644 index 0000000..24342bb --- /dev/null +++ b/tools/pipol/yum.repos.d/fedora-updates.repo @@ -0,0 +1,26 @@ +[updates] +name=Fedora $releasever - $basearch - Updates +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + +[updates-debuginfo] +name=Fedora $releasever - $basearch - Updates - Debug +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora + +[updates-source] +name=Fedora $releasever - Updates Source +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora diff --git a/tools/pipol/yum.repos.d/fedora.repo b/tools/pipol/yum.repos.d/fedora.repo new file mode 100644 index 0000000..7e5481f --- /dev/null +++ b/tools/pipol/yum.repos.d/fedora.repo @@ -0,0 +1,26 @@ +[fedora] +name=Fedora $releasever - $basearch +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY + +[fedora-debuginfo] +name=Fedora $releasever - $basearch - Debug +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY + +[fedora-source] +name=Fedora $releasever - Source +failovermethod=priority +#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/ +mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch +enabled=0 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY -- cgit v1.2.1