File: py_wheel.docker

package info (click to toggle)
casacore 3.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,912 kB
  • sloc: cpp: 471,569; fortran: 16,372; ansic: 7,416; yacc: 4,714; lex: 2,346; sh: 1,865; python: 629; perl: 531; sed: 499; csh: 201; makefile: 32
file content (80 lines) | stat: -rw-r--r-- 2,476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM quay.io/pypa/manylinux2014_x86_64

# how many threads to use for compiling
ARG THREADS=4

# These variables MUST be set using the --build-arg option
ARG PYMAJOR
ARG PYMINOR

ENV TARGET cp${PYMAJOR}${PYMINOR}-cp${PYMAJOR}${PYMINOR}

# boost version
ENV BOOSTMAJOR 85
ENV BOOSTMINOR 0
ENV BOOST 1.${BOOSTMAJOR}.${BOOSTMINOR}
ENV BOOST_ 1_${BOOSTMAJOR}_${BOOSTMINOR}

# where do we epect casacore data build time and runtime
ENV CASACORE_DATA /usr/share/casacore/data

# install rpms
RUN yum install -y flex cfitsio-devel blas-devel lapack-devel ncurses-devel readline-devel fftw-devel wcslib-devel gsl-devel

# download other source code
WORKDIR /tmp
RUN curl -L http://www.iausofa.org/s/sofa_f-20231011tar.gz --output /tmp/sofa.tgz
RUN curl -L https://www.astron.nl/iers/WSRT_Measures.ztar --output /tmp/measures.tgz
RUN curl -L https://downloads.sourceforge.net/project/boost/boost/${BOOST}/boost_${BOOST_}.tar.bz2 --output /tmp/boost.tar.bz2

RUN mkdir /build
WORKDIR /build

RUN mkdir -p ${CASACORE_DATA}
WORKDIR ${CASACORE_DATA}
RUN tar zxvf /tmp/measures.tgz

# install and configure sofa and measures
WORKDIR /build
RUN tar zxvf /tmp/sofa.tgz
WORKDIR /build/sofa/20231011/f77/src
RUN make -j${THREADS}


# setup boost
WORKDIR /build
RUN tar jxf /tmp/boost.tar.bz2
WORKDIR /build/boost_${BOOST_}
RUN ./bootstrap.sh --prefix=/opt/boost \
    --with-libraries=python \
    --with-python=/opt/python/${TARGET}/bin/python \
    --with-python-version=${PYMAJOR}.${PYMINOR} \
    --with-python-root=/opt/python/${TARGET}
RUN ./b2 -j${THREADS} \
    cxxflags="-fPIC -I/opt/python/${TARGET}/include/python${PYMAJOR}.${PYMINOR}/" \
    link=static,shared install

# casacore wants numpy. Do not take oldest_supported_numpy, because we want numpy 2.0 compatibility
RUN /opt/python/${TARGET}/bin/pip install numpy

# set up casacore
ADD . /code
RUN useradd -ms /bin/bash casacore
RUN chown casacore.casacore /code
USER casacore
RUN mkdir /code/build
WORKDIR /code/build
RUN cmake .. \
    -DPython3_ROOT_DIR=/opt/python/${TARGET} \
    -DPython3_EXECUTABLE=/opt/python/${TARGET}/bin/python3 \
    -DPython3_LIBRARY=/opt/boost/lib/libboost_python${PYMAJOR}${PYMINOR}.so \
    -DPython3_INCLUDE_DIR=/opt/python/${TARGET}/include/python${PYMAJOR}.${PYMINOR}/ \
    -DSOFA_ROOT_DIR=/build \
    -DBUILD_TESTING=OFF \
    -DDATA_DIR=${CASACORE_DATA} \
    -DPORTABLE=TRUE \
    -DUSE_PCH=FALSE \
    -DCMAKE_INSTALL_PREFIX=/usr/local
RUN make -j${THREADS}
USER root
RUN make install