Commits

Ben Andre  committed 95936e6

buildbot: update builbot script to work with buildbot refactor

  • Participants
  • Parent commits b358a79

Comments (0)

Files changed (14)

File tools/buildbot/build-flags/alternate.txt

+ 

File tools/buildbot/build-flags/standard.txt

+-f makefile_new

File tools/buildbot/builder-info/bandre-mac-gnu.txt

- 

File tools/buildbot/builder-info/fuji-linux-gnu.txt

--f makefile_new

File tools/buildbot/petsc/configure-bandre-gnu.py

+#!/usr/bin/env python
+if __name__ == '__main__':
+  import sys
+  import os
+  sys.path.insert(0, os.path.abspath('config'))
+  import configure
+  configure_options = [
+    '--download-hdf5=1',
+    '--with-blas-lapack-lib=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Accelerate',
+    '--download-parmetis=yes',
+    '--download-metis=yes',
+    '--with-cc=/opt/local/bin/mpicc',
+    '--with-cxx=/opt/local/bin/mpic++',
+    '--with-fc=/opt/local/bin/mpif90',
+    '--with-mpiexec=/opt/local/bin/mpiexec',
+    '--with-shared-libraries=0',
+    'PETSC_ARCH=bandre-gnu',
+  ]
+  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-bandre-mac-gnu.py

-#!/usr/bin/env python
-if __name__ == '__main__':
-  import sys
-  import os
-  sys.path.insert(0, os.path.abspath('config'))
-  import configure
-  configure_options = [
-    '--download-hdf5=1',
-    '--with-blas-lapack-lib=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Accelerate',
-    '--download-parmetis=yes',
-    '--download-metis=yes',
-    '--with-cc=/opt/local/bin/mpicc',
-    '--with-cxx=/opt/local/bin/mpic++',
-    '--with-fc=/opt/local/bin/mpif90',
-    '--with-mpiexec=/opt/local/bin/mpiexec',
-    'PETSC_ARCH=bandre-mac-gnu',
-  ]
-  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-bryce-gnu.py

+#!/usr/bin/env python2.7
+if __name__ == '__main__':
+  import sys
+  import os
+  sys.path.insert(0, os.path.abspath('config'))
+  import configure
+  configure_options = [
+    '--download-f-blas-lapack=yes',
+    '--download-metis=yes',
+    '--download-parmetis=yes',
+    '--download-hdf5=yes',
+    '--download-mpich=yes',
+    '--download-cmake=yes',
+    '--with-cc=/data/software/sl-6.x86_64/modules/langs/gcc/4.7.3/bin/gcc',
+    '--with-cxx=/data/software/sl-6.x86_64/modules/langs/gcc/4.7.3/bin/g++',
+    '--with-fc=/data/software/sl-6.x86_64/modules/langs/gcc/4.7.3/bin/gfortran',
+    '--with-clanguage=c',
+    '--with-debugging=1',
+    '--with-shared-libraries=0',
+    'PETSC_ARCH=bryce-gnu',
+  ]
+  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-bryce-linux-gnu.py

-#!/usr/bin/env python2.7
-if __name__ == '__main__':
-  import sys
-  import os
-  sys.path.insert(0, os.path.abspath('config'))
-  import configure
-  configure_options = [
-    '--download-f-blas-lapack=yes',
-    '--download-metis=yes',
-    '--download-parmetis=yes',
-    '--download-hdf5=yes',
-    '--download-mpich=yes',
-    '--download-cmake=yes',
-    '--with-cc=/data/software/sl-6.x86_64/modules/langs/gcc/4.7.3/bin/gcc',
-    '--with-cxx=/data/software/sl-6.x86_64/modules/langs/gcc/4.7.3/bin/g++',
-    '--with-fc=/data/software/sl-6.x86_64/modules/langs/gcc/4.7.3/bin/gfortran',
-    '--with-clanguage=c',
-    '--with-debugging=1',
-    '--with-shared-libraries=0',
-    'PETSC_ARCH=bryce-linux-gnu',
-  ]
-  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-durango-gnu.py

+#!/usr/bin/env python
+if __name__ == '__main__':
+  import sys
+  import os
+  sys.path.insert(0, os.path.abspath('config'))
+  import configure
+  configure_options = [
+    '--download-hdf5=1',
+    '--with-blas-lapack-lib=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Accelerate',
+    '--download-parmetis=yes',
+    '--download-metis=yes',
+    '--with-cc=/opt/local/bin/mpicc',
+    '--with-cxx=/opt/local/bin/mpic++',
+    '--with-fc=/opt/local/bin/mpif90',
+    '--with-mpiexec=/opt/local/bin/mpiexec',
+    '--with-shared-libraries=0',
+    'PETSC_ARCH=durango-gnu',
+  ]
+  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-fuji-gnu.py

+#!/files0/software/python2.7/bin/python
+if __name__ == '__main__':
+  import sys
+  import os
+  sys.path.insert(0, os.path.abspath('config'))
+  import configure
+  configure_options = [
+    '--FFLAGS=',
+    '--download-f-blas-lapack=yes',
+    '--download-hypre=yes',
+    '--download-metis=yes',
+    '--download-parmetis=yes',
+    '--with-cc=/files0/software/mpich2-1.4.1p1/gcc-4.7.2/bin/mpicc',
+    '--with-clanguage=c',
+    '--with-cxx=/files0/software/mpich2-1.4.1p1/gcc-4.7.2/bin/mpicxx',
+    '--with-debugging=1',
+    '--with-fc=/files0/software/mpich2-1.4.1p1/gcc-4.7.2/bin/mpif90',
+    '--with-hdf5-dir=/files0/software/hdf5-1.8.9/gcc-4.7.2',
+    '--with-hdf5=1',
+    '--with-petsc-arch=fuji-linux-gnu',
+    '--with-shared-libraries=0',
+    '--with-valgrind=1',
+    'PETSC_ARCH=fuji-gnu',
+  ]
+  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-fuji-linux-gnu.py

-#!/files0/software/python2.7/bin/python
-if __name__ == '__main__':
-  import sys
-  import os
-  sys.path.insert(0, os.path.abspath('config'))
-  import configure
-  configure_options = [
-    '--FFLAGS=',
-    '--download-f-blas-lapack=yes',
-    '--download-hypre=yes',
-    '--download-metis=yes',
-    '--download-parmetis=yes',
-    '--with-cc=/files0/software/mpich2-1.4.1p1/gcc-4.7.2/bin/mpicc',
-    '--with-clanguage=c',
-    '--with-cxx=/files0/software/mpich2-1.4.1p1/gcc-4.7.2/bin/mpicxx',
-    '--with-debugging=1',
-    '--with-fc=/files0/software/mpich2-1.4.1p1/gcc-4.7.2/bin/mpif90',
-    '--with-hdf5-dir=/files0/software/hdf5-1.8.9/gcc-4.7.2',
-    '--with-hdf5=1',
-    '--with-petsc-arch=fuji-linux-gnu',
-    '--with-shared-libraries=0',
-    '--with-valgrind=1',
-    'PETSC_ARCH=fuji-linux-gnu',
-  ]
-  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-margaux-gnu.py

+#!/usr/bin/env python
+if __name__ == '__main__':
+  import sys
+  import os
+  sys.path.insert(0, os.path.abspath('config'))
+  import configure
+  configure_options = [
+    '--download-hdf5=1',
+    '--with-blas-lapack-lib=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Accelerate',
+    '--download-parmetis=yes',
+    '--download-metis=yes',
+    '--with-cc=/opt/local/bin/mpicc',
+    '--with-cxx=/opt/local/bin/mpic++',
+    '--with-fc=/opt/local/bin/mpif90',
+    '--with-mpiexec=/opt/local/bin/mpiexec',
+    '--with-shared-libraries=0',
+    'PETSC_ARCH=margaux-gnu',
+  ]
+  configure.petsc_configure(configure_options)

File tools/buildbot/petsc/configure-margaux-mac-gnu.py

-#!/usr/bin/env python
-if __name__ == '__main__':
-  import sys
-  import os
-  sys.path.insert(0, os.path.abspath('config'))
-  import configure
-  configure_options = [
-    '--download-hdf5=1',
-    '--with-blas-lapack-lib=/System/Library/Frameworks/Accelerate.framework/Versions/Current/Accelerate',
-    '--download-parmetis=yes',
-    '--download-metis=yes',
-    '--with-cc=/opt/local/bin/mpicc',
-    '--with-cxx=/opt/local/bin/mpic++',
-    '--with-fc=/opt/local/bin/mpif90',
-    '--with-mpiexec=/opt/local/bin/mpiexec',
-    'PETSC_ARCH=margaux-mac-gnu',
-  ]
-  configure.petsc_configure(configure_options)

File tools/buildbot/pflotran-build.sh

 #    additional TPLs needed for that builder, i.e. hdf5, metis and
 #    parmetis for unstructured mesh.
 #
-#  - 
+#  - NOTE: petsc must be built with '--with-shared-libraries=0'
+#    because we check for the presence of libpetsc.a to figure out if
+#    a petsc build is acceptable.
+#
 #
 ################################################################################
 
 ################################################################################
 
 function set-builder-info() {
-    _id_file="${HOME}/.pflotran-buildbot-id"
-    if [ ! -f ${_id_file} ]; then
-        echo "ERROR: could not find builder id file: ${_id_file}"
-        exit 1
-    fi
-    BUILDER_ID=`cat ${_id_file}`
-    PETSC_ARCH=${BUILDER_ID}
+    BUILDER_ID=`hostname -s`
+    PETSC_ARCH=${BUILDER_ID}-${COMPILER}
 
     echo "pflotran builder id : ${BUILDER_ID}"
 
             echo "Rebuilding PETSc at version: ${_petsc_required_version}"
             petsc-build ${_petsc_required_version}
         fi
-        if [ ! -d ${PETSC_DIR}/${PETSC_ARCH} ]; then
-            echo "PETSc does not appear to have been built yet."
+        _lib_petsc=${PETSC_DIR}/${PETSC_ARCH}/lib/libpetsc.a
+        if [ ! -f ${_lib_petsc} ]; then
+            echo "PETSc : could not find libpetsc.a for this PETSC_ARCH. Rebuilding."
+            echo "    ${_lib_petsc}"
             petsc-build ${_petsc_required_version}
         fi
     else
     echo "  PETSC_ARCH=${PETSC_ARCH}"
     export PETSC_DIR PETSC_ARCH
     _pflotran_flags=
-    _info_file=${PFLOTRAN_DIR}/tools/buildbot/builder-info/${BUILDER_ID}.txt
-    if [ -f ${_info_file} ]; then
-        _pflotran_flags=`cat ${_info_file}`
+    _flags_file=${PFLOTRAN_DIR}/tools/buildbot/build-flags/${BUILD_FLAGS}.txt
+    if [ -f ${_flags_file} ]; then
+        _pflotran_flags=`cat ${_flags_file}`
         echo "  pflotran build flags=${_pflotran_flags}"
     else
-        echo "Could not find builder info file: ${_info_file}. Building vanilla pflotran."
+        echo "Could not find build flags file: ${_flags_file}. Building with 'make pflotran'."
     fi
     
     cd ${PFLOTRAN_DIR}/src/pflotran
     export PETSC_DIR PETSC_ARCH
     _test_dir=${PFLOTRAN_DIR}/regression_tests
     _pflotran_flags=
-    _info_file=${PFLOTRAN_DIR}/tools/buildbot/builder-info/${BUILDER_ID}.txt
-    if [ -f ${_info_file} ]; then
-        _pflotran_flags=`cat ${_info_file}`
+    _flags_file=${PFLOTRAN_DIR}/tools/buildbot/build-flags/${BUILD_FLAGS}.txt
+    if [ -f ${_flags_file} ]; then
+        _pflotran_flags=`cat ${_flags_file}`
         echo "  pflotran build flags=${_pflotran_flags}"
 
-        grep -e "makefile_new" ${_info_file} &> /dev/null
+        grep -e "makefile_new" ${_flags_file} &> /dev/null
         if [ "$?" -eq "0" ]; then
             _test_dir=${PFLOTRAN_DIR}/regression_tests_refactor
         fi
     else
-        echo "Could not find builder info file: ${_info_file}. Testing vanilla pflotran."
+        echo "Could not find build flags file: ${_flags_file}. Testing with 'make pflotran'."
     fi
 
     echo "  test directory : ${_test_dir}"
 function usage() {
      echo "
 Usage: $0 [options]
+    -b BUILD_FLAGS    group of build flags to use.
+    -c COMPILER       compiler name: gnu, pgi, intel
     -h                print this help message
     -p PFLOTRAN_DIR   root directory for the build (default: '.')
     -s BUILD_STAGE    build stage must be one of:
 
 Notes:
 
+  - The build flags group must have a corresponding file in the
+    tools/buildbot/build-flags/ directory.
+
 "
 }
 
 # setup based on commandline args
+BUILD_FLAGS="__NONE__"
 BUILD_STAGE=
-while getopts "hp:s:" FLAG
+COMPILER=
+while getopts "b:c:hp:s:" FLAG
 do
   case ${FLAG} in
+    b) BUILD_FLAGS=${OPTARG};;
+    c) COMPILER=${OPTARG};;
+    h) usage;;
     p) PFLOTRAN_DIR=${OPTARG};;
     s) BUILD_STAGE=${OPTARG};;
-    h) usage;;
   esac
 done
 
     exit 1
 fi
 
+if [ -z "${COMPILER}" ]; then
+    echo "ERROR: The compiler name must be provided on the command line."
+    exit 1
+fi
+
 set-builder-info
 
 echo "PFLOTRAN_DIR: ${PFLOTRAN_DIR}"