From b7f65af8d655dbf0b18260495fc9db2f4bd1dfd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Offringa?= Date: Fri, 15 Oct 2021 17:00:24 +0200 Subject: [PATCH 1/3] Docker container and CMake fixes This adds a Docker container. As reported by Bharat, the docker container would need boost python, but this dependency isn't needed by aartfaac2ms, so the cmake conf was changed to remove the boost python dependency. Also, Tammo Jan noted that cfitsio is not properly included, which is also fixed. --- CMakeLists.txt | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2ba95a..be4fc8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,18 +19,12 @@ include_directories(${CMAKE_SOURCE_DIR}/aocommon/include) find_package(AOFlagger 3 REQUIRED) include_directories(${AOFLAGGER_INCLUDE_DIR}) -find_package(Threads REQUIRED) +find_package(CFITSIO REQUIRED) +include_directories(${CFITSIO_INCLUDE_DIR}) -find_package(PythonLibs 3 REQUIRED) -find_package(PythonInterp 3 REQUIRED) -message(STATUS "Using python version ${PYTHON_VERSION_STRING}") +find_package(Threads REQUIRED) -set(BOOSTPY ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) -find_package(Boost 1.55.0 REQUIRED COMPONENTS date_time filesystem python${BOOSTPY}) -set(BOOST_PART_LIBRARIES ${Boost_LIBRARIES}) -# Numpy3 is in some versions of Boost part of python3, so don't 'require' it: -find_package(Boost 1.55.0 COMPONENTS numpy${BOOSTPY}) -set(Boost_LIBRARIES ${BOOST_PART_LIBRARIES} ${Boost_LIBRARIES}) +find_package(Boost 1.55.0 REQUIRED COMPONENTS date_time filesystem) set(CASACORE_MAKE_REQUIRED_EXTERNALS_OPTIONAL TRUE) find_package(Casacore REQUIRED COMPONENTS casa ms tables measures fits scimath scimath_f) @@ -61,8 +55,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(aartfaac2ms main.cpp aartfaac2ms.cpp aartfaacms.cpp averagingwriter.cpp fitsuser.cpp fitswriter.cpp mswriter.cpp progressbar.cpp stopwatch.cpp threadedwriter.cpp) target_link_libraries(aartfaac2ms ${AOFLAGGER_LIB} ${CASACORE_LIBRARIES} - ${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PYTHON_LIBRARIES} - ${PYTHON_LIBRARIES} + ${Boost_SYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY} Threads::Threads) add_executable(afedit afedit.cpp) From 052614910bf952684febccf7f3ced366aa296866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Offringa?= Date: Fri, 15 Oct 2021 17:06:27 +0200 Subject: [PATCH 2/3] Review comment --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be4fc8d..49f74f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(AOFlagger 3 REQUIRED) include_directories(${AOFLAGGER_INCLUDE_DIR}) find_package(CFITSIO REQUIRED) -include_directories(${CFITSIO_INCLUDE_DIR}) +include_directories(${CFITSIO_INCLUDE_DIRS}) find_package(Threads REQUIRED) From b19db8c9c7519763a6315ec57d4dbe98f95e01a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Offringa?= Date: Fri, 15 Oct 2021 17:07:13 +0200 Subject: [PATCH 3/3] Add the Docker file --- scripts/docker/Ubuntu20 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 scripts/docker/Ubuntu20 diff --git a/scripts/docker/Ubuntu20 b/scripts/docker/Ubuntu20 new file mode 100644 index 0000000..66b0968 --- /dev/null +++ b/scripts/docker/Ubuntu20 @@ -0,0 +1,40 @@ +FROM ubuntu:20.04 + +RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && \ + apt-get install -y \ + cmake \ + build-essential \ + pkg-config \ + git \ + casacore-data casacore-dev \ + libblas-dev liblapack-dev \ + liblua5.3-dev \ + python3 \ + libpython3-dev \ + libboost-date-time-dev libboost-test-dev \ + libboost-system-dev libboost-filesystem-dev \ + libgtkmm-3.0-dev \ + libcfitsio-dev \ + libfftw3-dev \ + libgsl-dev \ + libhdf5-serial-dev \ + libpng-dev + +RUN \ + mkdir /aoflagger && \ + cd /aoflagger && \ + git clone https://gitlab.com/aroffringa/aoflagger.git src && \ + mkdir /aoflagger/build && \ + cd /aoflagger/build && \ + cmake ../src && \ + make install -j`nproc --all` + +ADD . /src +WORKDIR /src + +RUN \ + mkdir /build && \ + cd /build && \ + cmake ../src && \ + make install -j`nproc --all` && \ + aartfaac2ms --version