diff --git a/.ci/py3.docker b/.ci/ubuntu20.04.docker similarity index 100% rename from .ci/py3.docker rename to .ci/ubuntu20.04.docker diff --git a/.ci/ubuntu22.04.docker b/.ci/ubuntu22.04.docker new file mode 100644 index 000000000..ef2eb59de --- /dev/null +++ b/.ci/ubuntu22.04.docker @@ -0,0 +1,122 @@ +FROM ubuntu:22.04 +ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_PRIORITY critical + +RUN apt update +RUN apt install -y libblitz0-dev python3-dev libblas-dev liblapack-dev libqdbm-dev wcslib-dev \ + libfftw3-dev python3-numpy libcfitsio-dev libboost-all-dev libboost-system-dev cmake g++ wget gfortran \ + libncurses5-dev bison libbison-dev flex libreadline6-dev python3-pip rsync \ + python3-virtualenv libgsl-dev + +##################################################################### +## casa data from NRAO +##################################################################### +RUN mkdir -p /usr/share/casacore/data/ +WORKDIR /usr/share/casacore/data/ +RUN rsync -avz rsync://casa-rsync.nrao.edu/casa-data . + +##################################################################### +## CASAcore from source +##################################################################### +RUN cd /opt && \ + wget https://github.com/casacore/casacore/archive/v3.5.0.tar.gz && \ + tar xvf v3.5.0.tar.gz && \ + rm v3.5.0.tar.gz && \ + mkdir casacore-3.5.0/build && \ + cd /opt/casacore-3.5.0/build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_DEPRECATED=OFF -DBUILD_PYTHON=OFF -DBUILD_PYTHON3=ON ../ && \ + make -j 16 && \ + make install && \ + rm -r /opt/casacore-3.5.0 && \ + ldconfig + +##################################################################### +## CASArest from source +##################################################################### +RUN cd /opt && \ + wget https://github.com/casacore/casarest/archive/v1.8.1.tar.gz && \ + tar xvf v1.8.1.tar.gz && \ + rm v1.8.1.tar.gz && \ + cd /opt/casarest-1.8.1 && \ + mkdir -p build && \ + cd /opt/casarest-1.8.1/build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../ && \ + make -j 16 && \ + make install && \ + rm -r /opt/casarest-1.8.1 && \ + ldconfig + +##################################################################### +## BUILD MAKEMS FROM SOURCE AND TEST +##################################################################### +WORKDIR /opt +RUN wget https://github.com/ska-sa/makems/archive/v1.5.5.tar.gz && \ + tar xvf v1.5.5.tar.gz && \ + rm v1.5.5.tar.gz && \ + mkdir -p /opt/makems-1.5.5/LOFAR/build/gnu_opt && \ + cd /opt/makems-1.5.5/LOFAR/build/gnu_opt && \ + cmake -DCMAKE_MODULE_PATH:PATH=/opt/makems-1.5.5/LOFAR/CMake \ + -DUSE_LOG4CPLUS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr ../.. && \ + make -j 16 && \ + make install && \ + cd /opt/makems-1.5.5/test && \ + makems WSRT_makems.cfg && \ + rm -r /opt/makems-1.5.5 + +##################################################################### +## BUILD MeqTrees from source +##################################################################### +WORKDIR /opt +RUN virtualenv venv -p python3.10 --system-site-packages +RUN . /opt/venv/bin/activate && pip install setuptools wheel pip -U +# Get MeqTrees universe python packages +RUN . /opt/venv/bin/activate && python3.10 -m pip install purr \ + owlcat \ + kittens \ + 'meqtrees-cattery>=1.7.6' \ + astro-tigger-lsm \ + # possible ABI issues if this is not pinned to system version \ + python-casacore==3.5.2 \ + # possible ABI issues if this is not pinned to system version \ + numpy==1.21.5 \ + --no-binary 'python-casacore' + + +ADD . /code +RUN mkdir /code/build && \ + cd /code/build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_PYTHON_3=ON \ + .. && \ + make -j8 && \ + make install && \ + rm -r /code/build && \ + ldconfig + +##################################################################### +## Run tests +##################################################################### + +# basic install tests +RUN . /opt/venv/bin/activate && flag-ms.py --help +RUN . /opt/venv/bin/activate && meqtree-pipeliner.py --help +RUN . /opt/venv/bin/activate && pyxis --help +RUN . /opt/venv/bin/activate && python3 -c 'from Timba import mequtils' + +# run test when built +WORKDIR /src +RUN . /opt/venv/bin/activate && python3 -m pip install pynose +RUN wget https://github.com/ska-sa/pyxis/archive/v1.7.4.3.tar.gz && \ + tar -xvf v1.7.4.3.tar.gz && \ + rm v1.7.4.3.tar.gz && \ + . /opt/venv/bin/activate && \ + python3.10 -m pip install /src/pyxis-1.7.4.3 && \ + cd /src/pyxis-1.7.4.3/Pyxis/recipes/meqtrees-batch-test && \ + pynose && \ + rm -r /src/pyxis-1.7.4.3 + +WORKDIR / +ENTRYPOINT ["meqtree-pipeliner.py"] +CMD ["--help"] \ No newline at end of file diff --git a/Jenkinsfile.sh b/Jenkinsfile.sh index f8d473291..35118140c 100644 --- a/Jenkinsfile.sh +++ b/Jenkinsfile.sh @@ -21,4 +21,5 @@ cd $PROJECTS_DIR/meqtrees-timba IMAGENAME="mttimbapr" # build and test -docker build -f .ci/py3.docker -t "${IMAGENAME}36:$BUILD_NUMBER" --no-cache=true . +docker build -f .ci/ubuntu20.04.docker -t "${IMAGENAME}38:$BUILD_NUMBER" --no-cache=true . +docker build -f .ci/ubuntu22.04.docker -t "${IMAGENAME}310:$BUILD_NUMBER" --no-cache=true . diff --git a/OCTOPUSSY/src/Dispatcher.cc b/OCTOPUSSY/src/Dispatcher.cc index 3dbf533ab..4978cef32 100755 --- a/OCTOPUSSY/src/Dispatcher.cc +++ b/OCTOPUSSY/src/Dispatcher.cc @@ -61,7 +61,11 @@ void Dispatcher::signalHandler (int signum,siginfo_t *,void *) #ifdef USE_THREADS if( DebugOctopussy::getDebugContext().check(2) ) { - printf("thread %ld: received signal %d (%s)\n",(long)Thread::self().id(),signum,sys_siglist[signum]); + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) + printf("thread %ld: received signal %d (%s)\n",(long)Thread::self().id(),signum,strsignal(signum)); + #else + printf("thread %ld: received signal %d (%s)\n",(long)Thread::self().id(),signum,sys_siglist[signum]); + #endif } #endif sigaddset(&raisedSignals,signum); diff --git a/OCTOPUSSY/src/Dispatcher.h b/OCTOPUSSY/src/Dispatcher.h index ec0a2312a..c7fac1eec 100755 --- a/OCTOPUSSY/src/Dispatcher.h +++ b/OCTOPUSSY/src/Dispatcher.h @@ -41,6 +41,7 @@ #include #include #include +#include #pragma aid Argv diff --git a/OCTOPUSSY/src/WPInterface.cc b/OCTOPUSSY/src/WPInterface.cc index eb11668e1..a9979c6eb 100755 --- a/OCTOPUSSY/src/WPInterface.cc +++ b/OCTOPUSSY/src/WPInterface.cc @@ -1076,7 +1076,11 @@ int WPInterface::input (int fd, int flags) //##ModelId=3C7DFD240203 int WPInterface::signal (int signum) { - dprintf(1)("unhandled signal(%s)\n",sys_siglist[signum]); + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) + dprintf(1)("unhandled signal(%s)\n",strsignal(signum)); + #else + dprintf(1)("unhandled signal(%s)\n",sys_siglist[signum]); + #endif return Message::ACCEPT; } diff --git a/OCTOPUSSY/src/WPInterface.h b/OCTOPUSSY/src/WPInterface.h index a5d66d294..0f92d7292 100755 --- a/OCTOPUSSY/src/WPInterface.h +++ b/OCTOPUSSY/src/WPInterface.h @@ -37,6 +37,7 @@ #include #include #include +#include namespace Octopussy {