Skip to content

Commit

Permalink
Merge pull request #14 from aroffringa/docker-and-cmake
Browse files Browse the repository at this point in the history
Docker container and CMake fixes
  • Loading branch information
aroffringa committed Oct 15, 2021
2 parents 794a6b8 + b19db8c commit 15edd89
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 12 deletions.
17 changes: 5 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_DIRS})

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)
Expand Down Expand Up @@ -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)
Expand Down
40 changes: 40 additions & 0 deletions scripts/docker/Ubuntu20
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 15edd89

Please sign in to comment.