Skip to content

Commit

Permalink
Merge branch 'ubuntu-18-build' into 'master'
Browse files Browse the repository at this point in the history
Ubuntu 18 build

See merge request RD/DP3!302
  • Loading branch information
mnijhuis-tos committed Dec 3, 2020
2 parents 545686a + 0e29938 commit 50de337
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 73 deletions.
13 changes: 11 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ build-base:
- docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH -f ./docker/ubuntu_20_04_base .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH

build-ubuntu18:
stage: build
needs: []
script:
- docker build -f ./docker/ubuntu_18_04 .
only:
variables:
- $CI_SERVER_HOST == "git.astron.nl"

build-no-idg:
stage: build
needs: ["build-base"]
Expand Down Expand Up @@ -46,14 +55,14 @@ build-debug:
paths:
- build

build-lofar-release:
build-release:
stage: build
image: docker:stable
services:
- docker:dind
needs: ["build-base"]
script:
- docker build --build-arg BASE_TAG=$CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH --tag dppp_lofar:${CI_COMMIT_SHORT_SHA} -f ./docker/ubuntu_20_04_lofar .
- docker build --build-arg BASE_TAG=$CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH --tag dppp_lofar:${CI_COMMIT_SHORT_SHA} -f ./docker/ubuntu_20_04_dppp .

build-doc:
stage: build
Expand Down
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
# FindHDF5 uses NATIVE_COMMAND in separate_arguments, which requires
# CMake 3.9.
cmake_minimum_required(VERSION 3.9)
cmake_policy(SET CMP0074 NEW)

# CMake >= 3.19.1 gives a warning when this policy is not 'NEW'.
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.1")
cmake_policy(SET CMP0074 NEW)
endif()

# Set version number and project name.
set(DP3_VERSION 5.0.0)
Expand Down Expand Up @@ -85,14 +89,24 @@ endif(IDGAPI_LIBRARIES AND IDGAPI_INCLUDE_DIRS)
find_package(CFITSIO REQUIRED)
include_directories(${CFITSIO_INCLUDE_DIRS})

find_package(Python3 COMPONENTS Interpreter Development)
message(STATUS "Using python version ${Python3_VERSION}")
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12")
find_package(Python3 COMPONENTS Interpreter Development)
set(BOOSTPY ${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
else() # Use old, deprecated means of detecting python.
find_package(PythonInterp 3 REQUIRED)
find_package(PythonLibs 3 REQUIRED)
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
set(Python3_VERSION ${PYTHON_VERSION_STRING})
set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
set(BOOSTPY "")
endif()

message(STATUS "Using python version ${Python3_VERSION}")
include_directories(${Python3_INCLUDE_DIRS})

#Prevent accidentally finding old BoostConfig.cmake file from casapy
set(Boost_NO_BOOST_CMAKE ON)
set(BOOSTPY ${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
find_package(Boost COMPONENTS date_time filesystem python${BOOSTPY} numpy${BOOSTPY} program_options system unit_test_framework REQUIRED)
include_directories(${Boost_INCLUDE_DIR})

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The DPPP documentation can be found at: https://www.astron.nl/citt/DP3
This repository is a continuation of the one at svn.astron.nl/LOFAR. In particular, it has branched off at LOFAR Release 3.2 (Sept 2018). The version of DP3 that is in the ASTRON repository is no longer maintained.

## Installation
Some non-standard dependencies of this project are: armadillo, boost, boost-python, casacore, hdf5, aoflagger, and EveryBeam. See the Dockerfiles [`docker/ubuntu_20_04_base`](docker/ubuntu_20_04_base) and [`docker/ubuntu_20_04_lofar`](docker/ubuntu_20_04_lofar) as examples.
Some non-standard dependencies of this project are: armadillo, boost, boost-python, casacore, hdf5, aoflagger, and EveryBeam. See the Dockerfiles [`docker/ubuntu_20_04_base`](docker/ubuntu_20_04_base) and [`docker/ubuntu_20_04_dppp`](docker/ubuntu_20_04_dppp) as examples.

Typical installation commands:
```
Expand Down
49 changes: 49 additions & 0 deletions docker/ubuntu_18_04
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM ubuntu:18.04

ENV EVERYBEAM_VERSION_TAG=v0.1.1
ENV IDG_VERSION_TAG=0.8

RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \
apt-get install -y \
libboost-python-dev libcfitsio-dev python3-dev python3-numpy cmake wget \
build-essential libhdf5-serial-dev libarmadillo-dev \
libboost-filesystem-dev libboost-system-dev libboost-date-time-dev \
libboost-program-options-dev libboost-test-dev \
libxml2-dev libpng-dev pkg-config \
libgtkmm-3.0-dev git libfftw3-dev \
gfortran flex bison wcslib-dev \
libboost-numpy-dev liblua5.3-dev \
casacore-dev casacore-tools pybind11-dev python3-pip ninja-build \
# Build aoflagger3.
# Use make, since ninja in Ubuntu 18 does not support Fortran.
&& mkdir /aoflagger && cd /aoflagger \
&& git clone https://gitlab.com/aroffringa/aoflagger.git src \
&& mkdir build && cd build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr ../src \
&& make install -j$(($(nproc) / 2 > 0 ? $(nproc) / 2:1)) \
&& cd / && rm -rf aoflagger \
# Build IDG
&& mkdir /idg && cd /idg \
&& git clone https://git.astron.nl/RD/idg.git src \
&& ( cd src/ && git checkout ${IDG_VERSION_TAG} ) \
&& mkdir build && cd build \
&& cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr ../src \
&& ninja install \
&& cd / && rm -rf idg \
# Build EveryBeam
&& mkdir /everybeam && cd /everybeam \
&& git clone https://git.astron.nl/RD/EveryBeam.git src \
&& ( cd src/ && git checkout ${EVERYBEAM_VERSION_TAG} ) \
&& mkdir build && cd build \
&& cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr ../src -DPYTHON_EXECUTABLE=/usr/bin/python3 \
&& ninja install \
&& cd / && rm -rf everybeam

ADD . /src

# Build DPPP
RUN mkdir /build && cd /build \
&& cmake -G Ninja ../src \
&& ninja install \
&& DPPP \
&& rm -r /src /build
37 changes: 0 additions & 37 deletions docker/ubuntu_18_04_lofar

This file was deleted.

29 changes: 0 additions & 29 deletions docker/ubuntu_18_04_nolofar

This file was deleted.

File renamed without changes.

0 comments on commit 50de337

Please sign in to comment.