diff --git a/.travis.yml b/.travis.yml index 9a8155b..55e1471 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,20 +6,17 @@ language: cpp #env: before_install: - - docker pull ubuntu:xenial - - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build ubuntu:xenial + - docker pull fdiblen/ubuntu1604-test:latest + - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build fdiblen/ubuntu1604-test:latest + - docker pull fdiblen/sl7-test:latest + - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name sl-build fdiblen/sl7-test:latest # - docker pull base/archlinux # - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name arch-build base/archlinux - - docker pull scientificlinux/sl:7 - - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name sl-build scientificlinux/sl:7 script: - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH" - - docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/build-tests/ubuntu/prepare-ubuntu.sh" - - docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/build-tests/ubuntu/compile-ubuntu.sh" + - docker exec -e BRANCH=$BRANCH -e IMAGE='ubuntu' ubuntu-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh" + - docker exec -e BRANCH=$BRANCH -e IMAGE='sl7' sl-build /bin/bash -c "/travis/workdir/build-tests/compile_sagecal.sh" # - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/prepare-arch.sh" # - docker exec --env BRANCH=$BRANCH arch-build /bin/bash -c "/travis/workdir/build-tests/arch/compile-arch.sh" - - docker exec --env BRANCH=$BRANCH sl-build /bin/bash -c "/travis/workdir/build-tests/sl/prepare-sl.sh" - - docker exec --env BRANCH=$BRANCH sl-build /bin/bash -c "/travis/workdir/build-tests/sl/compile-sl.sh" - diff --git a/Docker/build_images.sh b/Docker/build_images.sh new file mode 100755 index 0000000..513ddfa --- /dev/null +++ b/Docker/build_images.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +version=$(date +"%d%m%Y") + +for folder in \ + sl7-test \ + ubuntu1604-test + +do + name=${folder%%/} + echo + echo "===========================================" + echo "Building: "$name + echo "===========================================" + + cmd="docker build -t fdiblen/$name:$version -t fdiblen/$name:latest ./$name" + echo + echo "Running:" + echo $cmd + echo + echo + eval $cmd + + if [ $? -eq 0 ] + then + echo + echo "Successfully built the $name image!" + else + echo + echo "Could not build the $name image" >&2 + exit $? + fi + + #docker push fdiblen/$name:$version + #docker push fdiblen/$name:latest +done diff --git a/Docker/sl7-test/Dockerfile b/Docker/sl7-test/Dockerfile new file mode 100644 index 0000000..29dc120 --- /dev/null +++ b/Docker/sl7-test/Dockerfile @@ -0,0 +1,42 @@ +FROM scientificlinux/sl:7 +MAINTAINER f.diblen@esciencecenter.nl + +# add EPEL repository for openblas +RUN yum -y \ + install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + +# install dependencies +RUN yum -y install \ + wget git pkgconfig make cmake3 cmake3-gui gcc-gfortran gcc-c++ flex bison \ + openblas openblas-devel glib2-devel lapack lapack-devel cfitsio cfitsio-devel \ + wcslib wcslib-devel ncurses ncurses-devel readline readline-devel \ + python-devel boost boost-devel fftw fftw-devel hdf5 hdf5-devel \ + numpy boost-python + +RUN mkdir /build && cd /build + +# compile casacore +RUN git clone --progress --verbose https://github.com/casacore/casacore.git casacore_src && \ + cd casacore_src && \ + mkdir build && cd build && \ + cmake3 .. -DUSE_FFTW3=ON \ + -DCMAKE_INSTALL_PREFIX=/opt/casacore \ + -DDATA_DIR=/opt/casacore/data -DUSE_OPENMP=ON \ + -DUSE_HDF5=ON \ + -DBUILD_PYTHON=ON \ + -DUSE_THREADS=ON && \ + make -j4 && \ + make install + + +## compile sagecal +#RUN cd /build && \ +# mkdir build-sl && cd build-sl && \ +# cmake3 .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal \ +# -DCASACORE_ROOT_DIR=/opt/casacore \ +# -DCASACORE_INCLUDE=/opt/casacore/include/casacore +# make -j4 && \ +# make install && \ +# +#RUN ls -alsrt /opt/sagecal && \ +# /opt/sagecal/bin/sagecal diff --git a/Docker/ubuntu1604-test/Dockerfile b/Docker/ubuntu1604-test/Dockerfile new file mode 100644 index 0000000..c41cfe5 --- /dev/null +++ b/Docker/ubuntu1604-test/Dockerfile @@ -0,0 +1,26 @@ +FROM ubuntu:xenial +MAINTAINER f.diblen@esciencecenter.nl + +RUN apt-get update -y && \ + apt-get install software-properties-common -y && \ + add-apt-repository -s ppa:kernsuite/kern-3 -y && \ + apt-add-repository multiverse && \ + apt-get update -y + +RUN apt-get install -y \ + git cmake g++ pkg-config \ + libcfitsio-bin libcfitsio-dev \ + libopenblas-base libopenblas-dev \ + wcslib-dev wcslib-tools \ + libglib2.0-dev \ + libcasa-casa2 casacore-dev casacore-data casacore-tools + + +## compile sagecal +#RUN mkdir /build && cd /build \ +# mkdir build-ubuntu && cd build-ubuntu && \ +# cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \ +# make -j4 && \ +# make install && \ +# ls -alsrt /opt/sagecal && \ +# /opt/sagecal/bin/sagecal diff --git a/build-tests/arch/compile-arch.sh b/build-tests/arch/compile-arch.sh deleted file mode 100755 index 3d1260c..0000000 --- a/build-tests/arch/compile-arch.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -echo "Building SageCal" && \ -echo "Branch --> $BRANCH" && \ -cd /travis/workdir && \ -mkdir build-arch && cd build-arch && \ -cmake .. -DENABLE_CUDA=OFF && \ -make -j4 && \ -ls -alsrt ./dist/bin && \ -./dist/bin/sagecal - diff --git a/build-tests/arch/prepare-arch.sh b/build-tests/arch/prepare-arch.sh deleted file mode 100755 index cbd94ad..0000000 --- a/build-tests/arch/prepare-arch.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -pacman -Syy --needed --noconfirm \ - base-devel cmake git glib2 cfitsio wcslib diff --git a/build-tests/compile_sagecal.sh b/build-tests/compile_sagecal.sh new file mode 100644 index 0000000..67f878f --- /dev/null +++ b/build-tests/compile_sagecal.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +echo 'script: ' $0 + +echo "Building SageCal" && \ +echo "Branch --> $BRANCH" && \ +echo "Image --> $IMAGE" + +cd /travis/workdir && \ + mkdir build && cd build + +OPTS='' + +case $IMAGE in + ubuntu) + OPTS='' + ;; + sl7) + OPTS='-DUSE_FFTW3=ON \ + -DCMAKE_INSTALL_PREFIX=/opt/casacore \ + -DDATA_DIR=/opt/casacore/data -DUSE_OPENMP=ON \ + -DUSE_HDF5=ON \ + -DBUILD_PYTHON=ON \ + -DUSE_THREADS=ON' + ;; + arch) + OPTS='' + ;; + *) + echo 'Unknown image $IMAGE!' + exit 1 + ;; +esac + + +echo 'CMake options: ' $OPTS + +cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal \ + $OPTS + +make -j4 && \ +make install && \ +ls -alsrt /opt/sagecal && \ +/opt/sagecal/bin/sagecal diff --git a/build-tests/sl/compile-sl.sh b/build-tests/sl/compile-sl.sh deleted file mode 100755 index 0a245eb..0000000 --- a/build-tests/sl/compile-sl.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -echo "Building SageCal for Scientific Linux" && \ -echo "Branch --> $BRANCH" && \ -cd /travis/workdir - -# compile casacore first - -# mkdir -p /opt/soft/casacore/data -# cd /opt/soft/casacore/data -# wget -c ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar -# tar zxfv WSRT_Measures.ztar && rm -f WSRT_Measures.ztar - -cd /travis/workdir -git clone --progress --verbose https://github.com/casacore/casacore.git casacore_src && cd casacore_src - -mkdir build && cd build -cmake3 -DUSE_FFTW3=ON -DCMAKE_INSTALL_PREFIX=/opt/soft/casacore -DDATA_DIR=/opt/soft/casacore/data -DUSE_OPENMP=ON \ - -DUSE_HDF5=ON -DBUILD_PYTHON=ON -DUSE_THREADS=ON .. -make -j4 -make install - -# compile sagecal -cd /travis/workdir && \ -mkdir build-sl && cd build-sl - -cmake3 .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \ - -DCASACORE_ROOT_DIR=/opt/soft/casacore -DCASACORE_INCLUDE=/opt/soft/casacore/include/casacore -make -j4 && \ -make install && \ -ls -alsrt /opt/sagecal && \ -/opt/sagecal/bin/sagecal diff --git a/build-tests/sl/prepare-sl.sh b/build-tests/sl/prepare-sl.sh deleted file mode 100755 index 7b26817..0000000 --- a/build-tests/sl/prepare-sl.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# add EPEL repository for openblas -yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - -# install dependencies -yum -y install wget git pkgconfig make cmake3 cmake3-gui gcc-gfortran gcc-c++ flex bison \ - openblas openblas-devel glib2-devel lapack lapack-devel cfitsio cfitsio-devel \ - wcslib wcslib-devel ncurses ncurses-devel readline readline-devel\ - python-devel boost boost-devel fftw fftw-devel hdf5 hdf5-devel\ - numpy boost-python \ No newline at end of file diff --git a/build-tests/ubuntu/compile-ubuntu.sh b/build-tests/ubuntu/compile-ubuntu.sh deleted file mode 100755 index 6308bfc..0000000 --- a/build-tests/ubuntu/compile-ubuntu.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -echo "Building SageCal" && \ -echo "Branch --> $BRANCH" && \ -cd /travis/workdir && \ -mkdir build-ubuntu && cd build-ubuntu && \ -cmake .. -DCMAKE_INSTALL_PREFIX=/opt/sagecal && \ -make -j4 && \ -make install && \ -ls -alsrt /opt/sagecal && \ -/opt/sagecal/bin/sagecal - diff --git a/build-tests/ubuntu/prepare-ubuntu.sh b/build-tests/ubuntu/prepare-ubuntu.sh deleted file mode 100755 index 79cf219..0000000 --- a/build-tests/ubuntu/prepare-ubuntu.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -apt-get update -y -apt-get install software-properties-common -y -add-apt-repository -s ppa:kernsuite/kern-3 -y -apt-add-repository multiverse -apt-get update -y -apt-get install -y git cmake g++ pkg-config libcfitsio-bin libcfitsio-dev libopenblas-base libopenblas-dev wcslib-dev wcslib-tools libglib2.0-dev libcasa-casa2 casacore-dev casacore-data casacore-tools -