diff --git a/.gitignore b/.gitignore index 4e08c7a..cb06cfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +build + .idea */*.png diff --git a/.travis.yml b/.travis.yml index 6565cc9..5cc25d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,18 @@ language: cpp before_install: - docker pull ubuntu:xenial - docker run -itd -v "${TRAVIS_BUILD_DIR}:/travis/workdir" --name ubuntu-build ubuntu:xenial +# - 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 ubuntu-build apt-get update -y - - docker exec ubuntu-build apt-get install software-properties-common -y - - docker exec ubuntu-build add-apt-repository -s ppa:kernsuite/kern-3 -y - - docker exec ubuntu-build apt-add-repository multiverse - - docker exec ubuntu-build apt-get update -y - - docker exec ubuntu-build 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 - - | - docker exec --env BRANCH=$BRANCH ubuntu-build /bin/bash -c "/travis/workdir/test-builds/test-ubuntu.sh" + - 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 --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/CMakeLists.txt b/CMakeLists.txt index 9f52744..aedcefa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(PROJECT_VERSION_REVISION 1) set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") +message(STATUS "\n############################\n# HOST SYSTEM v${CMAKE_HOST_SYSTEM_NAME}\n############################") message(STATUS "\n############################\n# Building SageCal v${PROJECT_VERSION}\n############################") include(CheckCXXCompilerFlag) diff --git a/test-builds/test-ubuntu.sh b/build-tests/arch/compile-arch.sh similarity index 70% rename from test-builds/test-ubuntu.sh rename to build-tests/arch/compile-arch.sh index 7b76101..3d1260c 100755 --- a/test-builds/test-ubuntu.sh +++ b/build-tests/arch/compile-arch.sh @@ -1,9 +1,9 @@ #!/bin/bash -echo "Building SageCal" && \ +echo "Building SageCal" && \ echo "Branch --> $BRANCH" && \ cd /travis/workdir && \ -mkdir build && cd build && \ +mkdir build-arch && cd build-arch && \ cmake .. -DENABLE_CUDA=OFF && \ make -j4 && \ ls -alsrt ./dist/bin && \ diff --git a/build-tests/arch/prepare-arch.sh b/build-tests/arch/prepare-arch.sh new file mode 100755 index 0000000..cbd94ad --- /dev/null +++ b/build-tests/arch/prepare-arch.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +pacman -Syy --needed --noconfirm \ + base-devel cmake git glib2 cfitsio wcslib diff --git a/build-tests/sl/compile-sl.sh b/build-tests/sl/compile-sl.sh new file mode 100755 index 0000000..448c0fe --- /dev/null +++ b/build-tests/sl/compile-sl.sh @@ -0,0 +1,32 @@ +#!/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 .. -DENABLE_CUDA=OFF && \ + -DCASACORE_ROOT_DIR=/opt/soft/casacore -DCASACORE_INCLUDE=/opt/soft/casacore/include/casacore +make -j4 && \ +ls -alsrt ./dist/bin && \ +./dist/bin/sagecal + diff --git a/build-tests/sl/prepare-sl.sh b/build-tests/sl/prepare-sl.sh new file mode 100755 index 0000000..7b26817 --- /dev/null +++ b/build-tests/sl/prepare-sl.sh @@ -0,0 +1,11 @@ +#!/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 new file mode 100755 index 0000000..061a81a --- /dev/null +++ b/build-tests/ubuntu/compile-ubuntu.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Building SageCal" && \ +echo "Branch --> $BRANCH" && \ +cd /travis/workdir && \ +mkdir build-ubuntu && cd build-ubuntu && \ +cmake .. -DENABLE_CUDA=OFF && \ +make -j4 && \ +ls -alsrt ./dist/bin && \ +./dist/bin/sagecal + diff --git a/build-tests/ubuntu/prepare-ubuntu.sh b/build-tests/ubuntu/prepare-ubuntu.sh new file mode 100755 index 0000000..79cf219 --- /dev/null +++ b/build-tests/ubuntu/prepare-ubuntu.sh @@ -0,0 +1,9 @@ +#!/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 +