From f0d287212f3093f0f384f8c2832257ed01554e6f Mon Sep 17 00:00:00 2001 From: Marcello Sega Date: Tue, 6 Oct 2015 10:01:18 +0200 Subject: [PATCH] initial travis support added --- .travis.yml | 51 ++++++++++++ CMakeLists.txt | 4 +- maintainer/travis/build.sh | 154 +++++++++++++++++++++++++++++++++++++ 3 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 .travis.yml create mode 100755 maintainer/travis/build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7844119 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,51 @@ +language: cpp + +before_install: +# - sudo apt-get clean +# - sudo apt-get update +# - sudo apt-get install build-essential +- sudo add-apt-repository --yes ppa:kalakris/cmake +- sudo apt-get update -qq +- sudo apt-get install libboost-dev +- sudo apt-get install cmake + +install: ./maintainer/travis/build.sh + +before_script: + - mkdir build + - cd build + - cmake .. -DMYGMX_TREE=gromacs-5.0.6 -DMYGMX_BUILD=gromacs-5.0.6/build + +script: make + + +#env: +# - myconfig=default +# - myconfig=maxset +# - myconfig=molcut +# - myconfig=rest1 +# - myconfig=rest2 +# - make_check=false myconfig=nocheck-maxset +# - with_fftw=false with_mpi=false myconfig=maxset + +compiler: + - gcc + + +#matrix: +# include: +# - compiler: clang +# env: with-mpi=false myconfig=default +# - compiler: clang +# env: with-mpi=false myconfig=maxset +# - compiler: clang +# env: with-mpi=false myconfig=molcut +# - compiler: clang +# env: with-mpi=false myconfig=rest1 +# - compiler: clang +# env: with-mpi=false myconfig=rest2 +# - compiler: clang +# env: with-mpi=false make_check=false myconfig=nocheck-maxset +# - compiler: clang +# env: with-mpi=false myconfig=maxset without-cuda +# diff --git a/CMakeLists.txt b/CMakeLists.txt index 71cf121..c95d268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ SET( GMX # these are possible subdirectories where to find headers/libs, for each of the GMX dirs. This # should take care of the tree differences between gmx v. 4 and v. 5, and minimize the changes in # the code. -SET (HEADER_SUBDIRS "include" "src/" "src/gmxlib" "src/gromacs/" "src/gromacs/utility" "src/gromacs/gmxana/" "src/gromacs/math/" "src/gromacs/fileio/" "src/gromacs/math/" "src/gromacs/pbcutil/" "src/gromacs/legacyheaders/" "src/gromacs/selection/" "lib/" "gmxlib" "gromacs/" "gromacs/utility" "gromacs/gmxana/" "gromacs/math/" "gromacs/fileio/" "gromacs/math/" "gromacs/pbcutil/" "gromacs/legacyheaders/" "gromacs/selection/" "src/gromacs/utilities/" "src/gromacs/legacyheaders/" ) +SET (HEADER_SUBDIRS "include" "src/" "src/gmxlib" "src/gromacs/" "src/gromacs/utility" "src/gromacs/gmxana/" "src/gromacs/math/" "src/gromacs/fileio/" "src/gromacs/math/" "src/gromacs/pbcutil/" "src/gromacs/legacyheaders/" "src/gromacs/selection/" "lib/" "gmxlib" "gromacs/" "gromacs/utility" "gromacs/gmxana/" "gromacs/math/" "gromacs/fileio/" "gromacs/math/" "gromacs/pbcutil/" "gromacs/legacyheaders/" "gromacs/selection/" "src/gromacs/utilities/" "src/gromacs/legacyheaders/" "src/external/boost") # let's combine everything SET(MYPATHS ${GMX}) @@ -82,7 +82,7 @@ IF(${GMX_VERSION} VERSION_LESS 50000) ELSE(${GMX_VERSION} VERSION_LESS 50000) ### version 5.x.x - SET (HEADERLIST "config.h" "version.h" "string.h" "smalloc.h" "gstat.h" "vec.h" "xvgr.h" "pbc.h" "copyrite.h" "futil.h" "tpxio.h" "gmx_ana.h" "nbsearch.h" "gromacs/commandline/cmdlinemodulemanager.h" "gmx_header_config_gen.h" "utility.h" "vec.h" ) + SET (HEADERLIST "config.h" "version.h" "string.h" "smalloc.h" "gstat.h" "vec.h" "xvgr.h" "pbc.h" "copyrite.h" "futil.h" "tpxio.h" "gmx_ana.h" "nbsearch.h" "gromacs/commandline/cmdlinemodulemanager.h" "gmx_header_config_gen.h" "utility.h" "vec.h" "boost/shared_ptr.hpp" ) SET (STATIC_LIBFILE libgromacs.a) IF( CMAKE_HOST_SYSTEM MATCHES Darwin) SET(CMAKE_FIND_FRAMEWORK LAST) diff --git a/maintainer/travis/build.sh b/maintainer/travis/build.sh new file mode 100755 index 0000000..81c5871 --- /dev/null +++ b/maintainer/travis/build.sh @@ -0,0 +1,154 @@ +#!/usr/bin/env bash +# Copyright (C) 2015 Marcello Sega +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +# HELPER FUNCTIONS + +# output value of env variables +function outp { + for p in $*; do + echo " $p=${!p}" + done +} + +# start a block +function start { + echo "==================================================" + echo "START $1" + echo "==================================================" +} + +# end a block +function end { + echo "==================================================" + echo "END $1" + echo "==================================================" +} + +# execute and output a command +function cmd { + echo ">$1" + eval $1 +} + + +# handle environment variables +[ -z "$insource" ] && insource="true" +[ -z "$srcdir" ] && srcdir=`pwd` +#[ -z "$configure_params" ] && configure_params="" +#[ -z "$configure_vars" ] && configure_vars="" +#[ -z "$with_mpi" ] && with_mpi="true" +#[ -z "$with_fftw" ] && with_fftw="true" +#[ -z "$with_tcl" ] && with_tcl="true" +#[ -z "$with_python_interface" ] && with_python_interface="true" +#[ -z "$myconfig" ] && myconfig="default" +#! $with_mpi && check_procs=1 +#[ -z "$check_procs" ] && check_procs=4 +#[ -z "$make_check" ] && make_check="true" + +if $insource; then + builddir=$srcdir +elif [ -z "$builddir" ]; then + builddir=$srcdir/build +fi + +outp insource srcdir builddir + +if ! $insource; then + if [ ! -d $builddir ]; then + echo "Creating $builddir..." + mkdir -p $builddir + fi +fi + +# BOOTSTRAP +start "GROMACS DOWNLOAD" +cmd "curl -O ftp://ftp.gromacs.org/pub/gromacs/gromacs-5.0.6.tar.gz" +end "GROMACS DOWNLOAD" + +if ! $insource ; then + cd $builddir +fi + +start "GROMACS BUILD" +cmd "tar -xzf gromacs-5.0.6.tar.gz" +cmd "mkdir gromacs-5.0.6/build" +( + cmd "cd gromacs-5.0.6/build" || exit $? + cmd "cmake .. -DGMX_BUILD_OWN_FFTW=ON" || exit $? + cmd "make" || exit $? +) +end "GROMACS BUILD" +# CONFIGURE +# # start "CONFIGURE" +# # +# # if $with_mpi; then +# # configure_params="--with-mpi $configure_params" +# # configure_vars="CXX=mpic++" +# # else +# # configure_params="--without-mpi $configure_params" +# # fi +# # +# # FFTW_HEADER=$srcdir/src/core/fftw3.h +# # if $with_fftw; then +# # configure_params="--with-fftw $configure_params" +# # else +# # configure_params="--without-fftw $configure_params" +# # echo "Not using FFTW => generating mock $FFTW_HEADER..." +# # echo "#error ERROR: fftw is not really present but used somewhere." \ +# # > $FFTW_HEADER +# # fi +# # +# # if $with_tcl; then +# # configure_params="--with-tcl $configure_params" +# # else +# # configure_params="--without-tcl $configure_params" +# # fi +# # +# # if $with_python_interface; then +# # configure_params="--with-python-interface $configure_params" +# # else +# # configure_params="--without-python-interface $configure_params" +# # fi +# # +# # cmd "$srcdir/configure $configure_params $configure_vars" || exit $? +# # end "CONFIGURE" +# # +# # # BUILD +# # start "BUILD" +# # +# # MYCONFIG_DIR=$srcdir/maintainer/jenkins/configs +# # if [ "$myconfig" = "default" ]; then +# # echo "Using default myconfig." +# # else +# # myconfig_file=$MYCONFIG_DIR/$myconfig.hpp +# # if [ ! -e "$myconfig_file" ]; then +# # echo "$myconfig_file does not exist!" +# # exit 1 +# # fi +# # echo "Copying $myconfig.hpp to $builddir/myconfig.hpp..." +# # cp $myconfig_file $builddir/myconfig.hpp +# # fi +# # +# # cmd "make" || exit $? +# # +# # end "BUILD" +# # +# # # CHECK +# # if $make_check; then +# # start "TEST" +# # +# # cmd "make check $make_params" +# # ec=$? +# # if [ $ec != 0 ]; then +# # cat $srcdir/testsuite/runtest.log +# # exit $ec +# # fi +# # +# # end "TEST" +# # fi